apache 配置多站点 报404错误
照着视频敲的 修改了apache httpd.conf文件的载入
取消了虚拟目录的组件LoadModule vhost_alias_module modules/mod_vhost_alias.so 注释
以及# Virtual hosts
Include conf/extra/httpd-vhosts.conf
并在文件httpd-vhosts.conf修改了
NameVirtualHost *:8080
<VirtualHost *:8080>
DocumentRoot "E:/apache/b_com"
ServerName 172.30.65.2
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot "E:/apache/a_com"
ServerName 172.30.65.1
</VirtualHost> apache
[解决办法]
这个是基于IP的。。
http://httpd.apache.org/docs/2.4/vhosts/
#NameVirtualHost *:8080
<VirtualHost 172.30.65.2:8080>
DocumentRoot "E:/apache/b_com"
ServerName 172.30.65.2
</VirtualHost>
<VirtualHost 172.30.65.1:8080>
DocumentRoot "E:/apache/a_com"
ServerName 172.30.65.1
</VirtualHost>
VirtualHost *:8080
NameVirtualHost ×:80