On Mar 9, 2011, at 03:07, Oliver Marshall wrote:
> Is it possible to enable the dav_svn module for one hostname only?
Modules are *loaded* globally for an Apache instance, but the directives to
actually make use of a module can be limited by any number of means, including
hostname, as discussed further below.
> We have a development box which was just being used for SVN. Then Trac got
> added, then it started being used for hosting demo sites, then ….. etc.
>
> We now have about 10 various hostnames on there and we have found if you add
> /svn on to any of them you can access the SVN module. This isn’t a massive
> issue as it’s password protected but only the SVN site itself
> (dev.mydomain.com) is SSL enabled.
This is a matter of where you use your "DAV svn" statement (the statement that
says "I want mod_dav_svn to start taking effect here"), and yes, that should
absolutely be restricted to only the area you want it to be used in, for
example a particular hostname. You probably have "DAV svn" and all the other
directives relating to serving your repository(ies) sitting naked in the main
part of your Apache httpd.conf file:
<Location /svn/>
DAV svn
...
</Location>
And you should move them into a VirtualHost directive specific to the hostname
you want them to be used in, e.g.:
<VirtualHost *:80>
ServerName dev.example.com
<Location /svn/>
DAV svn
...
</Location>
</VirtualHost>
You may already have a VirtualHost directive for this hostname; in that case,
don't add a second one, but merge these directives into the existing one.