Virtual host with WAMP

I am using Wamp 2.2, edited conf/extra/httpd-vhosts.conf

edited this file to add VirtualHosts, but when I commented out the line in httpd.conf

to enable httpd-vhosts.conf, after restarting Wamp won't start. If I come back, the changes will be great.

Any ideas why this is happening?

This is the code I am using in httpd-vhost.conf


<VirtualHost *>
    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

# WooCommerce Multisite
<VirtualHost dev.lo>
    DocumentRoot "C:/wamp/www/dev"
    ServerName dev.lo
    ServerAlias dev.lo
    <Directory "C:/wamp/www/dev">
        Order allow,deny
        Allow from all





As Andreas Hagen said , I am running Apache via httpd.exe.

The first error was the wrong parameter for DocumentRoot

, since a comment appears similar to the accepted as the second parameter when DocumentRoot

only accepts one.

Then I got a warning: [warn] NameVirtualHost *:80 has no VirtualHosts

. Was a quick search and found a very helpful question -


source to share

3 answers

Probably some bad configuration in the vhosts file. Try starting apache from command line to get the error output. This will help you identify your problem.



Open the hosts ( \WINDOWS\system32\drivers\etc\hosts

) file . Add this line to the end:        test


This will tell the computer that any url containing the test will be redirected to (localhost).

Now open httpd.conf

and add this to the very bottom of the file:

NameVirtualHost *:80  
<VirtualHost *:80>  
    DocumentRoot "c:/wamp/www/myfirstsite/"  
    ServerName testsite  


Now restart apache and navigate to: http: // test / (you may need to restart your browser for the changes to take effect.)

Hope it works.



Go to C: / drive and select wamp folder

and go to C: \ wamp \ bin \ apache \ Apache2.4.4 \ conf folder and select httpd.conf file.

Edit with notepad and go to 58 line numbers

modify Listen 80 and replace Listen 8181 Save file and restart Apache server

Now check the url like localhost: 8181

I used this hop, you will succeed.



All Articles