JLBN - Virtual Hosts on WAMP

J L B N

Free Guides, Themes, Photo, Games, Movies

Step 4

Use Notepad (or your desire text editor) to open file httpd-vhosts.conf in folder C:\wamp\bin\apache\apache2.2.6\conf\extra, delete everything in there and replace with these codes below. Make sure to put your main site on very first and localhost in very last.

Note: In case your ISP blocks default port 80, you can use association rule to setup URL without port attach to it and of course without the need to use port forward services such as no-ip. In this case, skip this page and use the altenate page or email us ;-)

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.com
ServerAlias domain.com domain
DocumentRoot C:/wamp/www/domain
ErrorLog "C:/wamp/www/domain/logs/error.log"
CustomLog "C:/wamp/www/domain/logs/access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerName sub1.domain.com
ServerAlias sub1
DocumentRoot C:/wamp/www/sub1
ErrorLog "C:/wamp/www/sub1/logs/error.log"
CustomLog "C:/wamp/www/sub1/logs/access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerName sub2.domain.com
ServerAlias sub2
DocumentRoot C:/wamp/www/sub2
ErrorLog "C:/wamp/www/sub2/logs/error.log"
CustomLog "C:/wamp/www/sub2/logs/access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
ErrorLog "C:/wamp/www/logs/error.log"
CustomLog "C:/wamp/www/logs/access.log" common
</VirtualHost>

 

When you ready, click here to go to the next page

Appreciation, Suggestion, Question, or Comment, click here

It's NO MATTER a million or only one dollar donation BUT it's your generosity to help; thus, if you find our website is useful, please consider making a symbolic donation through our PayPal on JLBN.net. Thanks.