Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here is an excerpt of the deployment script I use to deploy php apps on my CentOS server.

echo "Starting Deployment to $SITE_FOLDER (Relase Directory: $RELEASE_DIR)..."
svn --username=$SVN_USER export $REPOSITORY $DEPLOY_FOLDER/releases/$RELEASE_DIR

echo "CHMOD 755 of Release Directory"
chmod 755 -R $DEPLOY_FOLDER/releases/$RELEASE_DIR

echo "Making Symbolic Link."
ln -nfs $DEPLOY_FOLDER/releases/$RELEASE_DIR/ $DEPLOY_FOLDER/public_html

I've used this in a similar environment with success. I'm setting this up on a new server and files apache was serving files fine from public_html before I deleted it.

Now that its serving via symlink, php files all throw 500 errors. non .php files are being served fine.

I've tried chowning the directory as different apache users and different permissions, but nothing seems to work. Any ideas? Thanks in advance for help!

share|improve this question
2  
You should post the contents of the apache error log. There should be something in there for the 500 errors. –  Swoogan Oct 22 '09 at 22:18

2 Answers 2

You need to add the FollowSymlinks directive, such as:

<Directory /usr/local/httpd/htdocs>
Options Indexes FollowSymLinks
</Directory>

See http://httpd.apache.org/docs/2.2/mod/core.html#directory

share|improve this answer
    
Good idea, but why would .txt files be served fine? Apache is seeing the directory just fine, I think its a php setting that is messed up. –  Tyler Oct 22 '09 at 21:48
    
Oh, I didn't catch that part. Looks like it's a php setting. What do the 500 errors produce in the logs? –  Swoogan Oct 22 '09 at 22:17

I had the same issue, suPHP was the culprit. Symlinks are always 777 and suPHP enforces 755 and will throw a 500 error.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.