I have trying to set up an Apache site to use a folder in my home folder without any success. I exactly followed the steps in this page: https://help.ubuntu.com/community/ApacheMySQLPHP
yet I did not succeed; I keep getting error 403, which says that the server doesn't have permission to access the requested page. I searched forums and many suggested changing the permission of the folder. I went straight away and set the permission to 777
, but that didn't solve the problem.
I made another search and somebody gave me a clue, which is that it could be because my home folder is encrypted. I believe this could be the problem, but:
What is the relation between encryption and Apache? I suppose Apache server is requesting the file from the system, rather than trying to access the file bytes!
Is there anyway to solve this problem? I don't want to move the folder to /var/www
because I am using this Apache for testing, so I want whatever change I make to be immediately reflected, rather than having to copy files which is error prone.
What's in your error_log?
I don't think home folder encryption should be a problem. I have /var/www/ symlinked to locations in my home folder, and with
Options +FollowSymLinks
in the site config it works just fine.Just a couple quick notes - you can
sudo chgrp -R www-data <path>; sudo chmod -R g+a <path>
instead of setting permissions to 777 - this is a good habit in general and important if you're on a shared host.I'm not sure what you mean by "I want whatever change I make to be immediately reflected" but I'm guessing you mean keeping a working copy in /home and pointing Apache at /var/www - this isn't necessary/required. You can use
ln -s
like I've described above or point Apache directly at your home folder as you're trying to do.Once I wrote this in the next link and I hope this help you, the full thread can be reached by clicking on:
Change the default folder for PHP testing in Linux http://ultimateeditionisrael.freeforums.org/change-the-default-folder-for-php-testing-in-israel-remix-t600.html