Apache issue with user-owned subdomains
There's a few people that want subdomains on a site I run. I want them to have full access to their own sub, but not each other's or the main site (read-only is fine). My attempt to accomplish this was as follows:
1. I created the new users. Each of these then has a subdirectory named public out of their home directory, to serve the subdomain out of.
2. Apache runs on a superuser account named admin, so I added admin to the new usergroups.
3. I chmodded the new directories to 775, so both the owner and Apache could do what they wanted in there, but the public would not have write access.
4. I set up the subdomain. This is an Ubuntu box, so I defined the settings in /etc/apache2/sites-available, then did an a2ensite on the new sub. Each sub of course has a root directory of the appropriate public directory. I also edited the DNS records to include the new subdomains.
Everything appeared to work fine upon doing this, but then Apache would not serve *anything*, even if I connected by IP. Any attempt to load a page would fail with, "The connection to the server was reset while the page was loading." Restarting Apache would also fail. If I disabled the new subdomains, everything would again work fine.
There is no issue with the subdomain settings themselves - I have several others set up in exactly the same manner (but with the directories they're serving out of not owned by different users), and those work fine.
Somehow, it appears that in spite of the user Apache is running as being in all of the relevant usergroups, and those groups having rwx access to the new subdomains' directories, it still can't access them.
I'm still quite new to running a Linux server, so I'm guessing I missed something stupid here, but I can't figure out what. Any help would be greatly appreciated.
Last edited by Trerro; 03-22-2011 at 12:08 AM.
|