Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to get my head around apache configuration to fix a problem I'm having but after a few hours I've decided to ask here.

This is what I've got at the moment:

DocumentRoot "/var/www/html"

<Directory />
        Options None
        AllowOverride None
        Deny from all
</Directory>

<Directory /var/svn>
        Options FollowSymLinks
        AllowOverride None
        Allow from all
</Directory>

<Directory /opt/hg>
        Options FollowSymLinks
        AllowOverride None
        Allow from all
</Directory>

<Location /hg>
        AuthType Digest
        AuthName "Engage HG"
        AuthDigestProvider file
        AuthUserFile /opt/hg/hgweb.users
        Require valid-user
</Location>

WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess hg processes=3 threads=15
WSGIProcessGroup hg
WSGIScriptAlias /hg "/opt/hg/hgweb.wsgi"

<Location /svn>
        DAV svn
        SVNPath /var/svn/repos

        AuthType Basic
        AuthName "Subversion"
        AuthUserFile /etc/httpd/conf/users
        require valid-user
</Location>

I'm trying to get my head around how it's all laid out and how directories relate to locations/etc

For /hg I get asked for a password but to /svn I get a 403 forbidden...

the error I get is:

[client 10.80.10.169] client denied by server configuration: /var/www/html/svn

When I remove the entry it works fine..

I can't figure out how to get it linking to the /var/svn directory

share|improve this question
    
missing AuthDigestProvider file in svn I think –  aduljr Sep 17 '10 at 7:37
    
Why do use different authentication types? hg=digest, svn=basic? And 403 can be caused by file/folder permissions - www-data needs access to /var/svn/repos –  Andreas Rehm Sep 17 '10 at 10:29
    
we had svn setup (all our servers commit their /etc/ directory to svn) and i added hg to it and didn't want to change the svn setup. –  James Murphy Sep 19 '10 at 12:00

1 Answer 1

Please check directory permissions:

http://www.cyberciti.biz/faq/apache-403-forbidden-error-and-solution/

You should use the same authentication mehtod:

  • Location /hg uses digest auth
  • Location /svn uses basic auth

And your configuration can rely on inheritance:

DocumentRoot "/var/www/html"

<Directory />
        Options None
        AllowOverride None
        Deny from all
</Directory>

<Directory /var/svn>
        Options FollowSymLinks
        Allow from all
</Directory>

<Directory /opt/hg>
        Options FollowSymLinks
        Allow from all
</Directory>

<Location /hg>
        AuthType Digest
        AuthName "Engage HG"
        AuthDigestProvider file
        AuthUserFile /opt/hg/hgweb.users
        Require valid-user
</Location>

WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess hg processes=3 threads=15
WSGIProcessGroup hg
WSGIScriptAlias /hg "/opt/hg/hgweb.wsgi"

<Location /svn>
        DAV svn
        SVNPath /var/svn/repos

        AuthType Digest
        AuthName "Subversion"
        AuthUserFile /etc/httpd/conf/users
        require valid-user
</Location>

Ensure that the AuthUserFiles exist!

share|improve this answer
    
I've updated with the error I get - I can't get the /svn url to link to /var/svn it seems - if I delete the <Directory /> entry it works fine –  James Murphy Sep 19 '10 at 13:46
    
Please use digest authentication - see my edited config... –  Andreas Rehm Sep 19 '10 at 16:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.