DirectoryMatch & vhost

DirectoryMatch & vhost

Post by Tulan W. H » Sat, 13 Jan 2001 21:17:48



I thought that the <DirectoryMatch> in the main will apply to all my vhost.
However,  the following setups in my httpd.conf seems to be ignored
by VirturalHost.
Please let me know what I did wrong. Thanks!

DocumentRoot /usr/local/apache/htdocs
<DirectoryMatch "^.*htdocs.*">
    AllowOverride All
    Options All
</DirectoryMatch>

<VirtualHost vhost1>
DocumentRoot /vhosts/vhost1/htdocs
....
</VirtualHost>

<VirtualHost vhost2>
DocumentRoot /other/directory/vhost2/htdocs
....
</VirturalHost>

 
 
 

DirectoryMatch & vhost

Post by David Efflan » Sun, 14 Jan 2001 10:00:09



Quote:>I thought that the <DirectoryMatch> in the main will apply to all my vhost.
>However,  the following setups in my httpd.conf seems to be ignored
>by VirturalHost.
>Please let me know what I did wrong. Thanks!

>DocumentRoot /usr/local/apache/htdocs
><DirectoryMatch "^.*htdocs.*">
>    AllowOverride All
>    Options All
></DirectoryMatch>

Perhaps you don't quite understand how regular expressions work in
apache.  Docs for <Directory> mention the following:

"Also as of Apache 1.3 none of the wildcards match a `/' character, which
more closely mimics the behaviour of Unix shells."

".*" does not match a "/", so the above statement would not apply to the
paths in the vhosts below.  Maybe you want to match "/htdocs/" instead
since your paths do not have a consistant number of leading directories.

Quote:><VirtualHost vhost1>
>DocumentRoot /vhosts/vhost1/htdocs
>....
></VirtualHost>

><VirtualHost vhost2>
>DocumentRoot /other/directory/vhost2/htdocs
>....
></VirturalHost>

--

http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

1. Mixing name-based vhosting with mass-vhosting

We have a small set of VHosts each with it's own VirtualHost entry,
providing some flexibility of config.

We'd also like to provide mass-hosting via VirtualDocumentRoot directive.

In effect, we want to fallback on the mass-hosting rule, only if there is
no specific VirtualHost matching the ServerName/ServerAlias.

Can I do this without resorting to mod_rewrite?
--

Systems Administrator,
National Capital Freenet        [http://www.ncf.ca]

2. Phillips LMS 205MS cdrom driver

3. &&&&----Looking for a unix shell------&&&&&

4. Problem with networking (missing default gateway?)

5. Apache on Win2K & VHOSTs

6. FTP servers won't follow symlinked dirs

7. vhost & rewrite question

8. RTIN news retrieval and poor response time

9. vhost & roadrunner

10. How many vhosts on one machine & Strange lockup

11. Help needed mod_rewrite & vhost.map

12. ppp && PPPoE && ADSL && net && buffer(s)

13. Capturing data from a DirectoryMatch