Virtual Hosts?

Okay, I am pretty new to all this however I have a dedicated server with cent os 64 bit. When I put my IP my browsers url box it shows the apache default page. I just am looking to find out how to change this to point to my main site.

Thanks, but it looks like you are using a windows based server where as mine is Linux based. (cent os5 64bit). If you know how to do it on there a guide like this would be greatly appreciated. I appreciate what help you have provided anyway.

Well, from here you need to create a new site in Apache, using the “VirtualHost” declaration.

Configure Apache for Virtual Hosts

Let us know if you get stuck with Apache.


First, WELCOME to SitePoint’s Apache forum!

Second, you can use your current (htdocs) directory for your “main site” or progress straight into VirtualHosts. The sooner you do that, the easier your life will be.

You’ll need to do three, er four things:

  1. Open and edit your httpd-vhosts.conf file. That has always been well commented and you really don’t need anything fancy so just use the examples there as a template for your data. FOR LOCAL USE, use your domain name without the extension as the ServerName and ServerAlias and be sure to point to the physical folder on your system for the DocumentRoot.

  2. Open and edit httpd.conf to enable the include statement for httpd-vhosts.conf.

  3. Open and edit your hosts (extensionless) file (C:\Windows\system32\drivers\etc\hosts if you’re on a WinDoze box) and add {the same ServerAlias you used in the vhosts file.

  4. RESTART Apache.



Sounds good, lot of reading so it will take me quite some time but thanks because I have been looking for a guide like that.