LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-22-2011, 12:02 AM   #1
Trerro
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
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.
 
Old 03-22-2011, 02:30 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,209
Blog Entries: 1

Rep: Reputation: 2064Reputation: 2064Reputation: 2064Reputation: 2064Reputation: 2064Reputation: 2064Reputation: 2064Reputation: 2064Reputation: 2064Reputation: 2064Reputation: 2064
Hi and welcome to LQ,

Since you're running ubuntu, check if this is due to apparmor. Maybe you can disable it temporarily to do your tests and verify if that's the case.
BTW you don't need 775 permissions for the directories that apache can access. Just 755 is enough. There is no need to add the apache-user in the user's group too.

Regards
 
Old 03-23-2011, 02:22 AM   #3
Trerro
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Original Poster
Rep: Reputation: 0
It turns out I did in fact do something stupid. I set up each subdomain to create the log file in a directory named log under the main directory for each subdomain. This works a whole lot better when I then remember to actually make those log directories. :P

Oddly, this didn't throw errors of any kind, it just plain failed. It's working fine now that I fixed that problem though.

Sorry for the unneeded thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow ftp user access to modify apache owned files jasonma84@yahoo.com Linux - Newbie 4 10-26-2010 05:25 PM
Apache subdomains pokevitek Linux - Server 1 12-13-2009 09:37 PM
Apache and Subdomains Galaxy_Stranger Linux - Server 4 03-15-2008 03:20 AM
move stuff owned by one user by another user Geminias Linux - Newbie 4 07-12-2007 11:35 AM
Make a file owned by root owned by a user sharpie Linux - Newbie 2 02-26-2004 02:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration