Virtual Host on Windows with XAMPP
On my first tutorial we was try to Installing WordPress on Windows use XAMPP, this time I will give little help again how to tweak our local server, and make it Virtual Host enable. So we can develop many many website in one time and still in our windows local machine.
This tutorial also work on Mac OSX, Linux Desktop, FreeBSD Desktop with little tweak.
- Windows of course
- XAMPP from ApacheFriends already installed
- Notepad or Notepad++
- A Glass of coffee ;)
Let’s get started.
After XAMPP Installed, go to you XAMPP Installed folder. After opened try to edit this file with Notepad++ for more easy way or use Notepad for old way..
Apache > Conf > Extra > httpd-vhosts.conf
After that, try to look this original configuration
Look on that code, is that really long code and if work in Apache, if code have this # the code didn’t executed by Apache server.
Now we will try to add one virtual host, just edit all code above become like this below.
On code above I try add two virtual host, the first one for take original http://localhost, and the second one for my WordPress virtual host http://wordpress.local
After code was completed, safe and exit.
Now, the magic time, in windows and many Operating Sytem, before they looking another DNS Server, many OS will check they hosts list on they machine, so let add new domain to our hosts machine.
Open you fave editor (Notepad++) for me, and Open File on this folder
C:\WINDOWS\system32\drivers\etc\
And select hosts
You will find this code
That original Windows hosts, and this the time to add some host on you local machine to enable virtual host, below 127.0.0.1 localhost add this
That all, after that restart you Apache and try to point you Browser to new address, and holla you are dona add virtual host on you own local machine.
Popularity: 51% [?]




















July 26th, 2007 at 9:17 pm
Like your tutorial.
Got Virtual Host running.
Thanks
September 13th, 2007 at 6:25 am
Great post, was very helpful in setting up my multiple hosting arrangement.
Took some sorting out to make sure it would work, so I thought I’d share what I did here.
I was using xampp, so added the details in the http-vhosts.conf file, saved, then tried to restart - and apache just wouldn’t restart. Deleted everything I had changed and it worked fine. But I didn’t have the multiple hostings.
I took a look through the info on the Apache website, and read through the httpd.conf file, and then realised a couple of things.
The first entry in your http-vhosts.conf file must have exactly the same detail as what’s in your httpd.conf file.
Also, I don’t think I realised that the DocumentRoot had to be in “Inverted Commas” - they are in your post, I just don’t think I recognised that at the time.
But I’ve now got it set up and will be hosting my websites from there soon!
January 9th, 2008 at 9:03 am
This works great! You just made me so much more productive.
April 7th, 2008 at 6:23 am
I have a server running on linux, but I want to run an XAMPP server too.
How can I set it up so that I can access the XAMPP server remotely?
Is there a way to change the adress to access the server?
(anyway, thanks for the tut. :D)
April 9th, 2008 at 3:58 pm
WTF? Do you use XAMPP? Does it require conf editing? Oh guys, visit russian site denwer.ru . If it’s difficult to you to understand it, go directly
http://www.denwer.ru/dis/Base/Denwer3_Base_2008-01-13_a2.2.4_p5.2.4_m5.0.45_pma2.6.1.exe
it will create sites and subdomain as fast as you add diretory to Z:\home\yoursitename\www\ + all alias.
It’s really easy to test locally ;)
June 22nd, 2008 at 3:42 pm
[…] fitur virtualhost serta setting hosts di windows. Jika bingung caranya, coba aja ikuti petunjuk setting virtual host disitu, anda bisa nyaman coding dan develop […]
June 24th, 2008 at 5:30 pm
[…] Virtual Host on Windows with XAMPP | IndoDX Como configurar domínios e subdomínios no xampp. (tags: portable windows development apache xampp) […]