Monkey Blaster Entertainment Header   Monkey Blaster Entertainment Header

Home | Games | Software | Movies | Wallpapers | Articles | Headlines

Internal

External



Search Google

Back to Articles

Setting up Apache Virtual Host in Windows


Many times when I am doing web development on my laptop I have a need for more than one site. By using virtual servers I can add as many virtual sites to my computer as I want. This tutorial walks you through how to set up virtual webservers in Apache using Windows

  1. Begin by opening the httpd.conf configuration file in your apache/conf directory.
    NameVirtualHost 127.0.0.1
    <VirtualHost 127.0.0.1>
       DocumentRoot "C:/web1"
       ServerName site1
    </VirtualHost>
    <VirtualHost 127.0.0.1>
       DocumentRoot " C:/web2"
       ServerName site2
    </VirtualHost>
  2. Save and close the file.
  3. Open Window's hosts file in a text editor (on XP it is located at C:\WINDOWS\system32\drivers\etc).
  4. Edit the file so your computer will be able to resolve the server names (add the new server names right below the localhost entry)
    127.0.0.1        localhost
    127.0.0.1        site1
    127.0.0.1        site2
  5. Save and close the file.
  6. Restart Apache (using the command line: C:\apache\Apache.exe -w -n "Apache" -k restart).
  7. Then you can access you servers through a webbrowser.

Comments


Leave a comment (* = required)
Name*
Site
Rating
Subject
Comment*
Security Image
Enter security code*

Engaging

Lois: Good, I don't have to cook.
Peter: Oh, no, go ahead and cook anyway, Lois, and we'll throw it out. I don't want you to get rusty.

Buy monkeybe.com apparel Custermap of visitors