# help with subversion under apache https - SOLVED

## Moriah

I have been running apache (and then apache2) for years.  Several years ago, I set it up for squerrelmail with https, and it was a hassle, but I got it working, and it still works.  Now I need to add subversion support to my apache server.  Since it is internet-facing, I need to restrict access to https only.  I am having touble getting it to work.    :Sad: 

I have worked with subversion before, but only configured a local server.  I read the redbean chapter on installation; I even have a real copy of the version 1 O'Reilly book.    :Cool: 

I also followed the howto at http://www.gentoo-wiki.info/HOWTO_Apache2_with_subversion_SVN_and_DAV

I rebuit apache with APACHE2_MPMS="prefork"; I had to set -threads in my USE flags to get it to go.

Here is my /etc/apache2/modules.d/47_mod_dav_svn.conf:

```

<IfDefine SVN>

LoadModule dav_svn_module modules/mod_dav_svn.so

<IfDefine SVN_AUTHZ>

LoadModule authz_svn_module modules/mod_authz_svn.so

</IfDefine>

# Example configuration:

#<Location /svn/repos>

#   DAV svn

#   SVNPath /var/svn/repos

#   AuthType Basic

#   AuthName "Subversion repository"

#   AuthUserFile /var/svn/conf/svnusers

#   Require valid-user

#</Location>

<Location /svn>

   DAV svn

   SVNParentPath /var/svn

   SVNListParentPath on

#   AuthType Basic

#   AuthName "Subversion repository"

#   AuthUserFile /var/svn/conf/svnusers

#   Require valid-user

#   SSLRequireSSL

#   RewriteEngine On

#    RewriteCond %{HTTPS} !on

#    RewriteRule ^/(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R]

</Location>

</IfDefine>

```

I commented out alll the auth stuff to try to simplify the troubleshooting.

When I restart apache, everything looks good.  My web server still works, including squirrelmail (which uses ssl), so at least I didn't damage anything.  

With the above lines commented out, I can see the repository, and it even says, "powered by subversion", so taht looks good.

But when I remove the comments and try again with https://www.mydomain.com/svn/MYREPO/ I get:

```

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@elilabs.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache Server at www.elilabs.com Port 443

```

When I look in my /var/log/apache2/ssl_error_log I see:

```

[Mon Jul 06 00:06:30 2009] [error] [client 192.168.2.2] (13)Permission denied: Could not open password file: /var/svn/conf/svnusers

```

I tried changing the owner/group to apache, but that didn't work.

Who should own these files:

```

eli apache2 # ls -la /var/svn/conf

total 8

drwx------ 2 root   root   104 Jul  5 21:45 .

drwxr-xr-x 5 root   root   120 Jul  5 23:17 ..

-rw-r--r-- 1 apache apache  53 Jul  5 21:45 svnpolicy

-rw------- 1 apache apache 172 Jul  5 18:44 svnusers

eli apache2 # 

```

Thanks for any help!    :Very Happy: 

----------

## Moriah

DUH!    :Embarassed: 

It was an ownership problem on the directory containing those files.

The directory should be owned by apache, and group owned by apache, with perms of 700. [edited 2010_08_26]

----------

