Re: Apache Virtual Hosts


Subject: Re: Apache Virtual Hosts
From: Greg Jetter (greg@lazymountain.com)
Date: Tue Oct 22 2002 - 21:41:01 AKDT


On Tuesday 22 October 2002 08:19 pm, bthundereagle@aidea.org wrote:
> Very simple what I am trying to do. But I can't find anything on how to do
> it or what exactly it is called.

it is called name based virtual hosting , check your apache doc's , it is
quite easy to set up , instead of Apache serving up one web page , it checks
the request and serves from a difrent directory based on the host name.

like home.swjedi.net , school.swjedi.net , or work.swjedit.net , with
home.swjedi.net being served out of /home , school.swjedi.net being served
out or /school and work.swjedit.net out of /work directories on the server
located at the IP address mapped to swjedi.net.
 
this allows you to host many sites on one box. with one IP address. What
you do is set up a CNAME record on your DNS server maping the alias to
your IP number , then in Apache configuration file you set up virtual
hosting to be name based , a virtual host with a seperate directoy structor
like so:
#
# Use name-based virtual hosting.
#
NameVirtualHost 12.17.151.109
#
 <VirtualHost 12.17.151.109>
ServerAdmin webmaster@mat-su-online.com
DocumentRoot /home/mat-su-online
ServerName www.mat-su-online.com
AddHandler cgi-script .pl
ScriptAlias /cgi-bin/ /home/mat-su-online/cgi-bin/
<Directory "/home/mat-su-online/cgi-bin">
Options +ExecCGI
</Directory>
ErrorLog /home/mat-su-online/error_log
CustomLog /home/mat-su-online/access_log combined
</VirtualHost>

The above file fragment illistrates a virtual hosted directory

>
> I have my web site "www.swjedi.net" now I have user sites that I have
> migrated from IIS. Originally you would view user pages like this:
> http://www.swjedi.net/furbs/
> I want to do this:
> http://furbs.swjedi.net
>
> How do I make an address "furbs.swjedi.net" point to a specific directory
> on my Apache server? If nothing else, how can I simply set up the typical
> use of "http://www.swjedi.net/furbs/". Then mabye map an address to that
> location?

see the above , by using an alias in your DNS and setting up Apache with
virtual hosting you can do it.

Greg

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Tue Oct 22 2002 - 21:30:31 AKDT