Setting up Virtual Hosts with XAMPP running on Windows XP

Setting up Virtual Hosts with XAMPP running on Windows XP
2008 Jul 30
virtual.gifSetting up virtual hosts with XAMPP is very straight forward and could be done in less than 5 minutes. Although, your local XAMPP server will still work even if virtual hosts are not configured. You might want to ask, is there a need for my local XAMPP setup to configure virtual hosts? Apparently, virtual hosts are needed when

* your on multiple domains
* your need to test your projects with same configuration with the server
* test your projects without touching your public server
* your just organizing your projects into groups
* or setup a local copy of your blog or website

What do we need?
This document assumes that you are working with Windows XP with XAMPP. If you don’t have XAMPP, get it at their XAMPP for Windows download page. Just execute the exe file and follow the onscreen instructions.

Configuring Windows XP to accept hosts
Hosts is a file under Windows XP that is used to map IP addresses to a custom list of hosts or maybe domain names. The IP address should be placed in one line. The first column should contain the IP address and on the second column its corresponding hostname. The IP address may be separated by a space or by a tab. You can place comments by prepending your line this symbol ‘#’ (pound sign). Initially the first line is added. Now lets add our domain tildemark.com

127.0.0.1 localhost
127.0.0.1 http://www.tildemark.com
127.0.0.1 tildemark.com

you can check your work by doing a ping to your configured host.
pinging-tildemark.com.jpg

Configuring XAMPP to accecpt Virtual Hosts

1. Got to your Apache folder in XAMPP and locate the conf files. The are usually located at <>\xampp\apache\conf\extra
2. Open the file named httpd-vhosts.conf with a text editor
3. If posible read the instructions so may have the idea on what you are doing
4. Now paste the following code at the bottom of the file without touching the document.

NameVirtualHost 127.0.0.1:80

DocumentRoot E:/xampp/htdocs/ # change this line with your htdocs folder
ServerName localhost

5. Edit the line DocumentRoot with your own document root folder
6. For each domain you are to configure paste the following lines below, just replace my domain name your corresponding domain:

DocumentRoot “E:\www\www.tildemark.com”
ServerName http://www.tildemark.com
ServerAlias http://www.tildemark.com

CustomLog “E:\www\www.tildemark.com\www.tildemark.com-access_log” combined
ErrorLog “E:\www\www.tildemark.com\www.tildemark.com-error_log”

Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

sumber : http://www.tildemark.com/software/servers/setting-up-virtual-hosts-with-xampp-running-on-windows-xp.html

About madinaid
it consultan

Leave a Reply

Fill in your details below or click an icon to log in:

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

%d bloggers like this: