Running 2 website off 1 IP address

Ansar Mohammed ansarm-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Thu Sep 7 20:53:47 UTC 2006


This idea works on the basis that your browser is sending a "Host: " header
that matches the "ServerName" directive.

If you are typing somtihing else in your browser other than 
"http://massivelymultiplayeronlineroleplayinggames.org"

You will be redirected to the first site.

I assume that you are typing in
http://www.massivelymultiplayeronlineroleplayinggames.org
 In which case it does not match the "ServerName" directive and you are
being sent to the default site (the first one)

Add the following line after your  "ServerName" directive:

ServerAlias www.massivelymultiplayeronlineroleplayinggames.org

That should do the trick!



> -----Original Message-----
> From: owner-tlug-lxSQFCZeNF4 at public.gmane.org [mailto:owner-tlug-lxSQFCZeNF4 at public.gmane.org] On Behalf Of Evan
> Leibovitch
> Sent: September 7, 2006 4:34 PM
> To: tlug-lxSQFCZeNF4 at public.gmane.org
> Subject: Re: [TLUG]: Running 2 website off 1 IP address
> 
> Jason Carson wrote:
> >> <VirtualHost *:80>
> >> DocumentRoot "/var/www/localhost/htdocs/canuckster"
> >> ServerName canuckster.org
> >> <Directory "/var/www/localhost/htdocs/canuckster">
> >> allow from all
> >> Options +Indexes
> >> </Directory>
> >> </VirtualHost>
> >>
> >> <VirtualHost *:80>
> >> DocumentRoot /var/www/localhost/htdocs/mmorpg
> >> ServerName massivelymultiplayeronlineroleplayinggames.org
> >> <Directory /var/www/localhost/htdocs/mmorpg>
> >> allow from all
> >> Options +Indexes
> >> </Directory>
> >> </VirtualHost>
> >>
> >> However, only canuckster.org works,
> >> massivelymultiplayeronlineroleplayinggames.org doesn't work.
> >>
> Boy, it's been a while.
> 
> IIRC the system is very precise, so that in the above config
> http://assivelymultiplayeronlineroleplayinggames.org will work but
> http://www.massivelymultiplayeronlineroleplayinggames.org will not.
> I think you may need to add another line to fix that:
> 
> [...]
> <VirtualHost *:80>
> DocumentRoot /var/www/localhost/htdocs/mmorpg
> ServerName massivelymultiplayeronlineroleplayinggames.org
> ServerAlias *.massivelymultiplayeronlineroleplayinggames.org     <----
> add this
> <Directory /var/www/localhost/htdocs/mmorpg>
> allow from all
> Options +Indexes
> </Directory>
> </VirtualHost>
> [...]
> 
> This may not solve your problem, but it may solve some others down the
> road. Also, keep in mind that some browsers don't send enough
> information for the server to know what domain you want, so you might
> want to check things out with another server -- as well as the apache
> logs -- before being certain that the config doesn't work.
> 
> See http://httpd.apache.org/docs/1.3/vhosts/name-based.html for more info.
> 
> HTH,
> 
> - Evan
> 
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wini/Mailing_lists

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wini/Mailing_lists





More information about the Legacy mailing list