Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just getting my webserver up and running and thought i'd setup the user directories (so i can do testing before putting it on live)... But when I go to see these pages i get a 403 (Permission Denied)....
The rest of Apache/PHP is working fine, juust not the user directories...
Does anyone know how to fix this? (oh BTW i'm using Apache 2.0.48)
Do you have any files in the directories at all? Usually it will deny file indexing by default so you'll need a default index file in there, or just place something like this in your httpd.conf file:
Code:
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<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>
You don't necessarily need all of that, but it might give you an idea of what to put, etc.
K well I tried that but it still doesn't let me get to it... I also tried changing permissions to full read/write on the directory but that didn't work either...
Originally posted by AMMullan K well I tried that but it still doesn't let me get to it... I also tried changing permissions to full read/write on the directory but that didn't work either...
Any other ideas?
And you do have an index.html file in the directory? And after making your changes to httpd.conf, you retarted apache afterwards?
Well, the only other thing I can think of with a 403 permission denied is that you didn't change the permissions on your files, directories, etc that you wanted accessed from apache.
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<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>
=========================================================
I've never been able to get this going - on either RH9 or FC1... Dunno if there's something missing in the conf but from what I see it should work (have setup Apache servers for highschools in the past and they worked fine)....
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<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>
=========================================================
I've never been able to get this going - on either RH9 or FC1... Dunno if there's something missing in the conf but from what I see it should work (have setup Apache servers for highschools in the past and they worked fine)....
Originally posted by Lleb_KCir chmod -R 755 /path/to/www/directory
you need 755 permissions for the public to view your web page, that also includes LAN only web pages.
I had already done that. Actually my first post was a bit overkill. AFter you set up the permissions correctly like you said above you need to set up selinux so that it's accessable. Disabling selinux really should not be the way to fix the problem. The folling command is what you would use for this circumstance.
chcon -R -h -t httpd_sys_content_t /home/<your home directory>/public_html
Then after using the -Z switch on ls you can see that the public_html directory has rights for httpd
ok do you need to do all of that if you are behind a firewall?
on my web server i chown root:user the www directory (i put all of the web domains in that directory) and adjusted the permissions appropriatly. i am not running selinux just a whitebox3 fully patched as of about 5min from now (except the kernel) not running iptables or selinux. (ok make that as of now, just finished the yum update program program...)
is there a need to do the extra steps you have listed there on a system like that? yes it is an extrenal hardware firewall.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.