# Running svn as apache user

## Recommended Posts

BeanDog    1065
I have some PHP scripts that were running svn commands through shell_exec(). They were working fine, but have mysteriously stopped working altogether. If I SSH onto the server as root, and do this: sudo -u apache svn help I get an error: svn: Can't open file '/root/.subversion/servers': Permission denied That's right, even the svn help command is trying to access this file. In desperation, I set permissions to 777 on the /root/.subversion directory, and even changed its owner to apache. (chown -R apache /root/.subversion; chmod -R 777 /root/.subversion). Neither of those helped. Anyone have an idea of what I might do with this?

##### Share on other sites
Sander    1332
What's the home directory of the apache user? You can check in /etc/passwd. The user executing the svn commando must have a valid home directory and must be able to write the .subversion directory there.

##### Share on other sites
BeanDog    1065
Looks like it was a bizarre SELinux issue--the httpd process was for some reason running in the contect of root rather than user_u, so it was checking /root rather than /somewhereelse. Maybe because I /etc/init.d/httpd restart'ed as root? Anyway, simply rebooting the server took care of the problem.

Thanks anyway!