Setting up Virtual Host for Apache2 server in Windows

Do you want to host your web site from your server?  In my previous post, I posted about how you can install Moodle in Windows 2008 server using Zend server.

Install Moodle 2.0 in Zend Server running on Windows 2008
Installing Zend Server Community Edition (CE) in Windows 2008 Server

Now I decided to route my www.domainname.com to the server which I setup.

I already have a DNS name and IP address for the server.  I also purchased DynDNS Pro from http://www.dyndns.com/

1.  Go to Apache2 folder and open conf.  In conf folder you will see a file called httpd.  This is the file we need to modify.  So go head and open the file in notepad

Configuring Apache web server on Windows 2008

2. Search for “Listen 80” and add the following code

DocumentRoot: Location of your web folder. In my case, I am running Moode
Server Name: Your Domain name which you want to resolve

<VirtualHost *:80>
DocumentRoot "D:\Zend\Apache2\htdocs\moodle"
ServerName www.yourdomain.com
</VirtualHost>
Configuring Apache web server on Windows 2008 : Virtual Host

3.  If you have your domain name,  you need to go and edit your host records and enter your IP address of the server

Configuring Apache web server on Windows 2008 : Edit Host Records

4. Now you should able to resolve your URL to the server.

Technorati Tags: Apache2 Server in Windows

Leave a Comment