- Shared Hosting
- How To Add Virtual Host Domain Xampp
This Tutorial Will Show You How You Can Put A Virtual Host In Your Xampp Server On Your Local Computer , Last Updated: Sat Feb 08, 2020
Wed Dec 02, 2009
if you are here its probably because you have xampp on your computer. many admins use xampp to test their scripts. they use xampp as their testing server. one way to enhance the capabilities of xampp is to actually test your script as the real thing by using a tld domain name.
for example, lets say i have a domain name called: example.com
this is how i would put a virtual host in my computer.
note: my computer is running windows xp, its the same it you are running windows 7 also
locate the httpd.conf file. you can find it in:
open httpd.conf and scroll all the way to the bottom, you will see something like this:
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
# ServerAdmin [email protected]
# DocumentRoot /www/docs/www.example.com
# ServerName www.example.com
# ErrorLog logs/www.example.com-error_log
# CustomLog logs/www.example.com-access_log common
as you can see from the information you are provided in the httpd.conf file its very easy to create a virtual host.
all you have to do is replace "example.com" with whatever you domain name is
after you have made the changes, you can restart your xampp
NOTE, after you restart your server, you might get this message:
[error] (OS 11002)This is usually a temporary error
during hostname resolution and means that the local server did not receive
a response from an authoritative server. : Cannot resolve host name
www.example.com --- ignoring!