• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

Internal Server Error when accessing page through symbolic link


First off: My host provides me with two directories:

1- /usr/home/(account name)
2- /usr/www/users/(account name)/(domain directory)

I placed my web files in the home directory, and created a symbolic link to access the directory that should be accessible to the public (I'm using symfony, so that's a single directory - called web).

With this set up I get an "Access Forbidden" error. So I added a .htaccess file in my domain directory (/usr/www/users/(account name)/(domain directory) i.e. it's in the same folder as my symbolic link).

I now get an Internal Server Error, which I can't seem to brush off. The contents of my .htaccess file are:

AddDefaultCharset utf-8
AddType application/x-httpd-php5cgi .php

<VirtualHost *:80>
  DocumentRoot "/usr/home/username/domaindir/web"
  <Directory "/usr/home/username/domaindir/web">
   AllowOverride All
   Allow from All

Note: I used to have a passwd file in my web directory, which I removed in the hope of fixing the Access Forbidden problem.

Any help will be highly appreciated.
  • 4
  • 3
1 Solution

Options FollowSymLinks -SymLinksIfOwnerMatch

To your <Directory> container  (NOTE the minus in front of the 2nd option).
haidermosawiAuthor Commented:
m1tk4, I'm afraid it didn't work.

I'm not sure what's causing the error. I can see the symbolic link with my FTP program, and it directs to the right directory.

Is the directory format: "/usr/home/username/domaindir/web" correct?
the httpd user runs as a different user and if the directory in /usr/home has no read rights for the OTHERS category then it would given an error.

check the directory permissions to see if something is going wrong over there.

ftp would work as you would be logging in as the user himself
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

haidermosawiAuthor Commented:
I set the directory permission to 755, even on the symlink!

The file permission issue would cause the Access Forbidden (403) error, but not the Internal Server (500) error, right?

yes, you are correct.  check the httpd.conf to see if followsymlinks is turned on
haidermosawiAuthor Commented:
I'm on a shared host, so I don't have access to the httpd.conf file.

I'm sure there's an alternative solution. I've deployed this directory before and was able to view it normally, but now I'm not sure what went wrong..
haidermosawiAuthor Commented:
Ok, sorry, it's my mistake.

The parent directory of the web/ directory (which I wanted to make public) didn't have sufficient permissions. I now increased the permissions, and I can gain access to the directory.

Thanks m1tk4 and ygoutham!
you are welcome

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now