1 / 16

Appendix: Installing AMP (Apache + MySQL + PHP)

Appendix: Installing AMP (Apache + MySQL + PHP). AMP. AMP A – Apache Web Server M – MySQL Database Server P – PHP Language Support AMP Packs in Windows AppServ Official: http://www.appservnetwork.com/ Installed Softwares: Apache, MySQL, PHP, phpMyAdmin WAMPSERVER

agnesk
Télécharger la présentation

Appendix: Installing AMP (Apache + MySQL + PHP)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Appendix: Installing AMP (Apache + MySQL + PHP)

  2. AMP • AMP • A – Apache Web Server • M – MySQL Database Server • P – PHP Language Support • AMP Packs in Windows • AppServ • Official: http://www.appservnetwork.com/ • Installed Softwares: Apache, MySQL, PHP, phpMyAdmin • WAMPSERVER • Official: http://www.wampserver.com/en/index.php • Installed Softwares: Apache, PHP, SQLitemanager, MySQL, Phpmyadmin

  3. Getting AppServ • Download from official site: • Click “Download Now!” button • Select version you want. (here we choose 2.5.10)

  4. AppServ 2.5.10 V.S. 2.6.0 • 2.5.10 • Apache 2.2.8 • MySQL 5.0.51b • PHP 5.2.6 • phpMyAdmin-2.10.3 • 2.6.0 • Apache 2.2.8 • MySQL 6.0.4-alpha • PHP 6.0.0-dev (移除register_globals,magic_quotes…etc) • phpMyAdmin-2.10.3

  5. Installing AppServ (1) • Install • Double click the downloaded file (Appserv-win32-2.5.10.exe). • Select where to install, what to install • Setting server name, admin’s email, service port, and root password. • Unlock the Windows XP’s firewall, run up servers.

  6. Installing AppServ (2)

  7. Demo (1) • Open browser, connect to: http://localhost/

  8. Demo (2) • Using phpMyAdmin

  9. Demo (3) • Connecting from other host

  10. Apache Configurations

  11. Configuring Apache • Location • The default location of apache (in AppServ) is C:\AppServ\apache2.2\conf\ • Major configuration file: httpd.conf • Two types • Global configurations • Global setting • Server specific setting • Virtual host setting • Directory Configuration • Local setting for certain directory

  12. Configuring Apache – Global Configuration • Global setting • Timeout 300 • KeepAlive On • KeepAliveRequests 100 • StartServers 5 • Server configuration • Port 80 • ServerAdmin chwong@tphp.cs.nctu.edu.tw • ServerName tphp.cs.nctu.edu.tw • DocumentRoot "C:/AppServ/www"

  13. Configuring Apache – Directory Configuration (1) • Configuration parameters • Options • All (turn on all options except multiview) • ExecCGI (To allow executions of AddHandler) • FollowSymLinks (access files outside this directory) • Indexs (generate file-list for browsing) (when there is no DirectoryIndex files) • MultiViews (multi-language support) • AllowOverride • All (Read .htaccess) • None (ignoring .htaccess) • Deny/Allow • IP/DN (control access to this directory) • Order • Solve collision of deny and allow rules <Directory "C:/AppServ/www"> Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Order allow,deny Allow from all </Directory>

  14. Configuring Apache – Directory Configuration (2) • Virtual Directory (Directory Aliasing) • To map (alias) one sub-directory in the URL to one local directory that is not in the DocumentRoot directory. <IfModule alias_module.c> Alias /icons/ "C:/AppServ/Apache2.2/icons/" <Directory "C:/AppServ/Apache2.2/icons"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> Alias /cpg/ "D:/wwwroot/cpg/" <Directory "D:/wwwroot"> Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> </IfModule>

  15. Configuring Apache – Virtual Hosting (1) • Virtual Hosting • Providing services for more than one domain-name (or IP) in one web server. • IP-Based Virtual Hosting vs. Name-Based Virtual Hosting • IP-Base – Several IPs (or ports) • Name-Base – Singe IP, several hostnames • Example (Apache configuration) NameVirtualHost 140.113.17.215 <VirtualHost 140.113.17.215> ServerName nabsd.cs.nctu.edu.tw DocumentRoot "/www/na" </VirtualHost> <VirtualHost 140.113.17.215> ServerName tphp.cs.nctu.edu.tw DocumentRoot "/www/tphp" </VirtualHost> <VirtualHost 140.113.17.215:80> DocumentRoot /www/nabsd ServerName nabsd.cs.nctu.edu.tw </VirtualHost> <VirtualHost 140.113.17.221:80> DocumentRoot /www/tphp ServerName tphp.cs.nctu.edu.tw </VirtualHost>

  16. Configuring Apache – Virtual Hosting (2) Q: How Name-Based Virtual Hosting works? A: It takes use of HTTP Headers. % telnet cswproxy.cs.nctu.edu.tw 80 Trying 140.113.235.111... Connected to cswproxy.cs.nctu.edu.tw. Escape character is '^]'. GET / HTTP/1.0 Host: www.cs.nctu.edu.tw HTTP/1.0 200 OK Date: Tue, 05 Jun 2007 13:50:34 GMT ………… <html> <head> <title>NCTU -- CS</title> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <meta http-equiv="refresh" content="0; URL=chinese/doc/index.html"> </head> </html> Connection closed by foreign host. % telnet cswproxy.cs.nctu.edu.tw 80 Trying 140.113.235.111... Connected to cswproxy.cs.nctu.edu.tw. Escape character is '^]'. GET / HTTP/1.0 Host: www.csie.nctu.edu.tw HTTP/1.0 200 OK Date: Tue, 05 Jun 2007 13:51:01 GMT ………… <html> <head> <title>NCTU -- CSIE</title> <meta http-equiv="refresh" content="0; URL=http://www.cs.nctu.edu.tw/"> Connection closed by foreign host.

More Related