LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 11:49 AM   #1
mzzxx11
Member
 
Registered: Sep 2012
Posts: 86

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, 12:56 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 11:09 AM   #3
mzzxx11
Member
 
Registered: Sep 2012
Posts: 86

Original Poster
Rep: Reputation: Disabled
tnx.

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

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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 11:25 AM.
 
  


Reply



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 08:51 PM
Access denied for user 'root'@'localhost' najmul002 Linux - Server 3 12-14-2010 06:23 PM
SVN + LDAP + Apache in Debian Can't open file /db/txn-current-lock Permission denied Ricio Linux - General 3 06-14-2009 03:46 PM
Access denied for user: 'mythtv@localhost' Red Knuckles Ubuntu 1 10-04-2007 03:12 PM
localhost access denied another_eric Linux - Networking 2 10-10-2003 08:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:40 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
Open Source Consulting | Domain Registration