带WAMP的虚拟主机

Mam*_*uka 3 wamp wampserver

我正在使用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>
Run Code Online (Sandbox Code Playgroud)

谢谢

乔治

编辑

正如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

And*_*gen 5

可能是vhosts文件中的一些错误配置.尝试从命令行启动apache,以便获得错误输出.这将有助于您找出问题所在.