[Nottingham]Web server questions

Joshua Lock incandescant at gmail.com
Sat Apr 9 17:26:32 BST 2005

>> I have some web hosting on a virtual Apache server with Hosting
>> Unlimited.
> They let you at the httpd.conf right?

'fraid not :s

>> Firstly I want to host two sites on one virtual server.
>> What I'd ideally like to do is have the sites only accessible by the
>> domain names assigned to them. I wonder if this is even possible? If 
>> so
>> how would I go about doing this considering I don't have access to the
>> httpd.conf for the server.
> This is called virtual hosting and can be done by any combination of
> name, IP address and port.  What you do is set a DocumentRoot for each
> site (I'd try and keep them seperate as much as possible by *not* 
> having
> an accessible parent) and then defaulting to one or other in you main
> section.  Using this appraoch your single apache instance will scale to
> a significant number of domains (so long as you're not hosting
> slashdot :).  The rough form is:
> User webuser
> Group webgroup
> NameVirtualHost
> <VirtualHost www.butterthlies.com>
> #ServerName www.butterthlies.com
> ServerAdmin sales at butterthlies.com
> DocumentRoot /usr/www/APACHE3/site.virtual/htdocs/customers
> ErrorLog /usr/www/APACHE3/site.virtual/Name-based/logs/error_log
> TransferLog /usr/www/APACHE3/site.virtual/Name-based/logs/access_log
> </VirtualHost>
> <VirtualHost sales.butterthlies.com>
> #ServerName sales.butterthlies.com
> ServerAdmin sales at butterthlies.com
> DocumentRoot /usr/www/APACHE3/site.virtual/htdocs/salesmen
> ServerName sales.butterthlies.com
> ErrorLog /usr/www/APACHE3/site.virtual/Name-based/logs/error_log
> TransferLog /usr/www/APACHE3/site.virtual/Name-based/logs/access_log
> </VirtualHost>
> Which comes from O'Reillys Apache: the Definitive Guide by Ben and 
> Peter
> Laurie (page 87 if you have a copy).Also check
> http://www.apache.org/docs/vhosts for the reference documentation.

Ah, thanks for that. I thought that would be the case but hoped I might 
be able to do it with .htaccess files or similar :(
Guess I will have to sort something else out....

>> Also does anyone know how to stop search engines from indexing certain
>> folders?
> robots.txt is a file you stick on the root of each site e.g.
> http://www.mydomain.com/robots.txt which tells the search engines where
> they should and should not go.  Try
> http://www.searchengineworld.com/robots/robots_tutorial.htm for some
> more info.  Be aware though that certain robots (spam harvesters are a
> good example) won't bother, so if it's sensitive wrap it in Directory
> and Require combo to put off most simple intrusions.

That ought to do the trick, it's temporary content rather than 
sensitive so no worries there.

> Robert.

Thanks for your input Robert and thanks for your feedback too Spandex

Joshua Lock

More information about the Nottingham mailing list