Security implications of moving Apache document root outside of /var/www

Viewed 45

I was wondering what, if any, security implications are involved in moving the document root outside of /var/www in Apache. I'm not asking how- I'm wondering if I should.

There's a group shared directory used by our staff that resides in /srv/SHARED, and we were thinking of doing something like this:

Document root: /var/www/DOMAIN, which is a symlink to: /srv/SHARED/sites/DOMAIN/live.

This would allow us to update the symlink easily for our deployment scripts and in case we need to rollback to a previous deployment. There will be multiple domains hosted on this server.

While not specific to WordPress, I believe this article is applicable in that it discusses some security implications of symlinks.

As it stands, the group would own everything inside the /srv/SHARED directory, and www-data would only own the files/directories needed inside /srv/SHARED/sites/DOMAIN/live. We obviously don't want the web server to access anything outside of that directory.

Any insight or suggestions would be appreciated!

Thanks.

1 Answers

You can assign any document root you want, security implications may arise if you assigned a folder that contained sensitive information as document root, so no real issue once you just follow common sense.

Related