View Full Version : Serving HTTP from home folders
spectre_25gt
March 15th, 2006, 08:34 PM
Ok, I'm trying to set things up so that if I go to $website.$username.server.com it will serve files from /home/$username/dev/www/$website/. Unfortunately, I can't figure out how to set up the permissions so that Apache can read the files.
Any ideas?
Glut
March 15th, 2006, 10:19 PM
chown the files to the group www (or www-data or whatever apache is using) and chmod all the files group readable.
edit: sorted my chown'ing and chmod'ing - it's so confusing :-)
spectre_25gt
March 16th, 2006, 06:31 PM
I've tried setting permissions that way but apache still can't get to it because the permissions higher up in the hierarchy don't allow it. I really don't want to change that, either.
Also, what can I do to ensure that files created or moved into that folder keep www-data as the group and the correct permissions are inherited? Should I make my users that deal with those files part of the www-data group?
spectre_25gt
March 18th, 2006, 01:41 PM
Just one bump and I'll let it die. This is just kinda holding me up a bit.
Edit:
Ok, I've got it working. I ended up just being a little bit more lenient with the permissions on my home folder and tightening up the subdirectories instead.
ice.man
March 19th, 2006, 01:29 AM
***@lanstats:~$ sudo adduser *** www-data
Password:
The user `***' is already a member of `www-data'.
***@***stats:~$ sudo chown -R www-data:www-data /var/www
***@***stats:~$ sudo chmod -R 664 /var/www
***@***stats:~$
And it still says i don't have permissioms!!
anyone got any idears?
LordHunter317
March 19th, 2006, 10:00 AM
chown the files to the group www (or www-data or whatever apache is using) and chmod all the files group readable.
edit: sorted my chown'ing and chmod'ing - it's so confusing :-)No. Files should be owned by whoever will be editing them. Apache should get access through world permissions.
claes
March 20th, 2006, 02:06 PM
Check that others have execute permissions on all the folders down to the folder apache will use to publish from. And that folder others need both read and execute permissions.
Claes
vBulletin® v3.8.0 Release Candidate 2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.