Date: Wed, 09 Jan 2008 10:36:17 -0600 From: Jonathan Horne <jhorne@dfwlp.org> To: zbigniew szalbot <zbigniew@szalbot.homedns.org>, freebsd-questions@freebsd.org Subject: Re: apache virtual directories / VirtualHost overlap Message-ID: <4784F801.7050107@dfwlp.org> In-Reply-To: <4784F558.4030107@dfwlp.com> References: <4784EF9C.8040307@szalbot.homedns.org> <8d23ec860801090803v53b19441h37f75b03324a5adf@mail.gmail.com> <4784F23A.9060301@szalbot.homedns.org> <4784F558.4030107@dfwlp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Jonathan Horne wrote:
> zbigniew szalbot wrote:
>>> >
>>> > So I defined:
>>> >
>>> > NameVirtualHost 83.19.156.210
>>> >
>>> > <VirtualHost 83.19.156.210>
>>> > ServerAdmin webmaster@dummy-host.example.com
>>> > DocumentRoot /usr/local/www/data/
>>> > ServerName lists.lc-words.com
>>> > ErrorLog /var/log/httpd-error.log
>>> > CustomLog /var/log/httpd-access.log common
>>> > </VirtualHost>
>>> >
>>> > <VirtualHost 83.19.156.210>
>>> > ServerAdmin webmaster@dummy-host.example.com
>>> > DocumentRoot /usr/local/www/data/blog/
>>> > ServerName blog.lc-words.com
>>> > ErrorLog /var/log/httpd-error.log
>>> > CustomLog /var/log/httpd-access.log common
>>> > </VirtualHost>
>>> >
also, try this setting up a vhost for the actual host, then 'child'
vhosts for the different sites that you want to host. an example:
# Virtual Hosts
NameVirtualHost *:80
# VH for actualhost.example.com
<VirtualHost *:80>
ServerName actualhost.example.com
UserDir disable
DocumentRoot /usr/local/www/apache22/data/
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/actualhost.example.com_log combined
</VirtualHost>
# VH for blog
<VirtualHost *:80>
ServerName blog.example.com
UserDir disable
DocumentRoot /usr/local/www/blog
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/blog.example.com_log combined
</VirtualHost>
# VH for lists
<VirtualHost *:80>
ServerName lists.example.com
ServerAlias lists.example.com
DocumentRoot /usr/local/www/lists
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/lists.example.com_log combined
</VirtualHost>
i believe the specifying ServerName is critically important to
sucessfully wrangling all your vhosts into the proper DocumentRoot(s).
hth,
--
Jonathan Horne
http://www.dfwlp.org
jhorne@dfwlp.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4784F801.7050107>
