# Subversion installation



## balanga (Aug 2, 2017)

I'm having problems getting the hang of subversion...

I have read the Subversion book as well as a guide on this forum Thread 6888/, but I'm making basic mistakes in setting this up, although I think I have Apache configured correctly... Here's what I'm doing:-

```
mkdir /var/svn
chown -R svn:svn /var/svn
svnadmin create /var/svn/myproj
svn import myfiles http://127.0.0.1/svn/myproj -m "My Proj"
svn: E000013: Can't open file '/var/svn/myproj/db/txn-current-lock': Permission denied
```

What have I overlooked?


----------



## zapata (Aug 2, 2017)

Have you checked apache log? The webserver probably cannot write to /var/svn. Fix permissions.


----------



## balanga (Aug 2, 2017)

Any suggestions as to how I should do this?


----------



## SirDice (Aug 2, 2017)

You should probably read /var/log/httpd-error.log.


----------



## balanga (Aug 2, 2017)

SirDice said:


> You should probably read /var/log/httpd-error.log.


It's the same as above

```
Can't open file '/var/svn/myproj/db/txn-current-lock': Permission denied
```
I'm not sure how to give Apache permission to access the /var/svn directory.


----------



## SirDice (Aug 2, 2017)

Apache usually runs on the www account, make sure that user has, at least, read access. And the www user probably needs write access to certain directories too.


----------



## balanga (Aug 2, 2017)

Should I add svn to the www group?

Looking at httpd.conf I see User and Group set to www, but /var/log/httpd-error.log is owned by root so how does Apache write to it?


----------



## SirDice (Aug 2, 2017)

balanga said:


> Looking at httpd.conf I see User and Group set to www, but /var/log/httpd-error.log is owned by root so how does Apache write to it?


Privileges are dropped after the port and log files have been opened. Only root is able to open ports below 1024 too.



balanga said:


> Should I add svn to the www group?


No, you need to chmod(1)/chown(8) the directories so the www user account has read and write access to those files.


----------

