Internal Server Error when accessing page through symbolic link

Posted on 2007-07-29
Last Modified: 2010-03-04

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.
Question by:haidermosawi
    LVL 15

    Expert Comment


    Options FollowSymLinks -SymLinksIfOwnerMatch

    To your <Directory> container  (NOTE the minus in front of the 2nd option).

    Author Comment

    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?
    LVL 14

    Accepted Solution

    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

    Author Comment

    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?

    LVL 14

    Expert Comment

    yes, you are correct.  check the httpd.conf to see if followsymlinks is turned on

    Author Comment

    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..

    Author Comment

    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!
    LVL 14

    Expert Comment

    you are welcome

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
    It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now