logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: symbolic links / file permission problems
Author
RyanKoehler



Joined: 30 Jan 2010
Posts: 2

PostPosted: Sat 30 Jan '10 18:01    Post subject: symbolic links / file permission problems Reply with quote

Hi

I am running apache 2.2.13 on fedora 11 and can't figure out how to set permissions to allow following symbolic links and reading contents in the pointed-to directories (I would like cgi scripts to be locatable in linked directories too, but first things first)

TEST CASE
Here's my directory / file scenario:

/var/www/html <---< Top directory; "DocumentRoot" in httpd.conf (case1)
/var/www/html/test1 <---< Subdirectory directly below top (case2)
/var/www/html/test1/test.html <---< Test page in directory immediately "below" top (case3)
/var/www/html/test2 <---< Symbolic link (ln -s) to /var/www/html/test1 (case4)
/var/www/html/test2/test.html <---< Test page accessed via sym link, test2 (case5)
/home/ryan/play/web <---< "Remote" directory (case6)
/home/ryan/play/web/test.html <---< "Remote" test html page (case7)
/var/www/html/test2 <---< Symbolic link to remote dir; "command: ln -s /home/ryan/play/web test2" (case8 )

For each case, I put each url into firefox address bar, "clearing recent" between each test.

TEST RESULTS
Symbolic links clearly work (cases 4 and 5) but not if they point "outside" the top directory tree.

What happens is that I cannot access anything in the "Remote directory" so cases 7 and 8 yield a error:

"Forbidden
You don't have permission to access /test2/test.html on this server."

FILE SETTINGS
I've set (linux file) permissions on the remote files (cases 6, 7, 8 ) and links to everyone has "rwx"; I certainly can't leave things this way, but wanted to see if this might help? nope!

APACHE CONF SETTINGS
In the http.conf file I've set options "FollowSymLinks" in several places that seem to dictate link-following behavior (and stop / start apache each time) but no luck with the links. Here (in order) are directives that appear they might matter (comment and blanks stripped to save space):

DocumentRoot "/var/www/html"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/ryan/play/web>
AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Options MultiViews Indexes FollowSymLinks IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>


PLEASE HELP!!!!
I'm running out of clues. And to make it worse, I think I ran into something like this years ago on a solaris machine and did indeed get it to work but now I can't recall how!

Thanks,
Ryan Smile
Back to top
RyanKoehler



Joined: 30 Jan 2010
Posts: 2

PostPosted: Sat 30 Jan '10 19:36    Post subject: Found the fix (linux dir permission settings) Reply with quote

I figured out my problem!

*Each* directory in my path "/home/ryan/play/web" needs to have world execute permission set.

That's it. I leave this post here in case it helps someone else (I tried this after reading a similar problem elsewhere).

-Ryan
Back to top


Reply to topic   Topic: symbolic links / file permission problems View previous topic :: View next topic
Post new topic   Forum Index -> Apache