Re: [SLUG] Virtual Hosts on Apache

From: Ronan Heffernan (ronan@iotcorp.com)
Date: Sun Oct 13 2002 - 10:23:23 EDT


Darr Palmer wrote:
> I am running Apache Advanced Extranet Server 1.3.23 and attempting to
> run multiple websites on the same box.
>
> I have tried using Webmin, going straight in and configuring httpd.conf
> but with no success. I have the default website appearing again, and
> now when you try to hit one of the other sites it is giving me "You do
> not have permission to access / on this server.
>
> It is differentiating between the two sites and is no longer returning
> the 1st (default site) home page when access with 2nd url. But I cannot
> seem to get it to let me view the website.
>

Darr,
    I just converted a single site yesterday into a 2 VirtualHosts as
part of a web development project. I have never done this before and my
understanding is incomplete, but it works! Rather than using the
asterisk as a wildcard for the NameVirtualHost directive, I
monkey-see-monkey-do'ed an example that used the actual IP and port.
Note: the second NameVirtualHost directive uses port 443 for SSL
(https://) and requires a more complex pair of VirtualHost directives
that contain information about the SSL certificates and configuration.
The names and IP addresses have been changed to protect the poorly
secured and administered.

NameVirtualHost 192.168.1.1:80
NameVirtualHost 192.168.1.1:443

<VirtualHost 192.168.1.1:80>
     ServerAdmin root@apples.org
     DocumentRoot /var/www/main
     ServerName www.apples.org
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost 192.168.1.1:80>
     ServerAdmin root@oranges.fl.us
     DocumentRoot /var/www/oranges_stuff
     ServerName oranges.fl.us
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

--ronan



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:05:53 EDT