The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

forbidden page

Discussion in 'General Discussion' started by Potato, Dec 31, 2009.

  1. Potato

    Potato Active Member

    Joined:
    Dec 7, 2009
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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. InstaCarma_Tech

    InstaCarma_Tech Well-Known Member

    Joined:
    Apr 22, 2009
    Messages:
    228
    Likes Received:
    1
    Trophy Points:
    18
    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. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    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. Potato

    Potato Active Member

    Joined:
    Dec 7, 2009
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    [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. thewebhostingdi

    thewebhostingdi Well-Known Member

    Joined:
    Jan 10, 2008
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
  6. Potato

    Potato Active Member

    Joined:
    Dec 7, 2009
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    no luck there :/
     
  7. linux7802

    linux7802 Well-Known Member

    Joined:
    Dec 14, 2007
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Solution

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

    chown user.nobody public_html
     
  8. linuxbabu

    linuxbabu Registered

    Joined:
    Sep 13, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    What permissions have you set for the document root directory ?

    ls -ld /disk2/username/public_html
     
  9. Potato

    Potato Active Member

    Joined:
    Dec 7, 2009
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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
     
    #9 Potato, Jan 4, 2010
    Last edited: Jan 4, 2010
  10. InstaCarma_Tech

    InstaCarma_Tech Well-Known Member

    Joined:
    Apr 22, 2009
    Messages:
    228
    Likes Received:
    1
    Trophy Points:
    18
    Change the ownership of that folder to user.nobody .

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

    Potato Active Member

    Joined:
    Dec 7, 2009
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    chown: `user.nobody': invalid user
     
  12. linux7802

    linux7802 Well-Known Member

    Joined:
    Dec 14, 2007
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Solution

    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 :)
     
Loading...

Share This Page