# Apache Problem with Directory Listings and Sym Links

## eekrazyk

I installed Apache2 on my home linux box and configured it the same as my linux box at work, but for some reason, I can't get the index listing to show a symbolic link at home.  It works fine at work...

The apache error log states the following when I attempt to access it directly:

```
[Sun Jan 01 15:27:44 2006] [error] [client 192.168.1.1] Symbolic link not allowed:
```

I get a 403 Forbidden error.

I'm using the same httpd.conf configuration as my linux box at work:

```
UseCanonicalName On

<Directory />

  Options -All -Multiviews

  AllowOverride None

  <IfModule mod_access.c>

    Order deny,allow

    Deny from all

  </IfModule>

</Directory>

<IfModule mod_userdir.c>

    UserDir public_html

</IfModule>

<Directory /home/*/public_html>

    AllowOverride All

#    Options MultiViews -Indexes Includes FollowSymLinks

    Options MultiViews Indexes IncludesNoExec FollowSymLinks

    <IfModule mod_access.c>

      Order allow,deny

      Allow from all

    </IfModule>

</Directory>

<Directory /home/*/public_html/cgi-bin>

     Options +ExecCGI -Includes -Indexes

     SetHandler cgi-script

</Directory>

<IfModule mod_perl.c>

    <Directory /home/*/public_html/perl>

        SetHandler perl-script

        PerlResponseHandler ModPerl::PerlRun

        Options -Indexes ExecCGI

   <IfDefine MODPERL2>

     PerlOptions +ParseHeaders

   </IfDefine>

   <IfDefine !MODPERL2>

          PerlSendHeader On

   </IfDefine>

    </Directory>

</IfModule>

DirectoryIndex index.html index.html.var

AccessFileName .htaccess

<Files ~ "^\.ht">

    Order allow,deny

    Deny from all

</Files>
```

There's a lot more in there that I didn't include because I didn't edit any of it.

Anyone know why I'm getting a Symlink Not Allowed error when I'm using the same configuration as at work and Symlinks work on that box?  Or any ideas at least?  I'm pulling my hair out over this....

Thanks.

----------

## WhimpyPeon

Are your documents being hosted from the /home... directories on your home computer, or are they being posted from the default /var/www/localhost/htdocs directory.  Your config file only appears to be allowing FollowSymLinks from /home... directories.

I'm no expert on apache configs, but just a thought.

----------

## eekrazyk

Yea, actually, I have wordpress installed and I'm trying to post a link in a Wordpress post to a SymLink in my /home/ directory that redirects to a webpage in my /home/media/Pictures/ directory.

That's when I discovered that my /home/user/public_html/ index isn't showing the sym link and I'm receiving the apache error listed above.

This is still perplexing me.  I'm half tempted to re-emerge apache.

Any other ideas?

Thanks.

----------

## anonybosh

1. Have you checked the permissions/ownership of the files/directories leading up to the file?

2. Have you tried expressly allowing a symlink in that folder?

In you httpd.conf file:

```
<Directory /home/user/public_html/media/pictures>

Options FollowSymLinks

</Directory>
```

3. Do you have any modifications in the /etc/apache2/vhosts/ area?

----------

## eekrazyk

Doh.  The directory my sym link was pointing at had the following permissions: 750.  Stupid noob mistake.  Sorry about that.

Thanks for the help!!

----------

## anonybosh

No worries!

----------

