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

Mike mike at jazzitis.uklinux.net
Thu Dec 23 16:45:11 GMT 2004


Thanks for all the help, folks. Lots of useful pointers there and I now
have a server to practice web design on. The main fault was having tried
to set the document root in the VirtualHost blocks whilst leaving it
untouched in the main server configuration. Still a bit of tweaking to
get it totally right, but it's serviceable for now.

Also, I had copied test.php as root (and into the wrong place) so chmod
came into play there. However, no need to make it readable to all -
that's done in the directory block of httpd.conf, so long as
httpd.conf's user and group (httpd in this case) can get to it.

A couple of people suggested *:80 for the server - I think that works if
serving the web, but not sure on a lan. Also, is it good for all
versions, or only 2+? I'm using 1.3.33 to get as near as possible to
emulating where the real, online, reader-accessible, sites are hosted. I
used the local IP address for the NameVirtualHost and 80 for Listen,
then local IP again for each VH block, with the server named inside it,
and it works. e.g.

<VirtualHost 192.168.2.105>  # not 127.0.0.1, as LAN browsers read it
     ServerName targetdir
     DocumentRoot /usr/local/web/vhost/targetdir/pub/html
</VirtualHost>

I'll worry about finer points like log files once the seasonal spirit -
bottled, of course - wears off a little, next week! And I'll read up a
bit on chasing through the SSL problem, too.

Have a great holiday, those of you who get the chance, and I'll ask some
more silly questions when you return!

best regards,

Mike





More information about the Wylug-help mailing list