You are not logged in.

#1 2009-03-10 10:01:35

kilolima
Member
Registered: 2008-01-26
Posts: 49
Website

basic help with setting up apache [SOLVED]

Hi,

I don't know if the problem is directory permissions or in configuring httpd.conf, but I would like to change the document root of my apache server to my (encrypted) home partition at /home/kilolima/www.  However, after changing the document root in httpd.conf and adding user http (which apache runs under) to the users group (every file in my home directory is in the users group), I still get Access Forbidden errors.  Is there a step I am missing here?  I also thought I could add a symlink from /var/www to /home/kilolima/www and make that the document root but that doesn't seem to work either.

Oh, and is there something else I have to change in the config to get php working?

(I can't get the wiki to load at all, so if this is already spelled out there I apologize)

Cheers,

kilolima

Last edited by kilolima (2009-03-10 20:57:34)

Offline

#2 2009-03-10 10:23:43

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: basic help with setting up apache [SOLVED]

Take a look at this thread: http://bbs.archlinux.org/viewtopic.php?id=61583

You need to either make all directories along the path to the document root executable by other users (http) or you need to mount your root directory somewhere else. I would highly recommend using bindfs to do that as you can change the permissions of the files as they appear at the mount point (e.g. make them read-only even though they might be writable in their original location).

As for php, I'm not sure but I think you need to specify in which directories it's allowed to execute somewhere in the configuration file. I remember having seen something about a given set of default directories and anything outside of them requiring explicit permissions.

I hope this helps.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2009-03-10 20:57:22

kilolima
Member
Registered: 2008-01-26
Posts: 49
Website

Re: basic help with setting up apache [SOLVED]

Hey Xyne!

Thanks for that advice!  Changing everything to executable did the trick ( chmod -R +x /home ).  I didn't realize that apache needed more than read access to serve a page.

I'm so use to Fedora where all this is done for you when you install LAMP, so it's kind of fun to get a more intimate examination of the webserver.

Thanks!

kilolima

Offline

#4 2009-03-10 21:30:00

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: basic help with setting up apache [SOLVED]

Only the directories along the path to the Apache root need to be executable, e.g. if your server root is in /home/kilolimo/http, then only /home, /home/kilolima, and /home/kilolima/http need to be executable.

If you ran "chmod -R +x /home", you've made every single file and directory in all users' home directories executable. This could be very dangerous and it's definitely not what you want. I'm not sure what the best way to fix that is. To remove all the exec permissions on file, you could run "find /home -type f -exec chmod -x {} \;", but then you'll need to figure out which files should be executable.

I'm still hoping that you didn't run that command.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2009-04-27 15:44:14

king.flasher.dave
Member
From: Berlin
Registered: 2008-11-25
Posts: 140
Website

Re: basic help with setting up apache [SOLVED]

thx a lot! I've been looking for this kinda problem for some time... -_-


Speak when you are angry and you will make the best speech you'll ever regret.

Offline

Board footer

Powered by FluxBB