A 403 Forbidden error
I am trying to setup a virtual host on my machine using Apache 2.0, but I keep getting this errorr:
You don't have permission to access /~motapa/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
I chmod-ed my home folder to 777 an even tried 'chmod +x /home'. What am I missing?
I am using red hat enterprise linux 4.
You probably have to alter a few lines in the apache config file to allow access to users home directories. I can't remember which lines you have to change, but you should be able to find it quickly enough on google.
Make sure you have the "UserDir" module enabled and that the /home/user and /home/user/public_html directories have permissions of 755.
I have enabled the UserDir and changed VirtualServerName to 127.0.0.1 and also the Virtualhost to 127.0.0.1 but still get the error. I changed the permission to the directories to 755,but to no avail.
This is what my apache script looks like. By the way does any one know where to find selinux docs, and how to chagne them.
# DocumentRoot "/home/motapa/public_html"
ServerAlias motapa.com *.motapa.com
CustomLog logs/motapa.com-access_log common
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ScriptAlias /cgi-bin/ "/home/motapa/public_html/cgi-bin"
Allow from all
DirectoryIndex index.html index.htm index.php index.cgi
You do realize that when you enable home dirs in Apache you potential expose them to several security threats. Especially if you do not require an index file and allow browsing, if they do not have an index file their entire home dir is now on the web including sensitive files such their fetchmail configuration, if they store passwords then those files are exposed and a whole lot of other nasties that can happen.
I suggest instead doing this. Put a link in their home dir to a dir in the document root that you give ownership to them of. To them it looks like it is in their home dir. To the web server it is part of the normal document structure. This is far more secure and saves you issues with trying to use home dirs.
Then you can create your virtual server. Which at a glance looks fine as long as the dirs listed in your apache config file are exactly correct.
What I suggest is to su to the user in a console window. Then copy and paste exactly what is in Apache.conf and do an ls on it. If you have any typos in the dir structure you'll get an error or if you have any permission errors you'll get zapped.
Next if you have troubleshootd running you may need to add a policy that allows access. A quick test is to disable SELinux and try it. If it works then you need to add a policy.
No one has been able to fix this problem? I have the same problem with some servers. I am really tired of trying to find the cause. Does anyone know? I have even tried editing the website with expression and you can do everything you want except save! The error message is 403 Forbidden
Forbidden You don't have permission to access /_vti_bin/_vti_aut/author.exe on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache/1.3.37 Server at www.xxxxxx.com Port 80
So... who out there can explain this problem. The server administrators can't figure it out either. I have many sites on shared servers.. none of them work.