Download presentation
Presentation is loading. Please wait.
Published byBeryl Webb Modified over 9 years ago
1
Appendix: Installing AMP (Apache + MySQL + PHP)
2
Training Course, CS, NCTU 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/http://www.appservnetwork.com/ Installed Softwares: Apache, MySQL, PHP, phpMyAdmin WAMPSERVER Official: http://www.wampserver.com/en/index.phphttp://www.wampserver.com/en/index.php Installed Softwares: Apache, PHP, SQLitemanager, MySQL, Phpmyadmin
3
Training Course, CS, NCTU 3 Getting AppServ Download from official site: Click “Download Now!” button Select version you want. (here we choose 2.5.10)
4
Training Course, CS, NCTU 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
Training Course, CS, NCTU 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
Training Course, CS, NCTU 6 Installing AppServ (2)
7
Training Course, CS, NCTU 7 Demo (1) Open browser, connect to: http://localhost/http://localhost/
8
Training Course, CS, NCTU 8 Demo (2) Using phpMyAdmin
9
Training Course, CS, NCTU 9 Connecting from other host Demo (3)
10
Apache Configurations
11
Training Course, CS, NCTU 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
Training Course, CS, NCTU 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.twchwong@tphp.cs.nctu.edu.tw ServerName tphp.cs.nctu.edu.tw DocumentRoot "C:/AppServ/www"
13
Training Course, CS, NCTU 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 Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Order allow,deny Allow from all
14
Training Course, CS, NCTU 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. Alias /icons/ "C:/AppServ/Apache2.2/icons/" Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all Alias /cpg/ "D:/wwwroot/cpg/" Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride All Order allow,deny Allow from all
15
Training Course, CS, NCTU 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) DocumentRoot /www/nabsd ServerName nabsd.cs.nctu.edu.tw DocumentRoot /www/tphp ServerName tphp.cs.nctu.edu.tw NameVirtualHost 140.113.17.215 ServerName nabsd.cs.nctu.edu.tw DocumentRoot "/www/na" ServerName tphp.cs.nctu.edu.tw DocumentRoot "/www/tphp"
16
Training Course, CS, NCTU 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 ………… NCTU -- CS 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 ………… NCTU -- CSIE Connection closed by foreign host.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.