Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-20-2012, 01:10 AM   #1
Registered: Sep 2003
Location: Qingdao, China
Distribution: mandriva, slack, red flag
Posts: 249

Rep: Reputation: 31
.js file with permissions 640, owned by apache user cannot be accessed thru browser

I have an occurrence in a web server:

- the permissions of a .js file are 640 user user
- the .js file won't be read by the web browser (403 - Permission Denied)
- .php files of the same permission can be parsed and return html
- echo exec('whoami'); in a php file echoes 'user' in the browser

So, i'm just not sure what user is grabbing the js files and why this is different from whose running the php file. I would assume if 'whoami' through php is 'user' and permissions are 640 user user, the web browser would be able to grab a .js file. Can you explain?

Old 09-20-2012, 06:23 AM   #2
Registered: Dec 2010
Location: Concordia, Entre Ríos, Argentina
Distribution: Debian
Posts: 46

Rep: Reputation: 5
did you tested with 644?
it would be good to have it at least working before debugging user permissions ¿don't you think?
Old 09-20-2012, 08:07 AM   #3
Registered: Sep 2003
Location: Qingdao, China
Distribution: mandriva, slack, red flag
Posts: 249

Original Poster
Rep: Reputation: 31
Yes, of course 644 works.

It turns out the apache user was "nobody" - any idea why 'whoami' through php returns 'user'?


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
Can't allow user write permissions to another owned directory seriosbrad Linux - Newbie 4 02-09-2012 07:31 AM
[SOLVED] Apache issue with user-owned subdomains Trerro Linux - Server 2 03-23-2011 01:22 AM
.dmrc file being ignored, should be owned by user and certain permissions.. how do i? mitchell7man Ubuntu 8 04-25-2007 10:31 AM
Assigning permissions for a file to be accessed by particular users praveen kumar Linux - Networking 3 05-18-2006 10:20 AM
Make a file owned by root owned by a user sharpie Linux - Newbie 2 02-26-2004 01:26 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:22 PM.

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