[Wylug-help] setting up Apache for virtual hosts for LAN only access

Roger Beaumont roger.b at beaunet.force9.net
Wed Dec 22 22:30:39 GMT 2004


On Wednesday 22 December 2004 18:31, Mike wrote:
> After a deathly wall of silence on the SSL question, can anyone help
> with the following? I am trying to set up virtual hosts on Apache 1.3.33
> to serve for testing purposes 4 web sites (number could grow). I've read
> loads of stuff, hard copy and on the web, including the manual. I'm
> trying to set it up so I can view the
> sites from either of the other two machines on the network, but not to
> go out to the public. After a lot of messing about, I've got as far as
> the following error message when using test.php, which at least is
> showing the script to be where I put it!:
<snip>
> All suggestions regarding the Apache problem gratefully received.

Hi Mike,

When I set up virtual hosts, I simply followed the template in the httpd.conf
file - and it worked.  That means, for a given virtual host:

# access to abc
<VirtualHost *:80>
  DocumentRoot /any/path/you/fancy/to/the/root/for/abc/virtual/site
  ServerName myhostname
  ErrorLog logs/abc-error_log
  CustomLog logs/abc-access_log combined
</VirtualHost>

My httpd.conf is in /etc/httpd/conf/

Note that 'myhostname' is a valid local host name.  When/if you want it live
on the Web, that must be a valid host.domain on the Internet.

Most of mine that are live on the Web are p/w protected, so I also have:

# and set access control for xyz
<Directory "/any/path/you/fancy/to/the/root/for/xyz/virtual/site">
  AuthType Basic
  AuthName "xyz name"
  AuthUserFile "access/abc_access"
  Require user xyz
</Directory>

(and you have to follow the instructions for access control in the Apache
documentation to create the password).

I'm now using Apache 2.0.48 - but I'm almost certain the virtual host stuff I
use didn't change when I went from v. 1.whateveritwas to 2.

Caveat: I don't claim to understand this, the above are simply anonymised
versions of the entries from my httpd.conf file.  Hope they help.

Roger





More information about the Wylug-help mailing list