Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN Error 403 Forbidden

Tags:

linux

svn

I can't figure this out. I try to import a new project into a svn repository from Netbeans and get 403 Forbidden. I just setup svn on my serverbox today. I can get to it through a browser just fine, though its empty as I haven't imported my project yet.

Apache's path for html files is /var/www I setup the svn repo in /var/svn

This is the structure of /var/svn

[root@localhost svn]# ls -lR /var/svn
/var/svn:
total 4
drwxrwxrwx 7 apache apache 4096 2010-03-26 10:18 repo

/var/svn/repo:
total 36
drwxrwxrwx 2 apache apache 4096 2010-03-26 09:47 conf
drwxrwxrwx 3 apache apache 4096 2010-03-26 10:18 dav
drwxrwsrwx 6 apache apache 4096 2010-03-26 11:19 db
-rwxrwxrwx 1 apache apache    2 2010-03-26 09:47 format
drwxrwxrwx 2 apache apache 4096 2010-03-26 09:47 hooks
drwxrwxrwx 2 apache apache 4096 2010-03-26 09:47 locks
-rwxrwxrwx 1 apache apache  229 2010-03-26 09:47 README.txt
-rwxrwxrwx 1 apache apache   15 2010-03-26 09:47 svnauth
-rwxrwxrwx 1 apache apache   43 2010-03-26 09:48 svnpass

/var/svn/repo/conf:
total 12
-rwxrwxrwx 1 apache apache 1080 2010-03-26 09:47 authz
-rwxrwxrwx 1 apache apache  309 2010-03-26 09:47 passwd
-rwxrwxrwx 1 apache apache 2279 2010-03-26 09:47 svnserve.conf

/var/svn/repo/dav:
total 4
drwxrwxrwx 2 apache apache 4096 2010-03-26 11:19 activities.d

/var/svn/repo/dav/activities.d:
total 0

/var/svn/repo/db:
total 48
-rwxrwxrwx 1 apache apache    2 2010-03-26 09:47 current
-rwxrwxrwx 1 apache apache   22 2010-03-26 09:47 format
-rwxrwxrwx 1 apache apache 1920 2010-03-26 09:47 fsfs.conf
-rwxrwxrwx 1 apache apache    5 2010-03-26 09:47 fs-type
-rwxrwxrwx 1 apache apache    2 2010-03-26 09:47 min-unpacked-rev
-rwxrwxrwx 1 apache apache 4096 2010-03-26 09:47 rep-cache.db
drwxrwsrwx 3 apache apache 4096 2010-03-26 09:47 revprops
drwxrwsrwx 3 apache apache 4096 2010-03-26 09:47 revs
drwxrwsrwx 2 apache apache 4096 2010-03-26 11:19 transactions
-rwxrwxrwx 1 apache apache    2 2010-03-26 11:19 txn-current
-rwxrwxrwx 1 apache apache    0 2010-03-26 09:47 txn-current-lock
drwxrwsrwx 2 apache apache 4096 2010-03-26 11:19 txn-protorevs
-rwxrwxrwx 1 apache apache   37 2010-03-26 09:47 uuid
-rwxrwxrwx 1 apache apache    0 2010-03-26 09:47 write-lock

/var/svn/repo/db/revprops:
total 4
drwxrwsrwx 2 apache apache 4096 2010-03-26 09:47 0

/var/svn/repo/db/revprops/0:
total 4
-rwxrwxrwx 1 apache apache 50 2010-03-26 09:47 0

/var/svn/repo/db/revs:
total 4
drwxrwsrwx 2 apache apache 4096 2010-03-26 09:47 0

/var/svn/repo/db/revs/0:
total 4
-rwxrwxrwx 1 apache apache 115 2010-03-26 09:47 0

/var/svn/repo/db/transactions:
total 0

/var/svn/repo/db/txn-protorevs:
total 0

/var/svn/repo/hooks:
total 36
-rwxrwxrwx 1 apache apache 1955 2010-03-26 09:47 post-commit.tmpl
-rwxrwxrwx 1 apache apache 1638 2010-03-26 09:47 post-lock.tmpl
-rwxrwxrwx 1 apache apache 2267 2010-03-26 09:47 post-revprop-change.tmpl
-rwxrwxrwx 1 apache apache 1567 2010-03-26 09:47 post-unlock.tmpl
-rwxrwxrwx 1 apache apache 3404 2010-03-26 09:47 pre-commit.tmpl
-rwxrwxrwx 1 apache apache 2410 2010-03-26 09:47 pre-lock.tmpl
-rwxrwxrwx 1 apache apache 2764 2010-03-26 09:47 pre-revprop-change.tmpl
-rwxrwxrwx 1 apache apache 2100 2010-03-26 09:47 pre-unlock.tmpl
-rwxrwxrwx 1 apache apache 2758 2010-03-26 09:47 start-commit.tmpl

/var/svn/repo/locks:
total 8
-rwxrwxrwx 1 apache apache 139 2010-03-26 09:47 db.lock
-rwxrwxrwx 1 apache apache 139 2010-03-26 09:47 db-logs.lock

I've got httpd.conf loading svn.conf which contains:

<Location /svn>
DAV on
DAV svn
#SVNParentPath /var/svn
SVNPath /var/svn/repo
Authtype Basic
AuthName "Subversion"
AuthUserFile /var/svn/repo/svnpass
Require valid-user
AuthzSVNAccessFile /var/svn/repo/svnauth
</Location>

Full error message is:

org.tigris.subversion.javahl.ClientException: RA layer request failed
Server sent unexpected return value (403 Forbidden) in response to CHECKOUT request for '/svn/!svn/bln/0'

/var/svn/repo/svnauth:

[root@localhost /]# cat /var/svn/repo/svnauth
[/]
user = rw

Sorry for the incredibly long post, but I thought more info would be better than less. I've been fidgeting with this problem for a long time now.

like image 320
Bocochoco Avatar asked Mar 26 '10 15:03

Bocochoco


1 Answers

I fixed it. I didn't think about it, but mod_security was stopping it.

I just had to add

SecRule REQUEST_METHOD “^(PROPFIND|PROPPATCH)$” allow
SecRule REQUEST_METHOD “^(REPORT|OPTIONS)$” allow
SecRule REQUEST_METHOD “^(MKACTIVITY|CHECKOUT)$” allow
SecRule REQUEST_METHOD “^(PUT|DELETE|MERGE)$” allow

to modsecurity_crs_10_config.conf then restarted httpd. All works well now.

I hope this helps someone.

like image 160
Bocochoco Avatar answered Oct 01 '22 23:10

Bocochoco