Ssl – configure apache for SVN SSL

apache-2.2mod-dav-svnsslsvn

I have an issue with my Apache config, specifically how it interacts with the SVN DAV mod.

What I want to be able to do is have domain.com point at my website, svn.domain.com to point at my svn directory (which is currently outside of my public_html directory) and for both to be accessible via https.

I've got it working for the most part, but if I set up an explicit VirtualHost for the svn subdomain, it stops the svn application from being able to access the repositories (instead just getting a "repository moved permanently" error), I can browse the repos ok.

my config looks something like:

<VirtualHost *:443>
    ServerName domain.com
    ServerAlias www.domain.com svn.domain.com
    DocumentRoot /path/to/website/dir
    ...
    #stuff for SSL cert etc.
</VirtualHost>

<VirtualHost *:80>
    ServerName domain.com
    ServerAlias www.domain.com
    DocumentRoot /path/to/website/dir
    ...
</VirtualHost>

<Location /repo>
    DAV svn
    SVNPath /path/to/repos
    ... #auth details
</Location>

This works mostly, but browsing to svn.domain.com brings up my website, and browsing to domain.com/repo brings up the repository (svn.domain.com/repo works fine, domain.com also works fine), potentially I'd maybe want domain.com/repo to display a set of webpages all about my project, docs etc, svn.domain.com would ideally point to either nothing, or a list of the repositories available or a separate page or something. I thought I'd got the hang of apache config files, but this one is stumping me!

Best Answer

You should have a separate <VirtualHost> directive for your svn.domain.com and domain.com / www.domain.com domains. It looks like you're trying to squeeze both in to the first <VirtualHost>. After you have them separated, put the SVN directives inside the svn.domain.com host.

Related Topic