[Hudlug] apache setup
Tim
hudlug at mailman.lug.org.uk
Mon Nov 11 20:34:03 2002
Brian Spencer wrote:
> Help please anybody
>
> Does anyone know how to setup apache for virtual hosting for multiple
> websites on a name basis?
There are examples in the apache documentation.
I've pasted some bits of my /etc/apache/httpd.conf file below. The last
one is a good redirect example. Also, you can do virtual hosts with
the info coming out of mysql, which slightly limits performance but
saves on shedloads of memory when you have thousands of domains on a
server.
NameVirtualHost 212.23.26.172
<VirtualHost 212.23.26.172>
ServerName clip.doylem.co.uk
ServerAlias clip.doylem.co.uk
DocumentRoot /var/www/
</VirtualHost>
<VirtualHost 212.23.26.172>
ServerAlias doylem.co.uk www.doylem.co.uk
ServerAdmin webmaster@doylem.co.uk
DocumentRoot /home/thomas/public_html
ServerName doylem.co.uk
#ErrorLog /var/log/apache/doylem-error.log
#TransferLog /var/log/apache/doylem-access.log
</VirtualHost>
<VirtualHost 212.23.26.172>
ServerAlias www.dusagg.org.uk
ServerAlias dusagg.org.uk
ServerAdmin webmaster@dusagg.org.uk
ServerName www.dusagg.org.uk
Redirectmatch permanent ^/dogs.*
http://mysite.freeserve.com/oldgits/index.html
Redirect permanent / http://www.durham.ac.uk/scout-guide.group/
ErrorLog /var/log/apache/error.log
TransferLog /var/log/apache/access.log
</VirtualHost>
--
Tim Bray G7UBQ | If its important, just phone.
http://www.kooky.org/ |
Email: tim@kooky.org |
Phone: +44 7966 479015 | Huddersfield, UK.