I want to have a folder in my home directory on my website. I tried symlinking with a symlink in the root of my httpd and I set the folder to a+rx... When I access the folder on the website, I get a forbidden message... What's wrong?
There is a feature in apache which allows people to access a given user's stuff via http://your_website/~username/ . You can get this to work by making a folder in your home directory called "public_html" . Make sure your home directory is exectuable by all, so "chmod 0771 ~" would be fine. Then also make sure that your ~/public_html directory is readable and executable by all..so "chmod 0775 ~/public_html" would work.
Now enabling it in the apache config file. Make sure the following lines/sections exist and are not commented out:
LoadModule userdir_module lib/apache/mod_userdir.so
This one is to enable the apache module for this.
<Directory /home/*/public_html> AllowOverride FileInfo AuthConfig Limit Indexes Options All Includes ExecCGI <Limit GET POST OPTIONS PROPFIND> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS PROPFIND> Order deny,allow Deny from all </LimitExcept> </Directory>
And this is a directory entry to make all the user's directories accessible with whatever options you want to put in there (see apache manual).
Now just (re)start apache to get the new config loaded, throw whatever you want to in ~/public_html, then visit http://127.0.0.1/~yourusername/fileyouwant , to test it out.
Best of luck and I hope this helps.
The suggestion box only accepts patches.
On an arch system 771 isn't exactly the best idea. Everyone shares the same group, so anyone would be able to write to your home dir. Try 711. Same thing with ~/public_html, 755.
I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal