LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-10-2003, 05:22 AM   #1
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Rep: Reputation: 30
Apache and php + chmod 644


I'm having problems with the following:

My apache server (in a test environment) runs as process user apache. My document root is like:

Owner:
apache.apache

My access rights are chmod 644 (which should actually be 600) but I don't care about reading on my server.

When I'm accessing my page is say's access denied, and the only way to resolve this, is add x rights, which should not be needed. I'm using apache2 and php version 4.3.3

Does anybody know what i've done wrong ?

Dave
 
Old 10-10-2003, 08:16 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
Well you would want execute permissions on directories the apache user should be able to list (chmod o+x) since that's what the execute bit means when it comes to dirs.

If the file isn't accessed directly as, say http://blah/index.html and the server isn't allowed to list the root dir for index.* files you would get an access denied.

hw
 
Old 10-10-2003, 08:33 AM   #3
daveo
Member
 
Registered: Sep 2003
Location: Holland
Distribution: Gentoo 1.4, Slackware
Posts: 196

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by hw-tph
Well you would want execute permissions on directories the apache user should be able to list (chmod o+x) since that's what the execute bit means when it comes to dirs.

If the file isn't accessed directly as, say http://blah/index.html and the server isn't allowed to list the root dir for index.* files you would get an access denied.

hw
First: The website works, but not anymore when I've changed the accessrights. So I assume that part works correctly

In the mean time i did:

chmod 777 for only the dir where the files are located(wide open). Then on the files I did a chmod 644 because an .php file only needs read if I understand well. The .php don't need to be executed as far as I know, because php parses the file himself.

Now as soon as I leave the x away it's not working. ...
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
Will this command work? chmod -R 644 *.php abefroman Programming 3 10-22-2005 08:26 AM
chmod 644 /etc/shadow stomach Linux - General 15 09-12-2005 08:28 PM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
apache 1.3.29 directoryindex and chmod axion0917 Linux - Software 1 11-30-2003 01:01 PM


All times are GMT -5. The time now is 01:06 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration