2

我的本地开发机器上需要几个虚拟主机。不幸的是,它需要是窗户。

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

问题是:localhost指向

C:/xampp/htdocs/manadom.local/public

manadom.local 指向

C:/xampp/htdocs/manadom.local/public too

gb.loc 指向

C:/xampp/htdocs/manadom.local/public

我不知道怎么了?

请帮助我,我不是管理员,但我读了很多,我不知道我可能会做错什么。

4

2 回答 2

3

是的,如前所述,在虚拟主机指令之前,您应该拥有:

NameVirtualHost *:80
于 2012-11-15T15:37:20.053 回答
3

对于命名虚拟主机,您必须设置“NamedVirtualHosts”指令。请看手册-> http://httpd.apache.org/docs/2.2/mod/core.html#namevirtualhost

于 2012-11-15T10:49:47.320 回答