需要修改两个文件!
我装在了D盘,不同的盘符,自己找
目录位置分别为:
D:\AppServ\Apache24\conf\httpd.conf
D:\AppServ\Apache24\conf\extra\httpd-vhosts.conf
第一步,修改httpd.conf文件!打开!
1.找到:
#Listen 12.34.56.78:80
Listen 80
复制Listen 80,然后在下面在添加一个!我改成88端口
Listen 88
#Listen 12.34.56.78:80 Listen 80 Listen 882.继续找到LoadModule vhost_alias_module modules/mod_vhost_alias.so
把前面的#号去掉就好了!
#LoadModule version_module modules/mod_version.so LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule watchdog_module modules/mod_watchdog.so3.找到<Directory />
<Directory /> AllowOverride none Require all denied </Directory>吧下面一行注释掉
<Directory /> AllowOverride none # Require all denied </Directory>4.找到:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
去掉下面一行的#号
# Virtual hosts Include conf/extra/httpd-vhosts.conf第二步:打开httpd-vhosts.conf
首先把这些全部注释加上#号
#<VirtualHost _default_:80> #DocumentRoot "${SRVROOT}/htdocs" #ServerName www.example.com:80 #</VirtualHost>然后看下面的:两个80端口,第一个不管,改第二个!
分别是
这都是我修改过的!如果你电脑装的是appserv 8.0.0可以直接把这个复制进去!目录可以看到D:/AppServ/www修改成你自己的!下面一个也是一样!
<VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot D:/AppServ/www ServerName dummy-host.example.com ServerAlias www.dummy-host.example.com ErrorLog "logs/dummy-host.example.com-error.log" CustomLog "logs/dummy-host.example.com-access.log" common </VirtualHost> <VirtualHost *:88> ServerAdmin webmaster@dummy-host2.example.com DocumentRoot D:/AppServ/www88 ServerName dummy-host2.example.com ErrorLog "logs/dummy-host2.example.com-error.log" CustomLog "logs/dummy-host2.example.com-access.log" common </VirtualHost>
如果出现403错误
复制<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
Satisfy all
</Directory>
替换
<Directory /> AllowOverride none Require all denied </Directory>
映射目录在www下!