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.

Restoring the public_html files?

Discussion in 'General Discussion' started by counting, Sep 2, 2007.

  1. counting

    counting Registered

    Joined:
    Jan 14, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi, the public html file was accidentally deleted from the cpanel, and I attempted to restore by the last known backup. I uploaded the backup, no results. I then moved the public_html file from the backup that was uploaded and am now getting a 403 error. Can anyone tell me what I am doing wrong and how to fix the problem?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,448
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Make sure the owner is set to yourusername:nobody and permissions are 0750

    HTH
     
  3. counting

    counting Registered

    Joined:
    Jan 14, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Where do I do that at? Sorry for the dumb questions! But I do appreciate any help I can get!

    This is the message I Am getting :"
    Forbidden
    You don't have permission to access /contact_us.shtml on this server.

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
     
    #3 counting, Sep 2, 2007
    Last edited: Sep 2, 2007
  4. night-fire

    night-fire Well-Known Member
    PartnerNOC

    Joined:
    May 3, 2007
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    Hello,
    Firstly I'd like to just let you know you have posted in the wrong section of this forum. However I reccomend changing the owner and group to its original owner:
    What you will need:
    SSH Access as root on the dedicated server/VPS:
    The accounts username (the one that no longer has public_html)
    All the backed up files ready to go.

    Ok Now Heres some steps to follow (you may have already done some of these)
    1. Login to SSH and eitehr login as root or SU into root
    2. cd /home/CLIENTHOME (CLIENTHOME = Clients Username)
    3. Check if there is a public_html directory (dir, ls, ll either of this will show you)
    4. If there is type ls -asl to see if the folders are all owned by the respective account holder
    5. If there is any folders that are owned and group owned by root type: chown USERNAME FOLDER (Username = Clients Username) and then chgrp USERNAME FOLDER
    6. To make sure all files are owned by the User type the following as well chown USERNAME FOLDER/* (Username = Clients Username) and then chgrp USERNAME FOLDER/*
    7. Try checking the site.
    This should fix the issue. don't chmod stuff unless it needs to be! this can lead to security issues.
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,448
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:

    The easiest way IMHO, is to install this. http://www.configserver.com/cp/cse.html
    You will need SSH access for that but the install is quite easy, chirpy gives you the exact commands to run there. Once you have it installed access it via WHM and you can check these files/directories quick and easy.

    If the files inside your public_html are all setup ok, and its just a matter of changing ownership and perms on the public_html directory itself, using CSE will work fine.

    You can get into trouble using CSE, but I think a lot less trouble than running commands on full directories if you're not sure how to do that.
     
Loading...

Share This Page