[vox-tech] web server question
ME
vox-tech@lists.lugod.org
Wed, 26 Jun 2002 17:29:22 -0700 (PDT)
On Wed, 26 Jun 2002, Peter Jay Salzman wrote:
> suppose i have two domains:
>
> www.freshandsassy.org
> www.oldandtired.com
>
>
> suppose:
>
> 1. i'd like requests to http://freshandsassy.org to get:
> /www1/index.html
>
> 2. i'd like requests to http://oldandtired.com to get:
> /www2/index.html
>
> how would i do this with apache? is this what people call "virtual
> hosting"?
Sure. Why not? (Assuming apache v1.3)
Edit httpd.conf
Define a "default server" location just as you would for a single IP
address web server.
Many distros include comments in this file. Check it out.
Another place to look, is at your apache htdocs. For virt hosts:
htdocs/manual/vhosts/index.html
Here is a brief summary:
After you have a server name (for example with an IP address)
and specify a location for default connections with Document root etc...
then you can create the cirtual host containers with settings specific to
the virtual hosts:
#Assuming your IP address is 10.0.0.1 for example:
<VirtualHost your.ip.address.forexample>
# ServerName www.freshandsassy.org
ServerAlias freshandsassy.org www.freshandsassy.org
ServerAdmin cornholio@bigdomain.com
DocumentRoot /www1/index.html
CustomLog logs/freshandfancy.combined_log full
CustomLog logs/freshandfancy-access_log combined
ErrorLog logs/freshandfancy-error_log
ScriptAlias /cgi-bin/ /www1.cgi-bin/
Alias /icons/ /usr/share/apache/icons/
</VirtualHost>
<VirtualHost 10.0.0.1>
# ServerName www.oldandtired.org
ServerAlias oldandtired.com www.oldandtired.org
ServerAdmin cornholio@bigdomain.com
DocumentRoot /www1/index.html
CustomLog logs/oldandtired.combined_log full
CustomLog logs/oldandtired-access_log combined
ErrorLog logs/oldandtired-error_log
ScriptAlias /cgi-bin/ /www1.cgi-bin/
Alias /icons/ /usr/share/apache/icons/
</VirtualHost>
#Assuming you have defined what is in a "full" and "combined" log.
The Apache html docs on this are the most authoritative on this.
-ME
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/CM$/IT$/LS$/S/O$ !d--(++) !s !a+++(-----) C++$(++++) U++++$(+$) P+$>+++
L+++$(++) E W+++$(+) N+ o K w+$>++>+++ O-@ M+$ V-$>- !PS !PE Y+ !PGP
t@-(++) 5+@ X@ R- tv- b++ DI+++ D+ G--@ e+>++>++++ h(++)>+ r*>? z?
------END GEEK CODE BLOCK------
decode: http://www.ebb.org/ungeek/ about: http://www.geekcode.com/geek.html