Web Project with SVN / Has an Uploader, uploader needs to be chowned by apache to work
Our web project repository is hosted on one subdomain our web server, then the 'deployment' of the project involves checking out a copy at a subdomain of the same server.
So we checkout the working copy on staging.mydomain.com and in order for the upload utility to work the /upload/ directory must be chowned apache:apache, as PHP runs as Apache.
Of course, when I attempt to upload files using the copy at staging.mydomain.com, I get permission errors. So like a good boy, I chown -hR apache:apache upload/
and of course, my ssh credentials a开发者_运维百科ren't in the apache group or called apache, so running an svn update fails until I chown everything back to the user that checked out the repo.
Any recommendations on what to do?
If the source code is in the same system with the web server, then you can just export the trunk into web server directory. Everytime you modify the code you must export them as well. I think this more safe to do, since you are not using administrative or super user.
You should use a single user to deploy. Typically i would make this account unable to ssh in. Then i would have different devs be able to login with their own accounts and su
to this user. The deployment user should at the least be in the apache group, if not the actual user or have limited sudo
capabilities to perform operations as that user.
精彩评论