Setting up Virtual Host for Apache2 server in Windows

April 27, 2011 — Leave a comment

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:

No Comments

Be the first to start the conversation!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s