Results 1 to 3 of 3

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

  1. #1
    b0y
    b0y is offline
    Registered User
    Join Date
    Aug 2011
    Posts
    1

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

    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. #2
    Registered Member
    Join Date
    Apr 2011
    Posts
    35

    Default Re: [ASK] Rename /cpanel or /WHM become /newname

    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. #3
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    7,609
    cPanel/WHM Access Level

    Root Administrator

    Default Re: [ASK] Rename /cpanel or /WHM become /newname

    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
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Technical Analyst III, Forums Specialist, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads

  1. Rename cpanel or WHM
    By truls1502 in forum General Discussion
    Replies: 0
    Last Post: 03-29-2013, 05:13 AM
  2. [Case 44974] Ability to copy and rename databases in cPanel and WHM
    By anton_latvia in forum Database Discussions
    Replies: 39
    Last Post: 12-22-2010, 05:08 PM
  3. WHM Server Rename
    By Matty in forum General Discussion
    Replies: 2
    Last Post: 03-17-2010, 05:46 PM
  4. how do I rename and upload a cPanel theme?
    By Westone Hosting in forum General Discussion
    Replies: 1
    Last Post: 05-26-2009, 10:52 AM
bargain