Two websites on one server xampp 1.6.6

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

Two websites on one server xampp 1.6.6

Postby jami » 17. January 2009 17:41

Hi

I'd like to host more than one website on my server. I'm currently using xampp (Windows) version 1.6.6/ under previous versions I simply added a VirtualHost in the httpd.conf file. In 1.6.6 it appears to be different.
Can anyone help?

Thanks
jami
 
Posts: 9
Joined: 08. April 2005 08:07

Re: Two websites on one server xampp 1.6.6

Postby Wiedmann » 17. January 2009 19:59

I'd like to host more than one website on my server. ... I simply added a VirtualHost in the httpd.conf file.

That's exactly the way in all Apache versions (from 1.x to 2.2.x)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Two websites on one server xampp 1.6.6

Postby LazerDino » 17. January 2009 21:46

jami wrote:Hi

I'd like to host more than one website on my server. I'm currently using xampp (Windows) version 1.6.6/ under previous versions I simply added a VirtualHost in the httpd.conf file. In 1.6.6 it appears to be different.
Can anyone help?

Thanks

You enable virtual hosts in the httpd.conf file, but you add the parameters to the httpd-vhosts.conf file which is in C:\xampp\apache\conf\extra folder.
LazerDino
 
Posts: 5
Joined: 30. December 2008 19:36

Re: Two websites on one server xampp 1.6.6

Postby jami » 19. January 2009 11:57

Hi

Thanks for the reply. I found the httpd-vhosts.conf by chance after posting the thread. However, I now have a small problem with it.

Both urls, i.e. website1 and website2 point to the server but they both point to the same website1 homepage when accessing either url from the internet. However, from the LAN, they both point to the their respective homepages. Is there something I missed???

I want website2 to point to its own homepage. The website2 folder is in the htdocs folder of xampp, e.g. C:/xampp/htdocs/website2/index.html and website1 is in the default, e.g. C:/xampp/htdocs/index.html.

It's probably something so simple I'm overlooking it but I've played around with the paths the root folders with no luck. I remember vaguely, that there was somethign that needed to be changed in the Windows 'etc' directory of the server but I'm not sure if this still applies.

Thanks
jami
 
Posts: 9
Joined: 08. April 2005 08:07

Re: Two websites on one server xampp 1.6.6

Postby Izzy » 19. January 2009 12:02

Please paste here your httpd-vhosts.conf file so it can be checked out.

Also do a forum search for vhosts or virtualhost which may return some useful examples.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Two websites on one server xampp 1.6.6

Postby jami » 24. January 2009 18:28

<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/website1
ServerName www.website1.com
</VirtualHost>

Dans WINDOWS/System32/drivers/etc

127.0.0.1 localhost
127.0.0.1 www.website1.com

Quand je fais apache -S je reçois le message 'syntax ok'
jami
 
Posts: 9
Joined: 08. April 2005 08:07

Re: Two websites on one server xampp 1.6.6

Postby jontelling » 24. January 2009 19:30

I've got the same issuse, My vhost code is what I've copied of this site and is almost the same as yours paprt from I have servername before the dir.

Same thing, both urls goto the same site.
My URL's are controlled by no ip so I dont bother with the local host file (stay away from wins!!).

I'll be watching!!
jontelling
 
Posts: 2
Joined: 24. January 2009 19:26

Re: Two websites on one server xampp 1.6.6

Postby jontelling » 24. January 2009 22:18

Fixed it.
In the vhosts file find "##NameVirtualHost *:80" and remove the ##'s
jontelling
 
Posts: 2
Joined: 24. January 2009 19:26

Re: Two websites on one server xampp 1.6.6

Postby jami » 25. January 2009 19:36

Bonjour

Je viens de l'essayer et ça marche pour moi aussi.

Merci....c'était si simple mais je l'ai raté sur les autres threads.

:lol:
jami
 
Posts: 9
Joined: 08. April 2005 08:07

Re: Two websites on one server xampp 1.6.6

Postby Izzy » 26. January 2009 00:15

jami wrote:...c'était si simple mais je l'ai raté sur les autres threads.
Had you read the forum Announcements first and followed it's very simple rule you would have been up and running much sooner and saved others their precious time, which is offered here voluntarily and for free to responsible forum members.

You are obviously a person who completely ignores rules, simple or otherwise, therefore and from now on, you must suffer the consequences.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 39 guests