----------
安裝
----------
雙擊安裝程序, 它將引導(dǎo)你完成整個安裝過程。請確保你輸入正確的服務(wù)器URL(如果你的服務(wù)器沒有DNS名稱,你可以直接輸入IP地址)。建議將Apache安裝成" for all Users,on Port 80,as a service" Apache將自動安裝一個系統(tǒng)服務(wù)以自動啟動。注意:如果你已經(jīng)有一個IIS或者其它的程序使用80端口,安裝可能會失敗。如果是這樣,你可以到程序目錄下的Apache Group\Apache2\conf目錄中找到文件httpd.conf,將其中的Listen 80改成一個不用的端口,比如Listen 81。然后重新運行這個安裝程序,這次應(yīng)該不會再有問題了。
單個IP地址的服務(wù)器上基于域名的虛擬主機配置:
# Ensure that Apache listens on port 80
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
DocumentRoot /www/example1
ServerName www.example1.com
ServerAlias example1.com. *.example1.com
# Other directives here
DocumentRoot /www/example2
ServerName www.example2.org
# Other directives here
在多個IP地址的服務(wù)器上配置基于域名的虛擬主機:
Listen 80
# This is the “main” server running on 172.20.30.40
ServerName server.domain.com
DocumentRoot /www/mainserver
# This is the other address
NameVirtualHost 172.20.30.50
DocumentRoot /www/example1
ServerName www.example1.com
# Other directives here …
DocumentRoot /www/example2
ServerName www.example2.org
# Other directives here …