Vhost question

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Vhost question

Postby special18 » 16. January 2008 18:13

Hello gy's I know this question has bin asked before but for me i coudt make sense of it cause it wasent really a good exampel for me.

Now thing is I want to host 4 domains on the same server these are,


My own static ip adres at the moment is, I woud like the domains to be listed like htdocs/domainname. Coud anyone help me provide me with the vhost thingy and what I shoud do next with it?

I woud really apriciate it and sorry to bother you but thanxs for any effort at all.
Posts: 3
Joined: 16. January 2008 18:11

Postby LooseCannon » 16. January 2008 18:51

Hello and welcome special18.

What have you tried so far?

Have you been near C:\xampp\apache\conf\extra\httpd-vhosts.conf?

(Remember, make a copy of any config file before editing it!)

Have you tried something like:
Code: Select all
<VirtualHost *:80>
DocumentRoot c:\xampp\htdocs\linklinky
ServerName www.linklinky.com
and seen what happens? That code is rather lacking, but I'm trying to prompt you.

Have you considered the hots file in C:\WINDOWS\system32\drivers\etc?

Please let us know. There are no failures, simply learning. ;)
User avatar
Posts: 162
Joined: 18. September 2007 12:07
Location: Hampshire, UK

Postby special18 » 16. January 2008 18:59

Actually no I havent yet, see I have my domains on a difrent server, and moving them and causing days of downtime is something that both you and me woudt like right mate?

But that code <VirtualHost *:80>

Shoudt it be like something:

<VirtualHost *:80>
DocumentRoot c:\xampp\htdocs\linklinky
ServerName www.linklinky.com

Also question, is my ip I have idotz.net shoud I make custom nameservers there? or yust point a domain to a ip, cause I wanna make it look like real domain not a direct to a ip. + is that * a place where my ip shoud be? Also in apache it shows a exampel like so

##<VirtualHost *:80>
## ServerAdmin webmaster@dummy-host.example.com
## DocumentRoot /www/docs/dummy-host.example.com
## ServerName dummy-host.example.com
## ServerAlias www.dummy-host.example.com
## ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
## CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common

Serveralias is not needed? Sry to ask to much, but thanxs for any info ye gave me so far.
Posts: 3
Joined: 16. January 2008 18:11

Postby Izzy » 17. January 2008 03:53

special18 wrote:... I know this question has bin asked before but for me i coudt make sense of it cause it wasent really a good exampel for me.

I find that hard to believe as there are many very detailed examples of virtual host configurations posted in this forum, and all you needed do, in most cases, was insert your own domain information and path locations of your files.

Here is an example configuration for your first domain in the list, which you should test that it works before adding more - just continue to add the other domains one at a time and test each after adding, don't add more until you are sure there are no errors.

This configuration may give you all the options required to duplicate a hosted web site including it's own cgi and log file configurations.

This is a name based virtual host configuration as an IP based vhost is not recommended in your case unless you have a separate IP from your ISP for each domain name, which I doubt - so we use a wild card IP on port 80 - *:80 for each domain name.

NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all

<VirtualHost *:80>
ServerName linklinky.com
ServerAlias www.linklinky.com
DocumentRoot "C:/xampp/htdocs/linklinky"
<Directory "C:/xampp/htdocs/linklinky >
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
ScriptAlias /cgi-bin/ "C:/xampp/htdocs/linklinky/cgi-bin/"
ServerAdmin serveradmin@linklinky.com
CustomLog logs/linklinky.log combined
ErrorLog logs/linklinky_error.log
LogLevel error

Test this first and if it works without error then just add the other domains in their own vhost containers below the last entry but change the relevant names and paths (double check that you have no typos) - make sure the directories are created and the paths are correct before testing.

You may need to exit the Internet to test your domains locally and before editing your zone file - see below.

If you get an error after testing the first container linklinky then open a command console window and cd to
Type the command apache -S and paste the result here - click on the little icon top left in the window title bar and select Edit for the Mark and Copy commands in the context menu.

Now so you have local access to your domains if you are off line we need to enter those domains in the Windows hosts file.

Open by dragging the hosts file into your text editor:

Add these entries, if any of them are not already included, to the top of the host file - don't rename this hosts file in any way:
Code: Select all     localhost     linklinky.com     www.linklinky.com     animeresource.org     www.animeresource.org     valkery.org     www.valkery.org     willemyn.com     www.willemyn.com

www is deemed to be a sub domain of the main domain and as such is treated as a domain alias just like any other regular sub domain regardless of how Google interprets it. - example:
ServerName linklinky.com
ServerAlias www.linklinky.com, secure.linklinky.com, forum.linklinky.com

BTW - you can still have your domains on your hosted server at GoDaddy and on your PC, by having your domain name Zone file include the IP of your PC, being as you have a fixed IP - GoDaddy allows you to edit your Zone file from your Control Panel or your domain name registrar idotz will have the details and location of your Zone file (DNS) for editing but remember this subject is not XAMPP related.

If when you enter your domain for access locally you go to your hosted site at GoDaddy then for testing purposes and before you edit the DNS Zone file, temporarily disconnect your Internet connection and importantly make sure your ISP will allow you to host a web server on your IP and has not blocked incoming traffic on port 80 - on cable most ISPs will block email and web servers until you request them to remove the restrictions.
Posts: 3344
Joined: 25. April 2006 17:06

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 59 guests