Creating a Virtual Host in Windows Apache Server
I am using WAMP Server, an open source web server project, to do my web programming projects with PHP/MySQL . WAMP Server because I am running Windows OS; WAMP stands for Windows, Apache, MySQL, and PHP. It’s a software package actually installed in your computers in one click installation procedure. For Linux, we have LAMP.
Anyway, working with web projects sometimes requires you to do thorough testing before going to live testing and deployment of the web application. Now, a client may require you to have it locally tested using a virtual host, emulating the live production testing. Having Apache with my installed web server, now I can set up a virtual host to do the necessary testing of the application. Here’s how:
- Open your Apache’s httpd.conf file and append the follow lines:
<VirtualHost 127.0.0.1>
ServerAdmin your@email.com
DocumentRoot d:/webproject/directory/goes/here
ServerName yourdomain.local
ErrorLog d:/wamp/logs/yourdomain.local-error_log
TransferLog d:/wamp/logs/-access_log
</VirtualHost>Click Save and close the file.
- Then, open hosts file located at C:\windows\system32\drivers\etc (usually for Windows). Add the following line:
127.0.0.1 yourdomain.local
- Save the file and restart your Apache server to take effect.
- Now, open your web browser and try opening http://yourdomain.local
* Please edit the names in to set your appropriate virtual host configuration.
You might also want to read...
Tags: apache, apache virtual host, apache windows, virtual host, wamp, windows apache
-
http://www.learnbehind.com/Learn/php/page/4 Jonathan
-
http://www.learnbehind.com/Learn/php/page/4 Jonathan

Hi! I am Jerome Locson from Zamboanga City, Philippines. I am programmer, web developer and designer, technopreneur, and blogger. I blog about technology, foods and my travel. Thank you for visiting!