Now, before you ask, I've read http://gentoo-wiki.com/HOWTO_Linux_Virt ... eb_Hosting . The wiki is terribly confusing. Most of the documentation is outdated, and it has little notes underneath each section basically saying "what was just explained is outdated; don't use it." I've tried following the directions, but all that did was break my apache setup. (I actually had a correct setup a few hours ago, and when I tried to go "proper," the only result was that nothing works)
Starting from the top:
/etc/conf.d/apache2
The only thing that I know of that pertains to virtual hosting in this file is the "-D DEFAULT_VHOST" option in APACHE2_OPTS. This is set in my configuration (as it is by default).
/etc/apache2/httpd.conf
I don't think I've changed anything in this file. It seems that Gentoo likes you to change things elsewhere. I know that modules configurations and virtual hosts configurations are in the modules.d and vhosts.d directories, respectfully. One thing I don't understand is the line below:
Code: Select all
Include /etc/apache2/vhosts.d/*.conf
One thing that's always been a pain is the update of apache2. When I have all my configurations in 00_default_vhost.conf, it makes it a pain to upgrade! I figured that you're SUPPOSED to put each virtual host in its own file in the vhosts.d directory (the wiki article supports this idea), but ever time I do, it never works!
Currently, here's what I've got:
Code: Select all
neo www # ls -l /var/www
total 8
drwxr-xr-x 15 root root 4096 Feb 6 12:43 ampache
drwxr-xr-x 3 apache apache 4096 Mar 3 02:48 localhost
Code: Select all
neo vhosts.d # ls -l /etc/apache2/vhosts.d/
total 16
-rw-r--r-- 1 root root 7745 Jan 18 18:30 00_default_ssl_vhost.conf
-rw-r--r-- 1 root root 2100 Mar 3 04:00 00_default_vhost.conf
-rw-r--r-- 1 root root 2831 Mar 3 03:38 default_vhost.include
Code: Select all
neo vhosts.d # cat 00_default_vhost.conf
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
<IfDefine DEFAULT_VHOST>
# see bug #178966 why this is in here
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
# Use name-based virtual hosting.
NameVirtualHost *:80
# When virtual hosts are enabled, the main host defined in the default
# httpd.conf configuration will go away. We redefine it here so that it is
# still available.
#
# If you disable this vhost by removing -D DEFAULT_VHOST from
# /etc/conf.d/apache2, the first defined virtual host elsewhere will be
# the default.
<VirtualHost *:80>
ServerName localhost
Include /etc/apache2/vhosts.d/default_vhost.include
<IfModule mpm_peruser_module>
ServerEnvironment apache apache
</IfModule>
</VirtualHost>
</IfDefine>
<VirtualHost *:80>
ServerName ampache.guttersnipe.homelinux.net
DocumentRoot "/var/www/ampache"
<Directory "/var/www/ampache">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
# vim: ts=4 filetype=apache
TIA, and sorry if the above is confusing. It's almost 4AM now and I have a headache from screwing around with this all night x_x (not to mention that I have work in the morning


