What do we need?
- 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
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 tildemark.com
127.0.0.1 tildemark.com
you can check your work by doing a ping to your configured host.
Configuring XAMPP to accecpt Virtual Hosts
- Got to your Apache folder in XAMPP and locate the conf files. The are usually located at
<
>\xampp\apache\conf\extra - Open the file named httpd-vhosts.conf with a text editor
- If posible read the instructions so may have the idea on what you are doing
- 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
- Edit the line DocumentRoot with your own document root folder
- For each domain you are to configure paste the following lines below, just replace my domain name your corresponding domain:
DocumentRoot "E:\www\tildemark.com"
ServerName tildemark.com
ServerAlias tildemark.com
CustomLog "E:\www\tildemark.com\tildemark.com-access_log" combined
ErrorLog "E:\www\tildemark.com\tildemark.com-error_log"
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Leave a comment