Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Dec 2009
    Posts
    37

    Default forbidden page

    I changed my document root for an account to /disk2/username/public_html but now i just get a 403 forbidden page when trying to view it

    Here is what my httpd.conf looks like only a little modified to show here
    Code:
    <VirtualHost xxx.xxx.xxx.xxx:80>
        ServerName domain.com
        ServerAlias www.domain.com
        DocumentRoot /disk2/username/public_html
        ServerAdmin webmaster@domain.com
        UseCanonicalName Off
        CustomLog /usr/local/apache/domlogs/domain.com combined
        CustomLog /usr/local/apache/domlogs/domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
        ## User username # Needed for Cpanel::ApacheConf
        <IfModule mod_suphp.c>
            suPHP_UserGroup username username
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            SuexecUserGroup username username
        </IfModule>
        ScriptAlias /cgi-bin/ /disk2/username/public_html/cgi-bin/
    
    
    
        # To customize this VirtualHost use an include file at the following location
        # Include "/usr/local/apache/conf/userdata/std/2/username/domain.com/*.conf"
    
    </VirtualHost>
    Im really not sure if I missed a step or am just missing something but help would be really appreciated

  2. #2
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    Did you check the permissions for the document root mentioned above? Ideally, the permissions for username should be 711 and public_html should be 750.

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2003
    Location
    NC
    Posts
    725
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Check out the apache error log and see what it says, that should point you in the right direction of what to fix.

    /usr/local/apache/logs/error_log

  4. #4
    Member
    Join Date
    Dec 2009
    Posts
    37

    Default

    Quote Originally Posted by eth00 View Post
    Check out the apache error log and see what it says, that should point you in the right direction of what to fix.

    /usr/local/apache/logs/error_log
    [Sat Jan 02 22:31:44 2010] [crit] [client xxx.xxx.xxx.xxx] (13)Permission denied: /disk2/username/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

    This is what it says although .htaccess doesnt even exist anywhere, anyone know a guide on how to change the document root cause even cpanel is showing the wrong one in file manager after updating the httpd.conf file and restarting apache :/

  5. #5
    Member
    Join Date
    Jan 2008
    Posts
    141

    Default

    Please make sure that the .htaccess file is present in your domain and assigned it to 755 permission and also make sure that you have assigned the appropriate ownership to the .htaccess file.

    Moreover, you can also refer to below mentioned URL which might helps you to solve your issue:

    How to solve “.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable” - Techie Corner

  6. #6
    Member
    Join Date
    Dec 2009
    Posts
    37

    Default

    no luck there :/

  7. #7
    Member linux7802's Avatar
    Join Date
    Dec 2007
    Posts
    224
    cPanel/Enkompass Access Level

    Root Administrator

    Default Solution

    It seems to be that ownership is incorrect.Onwership for your document need to be

    chown user.nobody public_html
    Regards,
    G R Sonar
    cPanel Hosting Blog

  8. #8
    Registered User
    Join Date
    Sep 2008
    Posts
    4

    Default

    What permissions have you set for the document root directory ?

    ls -ld /disk2/username/public_html

  9. #9
    Member
    Join Date
    Dec 2009
    Posts
    37

    Default

    Quote Originally Posted by linuxbabu View Post
    What permissions have you set for the document root directory ?

    ls -ld /disk2/username/public_html
    drwxr-x--- 17 root root 4096 Jan 3 16:08 /disk2/user/public_html/

    edit* it was perms i set to 711 and its working thanks although how come file manager still uses home/user and not the disk2/user? how can i change this? even ftp is doing this
    Last edited by Potato; 01-04-2010 at 04:08 PM.

  10. #10
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    drwxr-x--- 17 root root 4096 Jan 3 16:08 /disk2/user/public_html/
    Change the ownership of that folder to user.nobody .

    Code:
    chown user.nobody /disk2/user/public_html

  11. #11
    Member
    Join Date
    Dec 2009
    Posts
    37

    Default

    Quote Originally Posted by InstaCarma_Tech View Post
    Change the ownership of that folder to user.nobody .

    Code:
    chown user.nobody /disk2/user/public_html
    chown: `user.nobody': invalid user

  12. #12
    Member linux7802's Avatar
    Join Date
    Dec 2007
    Posts
    224
    cPanel/Enkompass Access Level

    Root Administrator

    Default Solution

    Quote Originally Posted by Potato View Post
    chown: `user.nobody': invalid user
    Do not run chown user.nobody public_html

    you need to replace user name as per your cPanel user name.For example if cPanel user name is tester than run following command

    chown tester.nobody public_html

    Best of luck
    Regards,
    G R Sonar
    cPanel Hosting Blog

Similar Threads & Tags
Similar threads

  1. Reseller Forbidden
    By arielg in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-07-2009, 03:55 AM
  2. Apache forbidden page
    By jimmy1987 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-09-2008, 06:00 PM
  3. add forbidden page [moved]
    By Scott45 in forum New User Questions
    Replies: 4
    Last Post: 05-12-2006, 08:39 AM
  4. Forbidden?
    By Final-Solution in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-21-2004, 03:34 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube