Nov 21, 2009

Permissions For Web - /home/blah/public_html Forbidden Access from WWW

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Operating Systems > Linux

Permissions For Web - /home/blah/public_html Forbidden Access from WWW

nightfox
I'm having some file permission problems. Whenever I try to access my home directory via the Internet I get a 403 Forbidden message. Except something on this message has caught my eye:
QUOTE

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


I'm not sure what that means other than there's a file permission problem SOMEWHERE.. Just incase this helps, here's what it is set:

The /home/blah/public_html folder owner is blah and group blah. I've even changed it over to apache for both. I've even got the folder CHMODed to 777, still "Forbidden".

What am I doing wrong here? I encountered this last summer but I forget what kind of "tinkering" was done to get it working correctly..

Thanks!

[N]F

Comment/Reply (w/o sign-up)

qwijibow
First off,,, chmod 777 is a security risk...
Some web browsers will treat any executable file as a CGI script.

(in other words, simple typing the url of an executable in the web browser will case the program to run)



The problem here is most likely your web server configureation.

The config file sets what is and what is not allowed.

Some web browsers by default do not allow directory browsing, They will show a 403 error if you attenmpt to view a folder, instead of showing the contents of that folder.

Read the config file, in most server config files, the documentation on how to edit the config file will be in comments inside the config file..

its usualy as simple as setting somthing like "ALLOW_DIRECTORY_BROWSING=NO" to "=YES"

Always Always check server config scripts, dont just assume that the default is the most secure.

Comment/Reply (w/o sign-up)

mastercomputers
Username directory should be chmod 701, public_html should be 701. The owner and group of the files, should still remain the Username.

If using SELinux, you'll also want to do chcon -R -t httpd_sys_content_t /home/Username/public_html

I've written some guides on here that may help you configure it even better, though specifically for Fedora distributions, it may yield some answers.


Cheers,


MC

Comment/Reply (w/o sign-up)

nightfox
SELinux is disabled wink.gif I know what kind of problems it can cause!

Ok, after following some instructions in httpd.conf, ~userid should have permissions of 711 and ~userid/public_html should have permissions of 755.

I got it to display web documents now, which is good. Directory listing still shows "403 Forbidden" which has its advantages and disadvantages.

I've looked through httpd.conf but I don't see anything about directory listings..

[N]F

Comment/Reply (w/o sign-up)

HellFire121
Usually CHMOD to 755, because if you CHMOD to 777 it will give an error saying that the directory is writable etc.

Comment/Reply (w/o sign-up)

mastercomputers
As long as your home is 701, and public_html is 705 that should be fine. Setting group permissions doesn't really do much for you unless you add users into your group who are allowed to alter files, if that's the case, you're better off creating a new group and another location in home for this to go, that way you don't need to allow people into your home folder.

Make sure in your httpd.conf you have:

CODE
<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>


This restricts the folder to readonly using the <Limit> and <LimitExcept>, you can remove these if you don't want it.

Make sure to restart apache when making changes to httpd.conf.

That is all I can think of at the moment as to why you can't read the directory. As long as read/execute exists in the permissions it should work.

Cheers,


MC

 

 

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : permissions, web, home, blah, public, html, forbidden, access, www

  1. Access Linux Box From Windows Machine- Putty Tool
    (2)
  2. Can't Access Root Anymore =(
    (5)
    I have installed ubuntu. and it worked to install.. but... =( I replaced the root user.. I
    don't know how =( I wanted to crete a new user as a book said(but I made it the same name as the
    root user (my root was named feelay, and I created a user named feelay) =( without thinking). But it
    didn't work. then i logged out and in again. And I tryed to create a user. and now it says "only
    a root user can create accounts". Please help =( Any Linux Guru. I am stuck =( And BTW .. When I
    made a partition, a had do change the system of my bigger partition (the D Partitio....
  3. Three Ways To Access Linux Partitions From Windows On Dual-boot Systems
    (11)
    If you have a dual-boot Windows/Linux system, you probably know this problem: you can access files
    from your Windows installation while you are in Linux, but not the other way round. This tutorial
    shows three ways how you can access your Linux partitions (with ext2 or ext3 filesystem) from within
    Windows: http://www.howtoforge.com/access-linux-par...ns-from-windows
    _________________________________ http://dserban01.googlepages.com/linkedin....abap.basis.html ....
  4. Remote Access
    (8)
    I need to access my computer from outside, via TELNET. Could you please tell me what to do. Which
    port do I need to open? My current distro: Fedore Core 4.....
  5. Web Browsing With Vim
    web browsing and html formatting (2)
    I saw this greate plugin for VIM for here. does anyone use it?
    http://www.vim.org/scripts/script.php?script_id=1053 description This plugin provides vim with
    web browsing and html formatting capabilities. It includes support for history, bookmarks, text
    highlighting and more. The main motivation is browsing documentation available in html, so don't
    expect to see any flash animation /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> The plugin is implemented using vim's ability to embed perl, so you will
    need to have a perl en....

    1. Looking for permissions, web, home, blah, public, html, forbidden, access, www

See Also,

*SIMILAR VIDEOS*
Searching Video's for permissions, web, home, blah, public, html, forbidden, access, www
advertisement



Permissions For Web - /home/blah/public_html Forbidden Access from WWW

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com