Running svn as apache user

Started by
2 comments, last by Sander 16 years, 2 months ago
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?
Advertisement
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.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

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!
Quote:Maybe because I /etc/init.d/httpd restart'ed as root?


No. Only root can use the scripts in /etc/init.d. The script then takes care of running as the right user. Besides that, Apache also takes care of running at the right user itself. The user Apache is supposed to run at is defined in httpd.conf

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement