How to secure Apache for shared hosting environment? (chrooting, avoid symlinking...)
- by Alessio Periloso
I'm having problems dealing with Apache configuration: the problem is that I want to limit each user to his own docroot (so, a chroot() would be what I'm looking for), but:
Mod_chroot works only globally and not for each virtualhost: i have the users in a path like the following one /home/vhosts/xxxxx/domains/domain.tld/public_html (xxxxx is the user), and can't solve the problem chrooting /home/vhosts, because the users would still be allowed to see each other.
Using apache-mod-itk would slow down the websites too much, and I'm not sure if it would solve anything
Without using any of the previous two, I think the only thing left is avoiding symlinking, not allowing the users to link to something that doesn't belong to them.
So, I think I'm going to follow the third point but... how to efficiently avoid symlinking while still keeping mod_rewrite working?!
The php has already been chrooted with php-fpm, so my only concern is about Apache itself.