久艹网,亚洲一日韩欧美中文字幕2019,国产欧美日韩精品专区黑人,一区二区三区久久99

中山php|最優(yōu)網(wǎng)絡(luò)中山做網(wǎng)站 中山php建站

最優(yōu)良人

2011/08/07 at 01:42

Apache 配置虛擬服務(wù)器

1,修改本機的hosts文件,如下:  
示例:
127.0.0.1 localhost
127.0.0.1 www.test.com
127.0.0.1 test.com

2,打開Apache的安裝目錄,找到httpd.conf文件,分別去掉下面兩行文字前面的#號。  
#LoadModule vhost_alias_module modules/mod_vhost_alias.so   
去掉#意思是啟用apache的虛擬主機功能?! ?br /> #Include conf/extra/httpd-vhosts.conf  
去掉這一行的#意思是從conf/extra/httpd-vhosts.conf這個文件導(dǎo)入虛擬主機配置。

3,打開extra目錄內(nèi)的httpd-vhosts.conf文件,把默認(rèn)的配置


ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "/www/docs/dummy-host.localhost"
ServerName dummy-host.localhost
ServerAlias www.dummy-host.localhost
ErrorLog "logs/dummy-host.localhost-error_log"
CustomLog "logs/dummy-host.localhost-access_log common"


ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "/www/docs/dummy-host2.localhost"
ServerName dummy-host2.localhost
ErrorLog "logs/dummy-host2.localhost-error_log"
CustomLog "logs/dummy-host2.localhost-access_log common"

改成自己想要的目錄和域名


ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "D:/wamp/www/"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error_log"


ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "D:/wamp/www/web/"
ServerName test.com (填主域名)
ServerAlias *.test.com (這里的服務(wù)器別名可以支持泛解析)
ErrorLog "logs/localhost-error_log"

如果 弄完之后 出現(xiàn)403錯誤 那 在httpd.conf里找到:

Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order deny,allow
Deny from all
Satisfy all

更改為

Options FollowSymLinks ExecCGI Indexes
AllowOverride None
# Order deny,allow
# Deny from all
# Satisfy all

標(biāo)簽:,
-