0

been working on this for hours, can't get apache2 to follow a symbolic link. release is debian 7.4. /etc/apache2/sites-enabled/000-default points to ../sites-available/default

sites-available/default looks like

    DocumentRoot /var/www
    <Directory />
            Options FollowSymLinks Indexes
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    (ssl config)

if my web pages are in /var/www, all is well. If I create a symbolic link in /var/www:

ln -s /mount/movies/htdocs movies

and point the browser to a file in the movies directory, apache2 logs (at info and debug log levels)

[Wed Feb 12 08:59:53 2014] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/movies

permissions along the path are 666 and all are owned by root.

Thanks for your feedback, Fred

I tried

chmod -R 555 *

in the /var/www directory, to no benefit. apache2 logs:

[Wed Feb 12 10:46:20 2014] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/movies

Thanks, Fred

The symbolic link 'movies' does not show up when viewing the contents of /var/www with a browser.

For testing, I created a directory in /var/www called tools. I pointed to http:// and saw the directory icon for tools. Inside the directory, I created a symbolic link to a file on the mount.

ln -s /mnt/movies/htdocs/test1.php test1.php

When I clicked on the tools icon in the browser, test1.php did not show up, only a link to the parent directory.

Index of /tools [ICO] Name Last modified Size Description [DIR] Parent Directory -
Apache/2.2.22 (Debian) Server at debian Port 80

I cannot figure out why the server is not 1. displaying links when viewing the contents of a directory, or 2. not following the symbolic links to render a page.

Again, Thanks, Fred

Works, finally as a kludge.

I changed

 Options FollowSymLinks Indexes

to

 Options All

Probably a security issue (no .htaccess), but the only thing that would allow the server to follow symbolic links.

Fred

Thanks Evias, That was already done. This did not allow apache2 to follow symbolic links. Only when the options was set to ALL did apache follow symbolic links.

Best, Fred

  • 666 or 777? 666 is rw-rw-rw which is not enough to enter directories since the x bit is missing. – fede.evol Feb 12 '14 at 14:49
0

You have created directory /mount/movies/htdocs and created a symbolic link movies inside /var/wwww. Now the the permission and ownership details of /mount should be like this.

drwxr-xr-x   2 root  root   4096 Feb 13 14:35 mount

That is 755.

If you don't have these permission for your /mount folder, then you will get the error, Symbolic link not allowed or link target not accessible:, while creating symbolic link to this folder. So change the permission of this folder to 755. So use this command to change the permission.

Solution: chmod +x -R /mount or chmod 755 -R /mount.

0

For apache to access the linked folder they have to belong to apache user or set an access permission which lets others to access the mentioned folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.