Pick a Free OS

User login


Web server tutorial - Part 3

(no cacheing without CacheRoot)

CacheRoot "/var/cache/httpd"

CacheSize 5

CacheGcInterval 4

CacheMaxExpire 24

CacheLastModifiedFactor 0.1

CacheDefaultExpire 1

NoCache a_domain.com another_domain.edu joes.garage_sale.com


Section 3: Virtual hosts

VirtualHost: If you want to maintain multiple domains/hostnames on your machine you can setup VirtualHost containers for them. Please see the documentation here for further details before you try to setup virtual hosts. You may use the command line option '-S' to verify your virtual host configuration.

If you want to use name-based virtual hosts, you need to define at least one IP address (and port number) for them.




VirtualHost example

Almost any Apache directive may go into a VirtualHost container.

<VirtualHost ip.address.of.host.some_domain.com>

ServerAdmin webmaster@host.some_domain.com

DocumentRoot /www/docs/host.some_domain.com

ServerName host.some_domain.com

ErrorLog logs/host.some_domain.com-error_log

CustomLog logs/host.some_domain.com-access_log common


<VirtualHost default:*>



ServerAdmin amby@goldie.com

DocumentRoot /docfile

ServerName www.goldie.com

ErrorLog logs/err



ServerAdmin amby@failure.com

DocumentRoot /htdoc

ServerName www.failure.com

ErrorLog /home/err



ServerName www.chiku.com

DocumentRoot /home/chinu/public_html



ServerName www.chik.com

DocumentRoot /home/