More then 1 site hosted on same machine ?

Alles, was den Apache betrifft, kann hier besprochen werden.

More then 1 site hosted on same machine ?

Postby fyndler » 15. June 2009 03:57

Hey,

I read somewere about this easy thing how to add more websites to one machine, he said i should simply do this




Open the httpd-vhosts.conf file. It is located in apache\conf\extra


NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\site1"
ServerName www.site1.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\site2"
ServerName www.site2.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\site3"
ServerName www.site3.com

But with my folder name and my domains

Restart xampp

I have made all that but all domains i add points to site1 :/

Like site2 is same site as site1 and site3 is same as site1

Any suggestions ?
fyndler
 
Posts: 38
Joined: 28. October 2007 17:29

Re: More then 1 site hosted on same machine ?

Postby fyndler » 16. June 2009 01:52

Okey got it working, needed to change in host file in drivers folder

Anyhow it all dipense on how i write the urls

If i write like site2.com i get to site one, but if i write http://www.site2.com it works fine :/

How to solve that problem really ennoying
fyndler
 
Posts: 38
Joined: 28. October 2007 17:29

Re: More then 1 site hosted on same machine ?

Postby Wiedmann » 16. June 2009 06:34

If i write like site2.com i get to site one, but if i write http://www.site2.com it works fine :/

In a string comparison "site2.com" is not the same as "www.site2.com".
--> Look in the manual for the directive "ServerAlias".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: More then 1 site hosted on same machine ?

Postby fyndler » 17. June 2009 04:57

Wiedmann wrote:
If i write like site2.com i get to site one, but if i write http://www.site2.com it works fine :/

In a string comparison "site2.com" is not the same as "www.site2.com".
--> Look in the manual for the directive "ServerAlias".



Still dong get it :/ hehe

My host file

127.0.0.1 brutalfps.com

My vhost file


<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\gamer"
ServerName brutalfps.com
<Directory "C:\xampp\htdocs\gamer>
</Directory>
</VirtualHost>


Should i add this to host ?

127.0.0.1 www.brutalfps.com and 127.0.0.1 http://brutalfps.com

And this to my vhost file

<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\gamer"
ServerName www.brutalfps.com
<Directory "C:\xampp\htdocs\gamer>
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\gamer"
ServerName http://brutalfps.com
<Directory "C:\xampp\htdocs\gamer>
</Directory>
</VirtualHost>

Or i way out and biking ?
fyndler
 
Posts: 38
Joined: 28. October 2007 17:29

Re: More then 1 site hosted on same machine ?

Postby fyndler » 22. July 2009 15:06

Sorry for dubble posting but i have checked the manuall and asked some friends, still the same problem :(

I really want this to work becuse if people dont use www. they will get to first page :(
fyndler
 
Posts: 38
Joined: 28. October 2007 17:29

Re: More then 1 site hosted on same machine ?

Postby fyndler » 06. September 2009 14:32

No answer in 2 months :/
fyndler
 
Posts: 38
Joined: 28. October 2007 17:29

Re: More then 1 site hosted on same machine ?

Postby Wiedmann » 06. September 2009 15:15

No answer in 2 months :/

You have the answer since 2009-06-16: use the directive "ServerAlias"...
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to Apache

Who is online

Users browsing this forum: No registered users and 22 guests