简体   繁体   中英

'httpd-vhost.conf' breaks Wamp?

This is my first post...

I am attempting to host a development website from my laptop using Wamp; my goal is to install Wordpress and have users log in from there homes...

  • I've successfully installed Wamp 2.2.
  • I've included 27.0.0.1 localhost in my 'host' file.
  • I've removed the # from the front of Include conf/extra/httpd-vhosts.conf .

localhost works perfectly until I edit my 'httpd-vhost.conf' file to include the following...

<VirtualHost *:80>
    SeverAdmin webmaster@localhost
    ServerName localhost
    DocumentRoot C:/Program Files/WampServer2/www
    ErrorLog "C:/Program Files/WampServer2/www/logs/error.log"
    CustomLog "C:/Program Files/WampServer2/www/logs/access.log" common
</VirtualHost>

Once I restart Wamp the icon stays orange. If I attempt to put Wamp online, an alert titled 'Aestan Tray Menu' stating "Could not execute menu item (internal error). [Exception] Could not preform service action: the service has not been started".

  • Port 80 tested as "not actually used".

When I run 'httpd.exe' a command window opens then immediately closes before I can read it. I've tried various formats to <VirtualHost *:80> with no avail, however once I comment out my changes I am able to successfully restart Wamp and access localhost .

I haven't been able to find post about this problem anywhere! Thanks!

I am not sure this is so complex. I know the original post is very old but just for those with a similar issue since I had it this morning.

To see the error, you run httpd.exe from within the command prompt. Just open a command prompt and then cd into the folder that contains httpd.exe , then type httpd.exe (ie don't just double click it from within the folder).

The result should tell you where the error lies. In my case, it was a syntax error inside the vhosts file.

I suspect your problem is the unquoted DocumentRoot with a space in it. Try:

<VirtualHost *:80>
    SeverAdmin webmaster@localhost
    ServerName localhost
    DocumentRoot "C:/Program Files/WampServer2/www" # <- quotes added around this line
    ErrorLog "C:/Program Files/WampServer2/www/logs/error.log"
    CustomLog "C:/Program Files/WampServer2/www/logs/access.log" common
</VirtualHost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM