LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2013, 12:49 PM   #1
mzzxx11
Member
 
Registered: Sep 2012
Posts: 78

Rep: Reputation: Disabled
access denied to symlinked file, apache 2 as localhost (debian wheezy)


I've installed apache on debian wheezy (stable).

I've symlinked a php file from my home directory to /var/www.

when I enter
Code:
localhost/myfile.php
in the browser,
I get an error message:
Code:
You do not have permission to run myfile.php
copying the file to /var/www allows me to run it, but I want it to be symlinked to my home dir.

any suggestions?

TIA
 
Old 11-11-2013, 01:56 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Very likely it is a security restriction.

The directory defined in the apache configuration file likely has FollowSymLinks disabled...

Another possibility is that apache does not have access to your home directory (the entire path of the symbolic link must allow apache to access it).
 
Old 11-13-2013, 12:09 PM   #3
mzzxx11
Member
 
Registered: Sep 2012
Posts: 78

Original Poster
Rep: Reputation: Disabled
tnx.

how do I solve this issue?
 
Old 11-13-2013, 12:23 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Either change the configuration file (if that is the problem) or change the access protections for all directories between apache and the file being linked to.

The problem with a symlink is that it requires the user home directory to be world readable (generally rx, but x should work just as well), as well as any directories down to the file... This may be against the local security policy.

Last edited by jpollard; 11-13-2013 at 12:25 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql --- Access denied for user 'test'@'localhost' permalac Linux - Server 15 03-05-2013 09:51 PM
Access denied for user 'root'@'localhost' najmul002 Linux - Server 3 12-14-2010 07:23 PM
SVN + LDAP + Apache in Debian Can't open file /db/txn-current-lock Permission denied Ricio Linux - General 3 06-14-2009 04:46 PM
Access denied for user: 'mythtv@localhost' Red Knuckles Ubuntu 1 10-04-2007 04:12 PM
localhost access denied another_eric Linux - Networking 2 10-10-2003 09:35 PM


All times are GMT -5. The time now is 03:53 PM.

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