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.

Rename /www/?

Discussion in 'General Discussion' started by GoWilkes, Apr 20, 2010.

  1. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Maybe a simple question, I've just never done it before.

    Can I simply rename /www/ to something else (like /www-old/), and then create a new /www/ directory? I'm about to make a new site live, and this would be a lot easier and faster than downloading everything, deleting it from the server, and then re-uploading the new site.

    TIA,

    Jason
     
  2. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Nevermind, I figured it out for myself :)

    For anyone reading this in the future, rename /public_html/ to something else (like /public_html-old/), then create a new /public_html/ and chmod to 751.

    The /www/ directory is a symbolic link, so don't delete that. If you do, you'll need to recreate the link via SSH by typing:

    ln -s public_html www
     
    cPanelDon likes this.
  3. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    What you have found and described is very much on-target. :)

    For reference, if the new directory and or symlink is created via root SSH access it should also be checked to ensure it has proper ownership, that of the cPanel account username and not owned by root; the following commands using "stat" will display detailed information for the directory, file, or symlink located at the specified path:
    Code:
    # stat /home/$username/public_html
    # stat /home/$username/www
    Note: On FreeBSD, consider adding the CLI switch "-x" when using "stat" (e.g., "stat -x /full/path"); this will cause the output to appear very similar to what is displayed on a Linux system, such as RHEL or CentOS.

    Typically, the directory "public_html" may have access permissions of chmod value 0750 and ownership of $username:nobody while the symbolic link (symlink) "www" should always have ownership of $username:$username; however, if a correction is needed you may use the following examples as a guide to modify the access permissions and ownership via root SSH access:
    Code:
    # chmod -v 0750 /home/$username/public_html
    # chown -v $username:nobody /home/$username/public_html
    # chown -hv $username:$username /home/$username/www
    Note: On FreeBSD, for more detailed (i.e.,, very verbose) output, append a second "v" to the CLI options of both "chmod" and "chown" (e.g., "chmod -vv", "chown -vv", and "chown -hvv").

    When using the utility "chown" please note that the CLI switch "-h" is needed only when modifying ownership of a symbolic link (symlink).
     
    #3 cPanelDon, Apr 21, 2010
    Last edited: Apr 21, 2010
Loading...

Share This Page