Sunday, 9 December 2012

Setting up a symlink on apache and Ubuntu

I'm starting a client project which uses LAMP stack. However, instead of putting the source file in /var/www, I wanted to create a symlink in that directory that brings me to the actual source directory. So first thing I did was:
ln -s ~/repo/socialworkportal /var/www
Pretty standard stuff. However when I tried to hit the path localhost/socialworkportal it gave me a forbidden error. Then I thought it was an issue with the permission -- after all the dir /var/www had root:root permissions. Okay, then I did this:
cd ~/repo && chgrp root socialworkportal
Still didn't work! Solution: So apparently Apache needs execute rights to the path of your directory, so something like this was needed: chmod o+rx /home/me /home/me/repo Hope that helps! Reference for chmod: http://www.washington.edu/doit/Newsletters/Jul97/15.html

No comments:

Post a Comment