Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
I'm running Apache 2.2.8 on Fedora 7. I created a symlink in my DocumentRoot, and the permissions are 755 on the directory. In my httpd.conf, I have allowed FollowSymLinks, but ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Location
    Lafayette, IN
    Posts
    83

    [SOLVED] Apache won't follow symlinks


    I'm running Apache 2.2.8 on Fedora 7. I created a symlink in my DocumentRoot, and the permissions are 755 on the directory. In my httpd.conf, I have allowed FollowSymLinks, but when I try to view the page, I get 403ed and error_log has "Symbolic link not allowed or link target not accessible"

    I've Googled the heck out of this, but I haven't been able to find a solution that works. SELinux is disabled, so that can't be the problem. Any suggestions?

    Code:
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    
    <Directory "/archive/www/html">
    
        Options Indexes FollowSymLinks
    
        AllowOverride All
    
        Order allow,deny
        Allow from all
    
    </Directory>

  2. #2
    Just Joined!
    Join Date
    Jul 2008
    Posts
    8
    Post a ls -l of the source and target directories. pls.

  3. #3
    Just Joined!
    Join Date
    Jun 2008
    Posts
    11
    +1 on this one

    My situation is basicly the same, though it works on a symlink that is in the document root, but not on symlinks elsewhere in the hierarchy.

    httpd.conf has the "same" settings as Ben:

    DocumentRoot /www
    ..
    <Directory /www/>
    Options -Indexes Includes FollowSymLinks MultiViews
    AllowOverride None Options
    Order allow,deny
    Allow from all
    </Directory>

    File: -rwxr-xr-x 1 root root 1344 2008-07-15 15:49 q.gif
    Link1: lrwxrwxrwx 1 root root [..] /www/q.gif -> images/test/q.gif
    Link2: lrwxrwxrwx 1 root root [..] /www/images/q.gif -> test/q.gif

    In firefox 3:
    * http://server/q.gif ..shows the gif (304 in apache log)
    * http://server/images/q.gif ..gives "Not Found (404 in apache log)

    Don't mean to hijack this thread, but I believe these problems might have the same solution

  4. #4
    Just Joined!
    Join Date
    Sep 2007
    Location
    Lafayette, IN
    Posts
    83
    Quote Originally Posted by thamaravelilpg View Post
    Post a ls -l of the source and target directories. pls.
    target (from DocumentRoot (/archive/shared/www/html/ )):
    0 lrwxrwxrwx 1 bcotton archive 48 2008-07-12 14:54 jennifer_and_nick -> /archive/shared/photos/family/jennifer_and_nick/

    source:
    [1156 bcotton@boone /archive/www/html ]$ ls -al /archive/shared/photos/family/jennifer_and_nick/
    total 16
    drwxr-xr-x 4 bcotton archive 4096 2008-07-10 20:42 .
    drwxr-xr-x 3 bcotton archive 4096 2008-06-26 00:16 ..
    drwxr-xr-x 2 bcotton archive 4096 2008-06-26 00:17 shower
    drwxr-xr-x 2 bcotton archive 4096 2008-07-10 20:42 wedding


    Unlike alfmarius, it doesn't work in document root either, although in my Googling I did see that was a common issue.

  5. #5
    Just Joined!
    Join Date
    Jul 2008
    Posts
    8
    in your httpd.conf file, what do you have set for the following values?

    Code:
    User http
    Group http


    thanks.

  6. #6
    Just Joined!
    Join Date
    Sep 2007
    Location
    Lafayette, IN
    Posts
    83

    Smile

    Quote Originally Posted by thamaravelilpg View Post
    in your httpd.conf file, what do you have set for the following values?
    Code:
    User apache
    Group apache
    I see what you're getting at, and I could have sworn I already tried it, but apparently I didn't. Changing the Group to 'archive' fixes the problem.

    Thanks much, now my mom will stop asking me when she gets to see the pictures.

  7. #7
    Just Joined!
    Join Date
    Jul 2008
    Posts
    8
    Glad it worked! I've done an apache setup about a million times...and each time I do it it's been long enough for me to forget all the little config changes it needs.

    cheers

    philip

  8. #8
    Just Joined!
    Join Date
    Jun 2008
    Posts
    11
    Nice you got it working Ben!

    ..unfortunately I didn't

    I did some more testing, and i must say I'm maby more confused now, because when i tried to reconstruct my problem with new directories and links i couldn't! Here is my newst test results:


    The stuff that doesn't work:
    Code:
    > pwd
    /data/www
    
    > ls -ld /data/www/
    drwxrwxrwx 14 www-data www-data 4096 2008-07-16 12:55 /data/www/
    
    > ls -ld /data/www/GameBase/
    drwxr-xr-x 7 www-data www-data 4096 2008-07-16 12:53 /data/www/GameBase/
    
    > ls -ld /data/www/GameBase/images/
    drwxr-xr-x 9 www-data www-data 4096 2008-07-16 12:51 /data/www/GameBase/images/
    
    > ls -ld /data/www/GameBase/images/p.gif
    -rwxr-xr-x 1 www-data www-data 1344 2008-07-16 12:51 /data/www/GameBase/images/p.gif
    
    > ln -s /data/www/GameBase/images/
    > ls -l images
    lrwxrwxrwx 1 www-data www-data 26 2008-07-16 12:59 images -> /data/www/GameBase/images/
    
    http://server/GameBase/images/p.gif -> works! log: "GET /GameBase/images/p.gif HTTP/1.1" 304 -
    http://server/images/p.gif ->  does not work! log: "GET /images/p.gif HTTP/1.1" 404 283
    I reconstructed the scenario with new dirs, and then it works!
    Code:
    > ls -ld /data/www/test1/
    drwxr-xr-x 3 www-data www-data 4096 2008-07-16 12:14 /data/www/test1/
    
    > ls -ld /data/www/test1/test2/
    drwxr-xr-x 3 www-data www-data 4096 2008-07-16 12:20 /data/www/test1/test2/
    
    > ls -ld /data/www/test1/test2/p.gif
    -rwxr-xr-x 1 www-data www-data 1344 2008-07-16 12:14 /data/www/test1/test2/p.gif
    
    > ln -s /data/www/test1/test2/
    > ls -l test2
    lrwxrwxrwx 1 www-data www-data 22 2008-07-16 13:07 test2 -> /data/www/test1/test2/
    
    http://server/test1/test2/p.gif -> works! log: "GET /test1/test2/p.gif HTTP/1.1" 304 - 
    http://server/test2/p.gif ->  works! log: "GET /test2/p.gif HTTP/1.1" 304 -
    To my eyes these are identical cases, but one work and the other doesn't. Please help me out, see what i cannot see!

  9. #9
    Just Joined!
    Join Date
    Sep 2007
    Location
    Lafayette, IN
    Posts
    83
    You're right. From what I can see, it looks like these two cases should behave identically. I assume your httpd.conf has both User and Group set to www-data?

  10. #10
    Just Joined!
    Join Date
    Jun 2008
    Posts
    11
    Quote Originally Posted by Ben Cotton View Post
    You're right. From what I can see, it looks like these two cases should behave identically. I assume your httpd.conf has both User and Group set to www-data?
    You are correct. Forgot to meniton it. Its incredible this doesn't work (and a tad frustrating), I look forward to someone telling me whats up, so I can slap my forhead and say "ahhh, of course, what was I thinking!"

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •