1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[ASK] Rename /cpanel or /WHM become /newname

Discussion in 'General Discussion' started by b0y, Aug 11, 2011.

  1. b0y

    b0y New Member

    Joined:
    Aug 11, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    hello. i'm new user on here.
    i'm just want ask. can we rename cpanel login url for security reason
    from default url
    http://mydomain.com:2086/ or http://mydomain.com:2082/ or http://mydomain.com/cpanel/ or http://mydomain.com/whm/

    become

    http://mydomain.com/newname/ or http://mydomain.com:newport/
     
  2. JerrySmith

    JerrySmith Member

    Joined:
    Apr 21, 2011
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    This is currently not possible to my knowledge.

    I would suggest creating a feature request. If there is enough interest in your request from the community, it may be implemented in a future release of cPanel.

    Feature Requests for cPanel and WHM
     
  3. cPanelTristan

    cPanelTristan Active Member
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,621
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    You can change the cPanel port in /var/cpanel/cpanel.config file. Search for this line:

    Code:
    port=2082
    If you change it to 3050, for example, then 3050 will work for http and 3051 will work for https for cPanel access. After changing the port, then run these two commands for it to take effect:

    Code:
    /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings
    /etc/init.d/httpd restart
    I would suggest disabling non-secure cPanel and WHM access entirely, though. You can do that in WHM > Tweak Settings > Require SSL option by having it set to "On"

    For WHM, I am not aware of an option to modify the WHM port, although it might be possible to setup iptables routing rules to do so.

    Finally, for the /whm and /cpanel urls, you could remove those in /usr/local/apache/conf/httpd.conf file and distill it to preserve the changes. The lines will look similar to the following:

    Code:
    ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
    ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
    At that point, run the following to have the changes updated:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    If you remove those options and change the cPanel port, then cPanel will only be accessible using the ports defined if proxy subdomains do not exist. If you remove the /whm option, then you will only be able to access WHM using the 2086 and 2087 ports, since those ports aren't changeable. You could, though, setup WHM > Host Access Control for whostmgrd and prevent access to WHM for any IP(s) other than your own.

    I did want to mention one more point for the ScriptAliasMatch urls I mentioned above:

    Code:
    ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
    ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
    If you notice, the cPanel one uses redirect.cgi, the webmail one uses wredirect.cgi and the whm one uses whmredirect.cgi for the matching redirect. If you want to change the cpanel, webmail and whm urls, you can change them here to something else in httpd.conf and distill those changes. The only caveat is that you cannot get the cpanel one to work upon changing it if you've also changed the port number, so I simply suggest removing the cPanel redirection one if you will be changing the port number. You could, though, change the webmail and whm ones, so you end up with:

    Code:
    ScriptAliasMatch ^/?lisa/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
    ScriptAliasMatch ^/?bart/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
    Then webmail will be available on domain.com/lisa and whm will be available on domain.com/bart instead for this example. You'd want to pick whatever works best for you.

    Again, you'd then run these commands for that to take effect:

    Code:
    /usr/local/cpanel/bin/apache_conf_distiller --update
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
     

Share This Page