我正在使用Wamp 2.2编辑conf/extra/httpd-vhosts.conf
编辑此文件来添加VirtualHosts,但是当我在httpd.conf
的未注释行中包含httpd-vhosts.conf文件后,重新启动Wamp后无法启动。如果我恢复更改是正常工作。虚拟主机与WAMP
任何想法为什么会发生这种情况?
这是我使用的代码httpd-vhost.conf
:
<VirtualHost *>
ServerAdmin [email protected]
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 [email protected]
DocumentRoot "C:/wamp/www/dev"
ServerName dev.lo
ServerAlias dev.lo
<Directory "C:/wamp/www/dev">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
感谢
乔治
编辑
由于安德烈亚斯·哈根的建议,我通过httpd的运行Apache 。可执行程序。
第一个错误是DocumentRoot
的错误参数,因为出现的注释类似于作为第二个参数,当DocumentRoot
只接受一个时。
然后我得到警告:[warn] NameVirtualHost *:80 has no VirtualHosts
。有一个快速搜索,发现非常有帮助的问题 - https://serverfault.com/questions/1405/apache-2-startup-warning-namevirtualhost-80-has-no-virtualhosts
什么是从cmd开始它的命令? – Mamaduka 2012-03-22 10:03:34
只需运行该exe文件。认为它被命名为httpd.exe – 2012-03-22 10:05:50
试过,但httpd.exe只要我打开它就关闭,所以不能得到错误通知。 – Mamaduka 2012-03-22 15:55:13