我的本地开发机器上需要几个虚拟主机。不幸的是,它需要是窗户。
httpd-vhost.conf
<VirtualHost *:80>
ServerAdmin mateusz.tracz@vd.pl
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
ServerAdmin mateusz.tracz@vd.pl
DocumentRoot "C:/xampp/htdocs/manadom.local/public"
ServerName manadom.local
ErrorLog "logs/manadom.local-error.log"
CustomLog "logs/manadom.local-access.log" combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin mateusz.tracz@vd.pl
DocumentRoot "C:/xampp/htdocs/galeriabiznesu"
ServerName gb.loc
ErrorLog "logs/gb.loc-error.log"
CustomLog "logs/gb.loc-access.log" combined
</VirtualHost>
和主机文件:
127.0.0.1 localhost
127.0.0.1 manadom.local
127.0.0.1 gb.loc
问题是:本地主机指向
C:/xampp/htdocs/manadom.local/public
manadom.local 指向
C:/xampp/htdocs/manadom.local/public too
gb.loc 指向
C:/xampp/htdocs/manadom.local/public
我不知道怎么了?
请帮助我,我不是管理员,但我读了很多,我不知道我可能做错了什么。
对于命名虚拟主机,您必须设置"命名虚拟主机"指令。请查看手册 -> http://httpd.apache.org/docs/2.2/mod/core.html#namevirtualhost
是的,如前所述,在虚拟主机指令之前,您应该具有:
NameVirtualHost *:80