Re: [SLUG] Apache2 virtual hosts

From: R.G. Mayhue (rmayhue@tampabay.rr.com)
Date: Sat Jun 18 2005 - 14:20:19 EDT


On Saturday 18 June 2005 01:06 pm, Joe Brandt wrote:
>
> I have been attempting (unsuccessfully) to get
> Apache2 configured so that that :
> default serves up /var/www/html
> www.hamsbeer.com serves up /var/www/html/hams
> www.joedienterprises.com serves up /var/www/html/joedi
>
> Searching the docs on Name based Virtual Hosts
> (http://httpd.apache.org/docs-2.0/vhosts/name-based.html) was not much
> help as I did what I interpreted them to be saying and I can not get it
> to work. All I have managed to accomplish is get 1 site up regardless
> of name. I have made it functional again and copied the httpd.conf file
> for your viweing pleasure.
>
> All help will be appreciated
> Thank you in advance
>
> Joe Brandt S.S.T.G.I.T.
> (Struggling self taught geek in training)
>

Are you using Gentoo? This looks like a Gentoo apache2.conf.

Currently Gentoo splits the apache configs into 2 parts apache2.conf
and commonapache2.conf. Since I couldn't see commonapache2.conf
I'll have to assume it is correct. You would do better to put the
following VirtualHost defines into conf/vhosts/Vhosts.conf. Its
already included further up in the config.

------------ cut -------------
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /var/www/html/joedi
    ServerName joedienterprises.com
    ServerAlias www.joedienterprises.com
    <Directory /var/www/html/joedi>
        Options +Indexes
        <IfModule mod_access.c>
            Order allow,deny
            Allow from all
        </IfModule>
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /var/www/html/hams
    ServerName hamsbeer.com
    ServerAlias www.hamsbeer.com
    <Directory /var/www/html/hams>
        Options +Indexes
        <IfModule mod_access.c>
            Order allow,deny
            Allow from all
        </IfModule>
    </Directory>
</VirtualHost>
------------ cut -------------

That should get it working as long as the parts I couldn't see are
correct.

-- Rob
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:15:24 EDT