Re: Can't get Apache httpd.conf permissions correct



Firstly don't run apache as a regular user, it's a security risk. Run it
as its own user, and ensure that this has no rights to damage anything in
the system, or as "nobody".

Ensure that the apache user has read access to all files it needs. This
includes having "execute" access to the directories containing them - I
suspect that this may be what you are missing. Normally this is done by
granting global read/execute access to the files in question. If you want
to do it using group access and not have the files globally readable
(although I can't think why you would want to, when they can be accessed
via the web server anyway) the files will have to belong to the "apache"
group.

Regards, Ian

Yep you hit the nail on the head. It made perfect sense when I read what
your solution.

I changed httpd.conf to:
User: apache
Group: apache

(apache has the shell of /sbin/nologin so that should be secure)

Then did:
chmod -R g=rx user1
chmod -R g=rx user2

All now works. Thanks very much.

Cheers

Phil


.



Relevant Pages

  • Re: apache permission problem please help
    ... Ok as anyone reading this thread knows i have huge mess on hands. ... chmod -R 701 home ... mailclients but i moved one and had to modify the permissions all over ... >>apache was unable to use these files. ...
    (freebsd-questions)
  • Re: web file permissions (was: Working as root while Apache is running; how much a risk?)
    ... Should they all be apache, i.e., the same owner as the running ... to have files and directories owned root:root, files chmod 644 and dirs ... All static files have 0400 permissions. ... Fedora GNU/Linux Core 2 on Athlon CPU kernel 2.6.6-1.435.2.3 ...
    (Fedora)
  • Re: nobody user
    ... We run Apache2 as the nobody user and the whole ... webserver's document root is set to chmod 775. ... Is apache running as group "developer"? ...
    (comp.os.linux.misc)
  • Re: [PHP] Permissions issue on share
    ... "Or make sure the user apache runs on has write access to the share." ... the mount on your Mac. ... I think a simple chmod 777 to the mount folder would do ... >> I have Apache Web Server running on Mac OS X with PHP. ...
    (php.general)
  • SELinux and userdirs: A solution
    ... One indication that this was the ultimate solution had to do with the ... permissions must be inherited from parent directories just like the normal permission system. ... But if the user's "home" directory isn't "chmod 711" as well, the user's public_html directory will never be read by Apache. ...
    (comp.infosystems.www.servers.unix)