steve wrote:

You're using name based virtual hosting... bet you didn't know that!
it's fair to say (and probably obvious) there is not much i do know about apache config...
To do this ( bear with me as every distro does this in different files
this is a hardy install. )

1. You need a NameVirtualhost at the top of the 'default' config.

NameVirtualHost *
yes, got that.
This means that all following VH configs must start with (ok this isn't
true, but bear with me!)...

<VirtualHost *>

and not <VirtualHost *:80> for example.

2. You need to identify the next host by name, so in it's setup file,
you need a
ServerName mywiki.example.com
"ServerName policymanual" added to /etc/apache2/sites-available/policymanual
or similar to identify it. Personally, I also set up specific log files
for each site so you can tract traffic, error more easily.

ErrorLog /var/log/apache2/mywiki.example.com-error.log
CustomLog /var/log/apache2/mywiki.example.com-access.log combined
done this for policymanual and nothing of use in there so far.
Here's an example of a really simple one of mine ( and anyone who wants
to redesign the site... please do! )
--8<--
<VirtualHost *:80>
    ServerName dh.greengecko.co.nz
    ServerAdmin [email protected]
    DocumentRoot /www/dh.greengecko.co.nz
    ErrorLog /var/log/apache2/dh.greengecko.co.nz-error.log
    CustomLog /var/log/apache2/dh.greengecko.co.nz-access.log combined
    <Directory /www/dh.greengecko.co.nz>
Options All AllowOverride All
        Order deny,allow
        allow from all
    </Directory>
</VirtualHost>
--8<--

3. The above name must resolve. On the web server itself, I
modify /etc/hosts to resolve all of these websites to the IP address of
the server itself ( some use 127.0.0.1, but I don't ).

This means that the webserver itself will come up without any errors,
and be serving the multiple domains.
Not totally sure here. There's local name resolution via IPCop. The server can ping itself by name, other machines can ping it by name, and can browse from the network to http://jupiter to get the "it works!" test page. That enough or are you meaning more than this?
4. Permissions.
simplest to ensure there's no problems - not something I'd recommend in
a production environment...

cd <DocumentRoot> ( eg /www/dh.greengecko.co.nz )
sudo chown -R www-data:www-data .
Not really able to do it like that since that will break general access to the folder for other users, but have done chmod -R o+rx on DocumentRoot.
Which will ensure that your web server has permissions to access the
content.

Next, you need to ensure that your site name resolves to the client, so
you need to run either a local DNS server, or to modify /etc/hosts on
each client. I know what I'd do ( and probably use OpenDNS as resolvers
to filter some of the traffic, no matter what abuse they make of the
standards ).
As mentioned above, got local name resolution.


Current attempts to browse to http://jupiter/policymanual no longer return the "forbidden" error, instead the following. What might this indicate?

Not Found The requested URL /policymanual/index.html was not found on this server.
Apache/2.2.8 (Ubuntu) Server at jupiter Port 80


Thanks for the assistance so far, I'm close hopefully, not ready to give up yet!

Cheers,
Roger
Not difficult once you get your head around it, just more steps than
you'd expect.

hth,

Steve

Reply via email to