【发布时间】:2012-04-06 20:41:54
【问题描述】:
我正在使用 Wamp 2.2,编辑 conf/extra/httpd-vhosts.conf 编辑此文件以添加 VirtualHosts ,但是当我在 httpd.conf 中取消注释行以包含 httpd-vhosts.conf 文件时,重新启动 Wamp 后不会启动。如果我恢复更改就可以了。
任何想法为什么会发生这种情况?
这是我在httpd-vhost.conf 中使用的代码:
<VirtualHost *>
ServerAdmin admin@localhost.com
DocumentRoot "C:/wamp/www" # change this line with your htdocs folder
ServerName localhost
ServerAlias localhost
<Directory "C:/wamp/www">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# WooCommerce Multisite
<VirtualHost dev.lo>
ServerAdmin admin@localhost.com
DocumentRoot "C:/wamp/www/dev"
ServerName dev.lo
ServerAlias dev.lo
<Directory "C:/wamp/www/dev">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
谢谢
乔治
编辑
按照 Andreas Hagen 的建议,我通过 httpd.exe 运行 Apache。
第一个错误是DocumentRoot 的参数错误,当DocumentRoot 只接受一个参数时,就像注释一样被视为第二个参数。
然后我收到警告:[warn] NameVirtualHost *:80 has no VirtualHosts。快速搜索并发现非常有用的问题 - https://serverfault.com/questions/1405/apache-2-startup-warning-namevirtualhost-80-has-no-virtualhosts
【问题讨论】:
标签: wamp wampserver