LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-07-2014, 02:48 PM   #1
nirfun
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Rep: Reputation: Disabled
Apache fails to follow symlink


Apache error log: "Symbolic link not allowed or link target not accessible"

my html files in /home/user/public_html/
I've create sym link from /home/user/public_html/ to /data1/foo/files2/

but when Apache tries to access /data1/foo/files2/i.jpg it fails.

I've chown-ed the entire path with the user as owner and group (not apache user) and also have execute permissions in the path.

I have "Options +FollowSymLinks" in httpd.conf and .htacess

any ideas?
 
Old 08-07-2014, 03:38 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,245

Rep: Reputation: 2528Reputation: 2528Reputation: 2528Reputation: 2528Reputation: 2528Reputation: 2528Reputation: 2528Reputation: 2528Reputation: 2528Reputation: 2528Reputation: 2528
did you configure that option in the httpd.conf file ?

also links across partitions are not recommended and sometimes blocked by the OS

Last edited by John VV; 08-07-2014 at 03:40 PM.
 
Old 08-07-2014, 03:39 PM   #3
nirfun
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
which option? follow symlinks? yes, I did.
 
Old 08-07-2014, 04:38 PM   #4
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Fedora FC23, Raspbian, Ubuntu Precise via Chrome/Crouton
Posts: 361

Rep: Reputation: 43
Do you have selinux on?

If yes, check the message and http/error_log to see if Apache is allowed to access that directory.
 
Old 08-08-2014, 12:40 AM   #5
nirfun
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: disabled
Policy version: 24
Policy from config file: targeted

What do you mean by "check the message"?
in httpd error log I see "Symbolic link not allowed or link target not accessible"

thanks for you help
 
Old 08-08-2014, 01:54 AM   #6
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Fedora FC23, Raspbian, Ubuntu Precise via Chrome/Crouton
Posts: 361

Rep: Reputation: 43
Check /var/log/message...that is where selinux messages typically go, but you have it set as permissive. If it was strict, you'd see something like "Selinux is preventing httpd from accessing..." messages.

Go with what the error_log says...

1. Sym link not allowed, but you have it ON. grep all the http conf files for all FollowSymLink options. You may have them turned off again at a lower directory level.
2. link target not accessible: Which means the target directory is not r_x (read, executable) by the apache server.
 
Old 08-08-2014, 07:22 AM   #7
nirfun
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
I couldn't find any conf file with -FollowSymLink and I tried to change the ownership of each folder to "apache" and it didn't help
 
Old 08-08-2014, 07:37 AM   #8
nirfun
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Maybe it's important to mention that the link points to a folder outside the home dir of the user and outside of the doc root.

I tried to create link inside the public_html folder and it worked well, so the problem is not FollowSymLink for sure

any ideas?
 
Old 08-08-2014, 10:16 AM   #9
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Fedora FC23, Raspbian, Ubuntu Precise via Chrome/Crouton
Posts: 361

Rep: Reputation: 43
Did you check that the user and group permissions of your link and target were accessible to the apache process?

Provide an ls -l of the link and ls -ld of the target.

Last edited by pwalden; 08-08-2014 at 10:21 AM.
 
  


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
tar follow symlink on extract McZ Linux - Newbie 1 08-30-2012 06:06 AM
Making a symlink follow its target when the target moves pwabrahams Linux - Software 3 03-08-2011 08:04 PM
[SOLVED] Is it possible to open a symlink (won't follow) and read data from it? lesca Programming 5 11-10-2010 07:08 AM
udev rule fails when symlink is defined Flyte Linux - Software 6 09-19-2010 02:35 PM
Kill follow-on code if source fails in bash? e1ectthedead Programming 3 12-21-2009 09:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:49 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