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

Brian (at the Quahog county trailer park): You're really going to take back donated presents on Christmas Eve?
Peter: Yep, now here's the plan: You'll enter through the air contitioning duct here. Now there'll be an invisible laser grid three inches from the floor, so you'll have to compress your body to the size of an ordinary household sponge and slide underneath like some kind of weird amphibious dolphin.
Brian: Can I buy some pot from you?

Buy monkeybe.com apparel Custermap of visitors