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 *>
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>
thank
George
Edit
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 - https://serverfault.com/questions/1405/apache-2-startup-warning-namevirtualhost-80-has-no-virtualhosts
source to share
Open the hosts ( \WINDOWS\system32\drivers\etc\hosts
) file . Add this line to the end:
127.0.0.1 test
This will tell the computer that any url containing the test will be redirected to 127.0.0.1 (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
</VirtualHost>
Now restart apache and navigate to: http: // test / (you may need to restart your browser for the changes to take effect.)
Hope it works.
source to share
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.
source to share