Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

SOLVED Remove domain.com/cPanel & WHM URL

Discussion in 'General Discussion' started by Sametto Chan, Aug 21, 2017.

  1. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
  2. Eminds

    Eminds Well-Known Member

    Joined:
    Nov 10, 2016
    Messages:
    204
    Likes Received:
    12
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    are you on a dedicated server with root access or in a shared hosting environment ?
     
  3. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm on VPS Server for self-managed. It's fully root access.

    Anyone still knows there?
     
    #3 Sametto Chan, Aug 21, 2017
    Last edited by a moderator: Aug 22, 2017
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,080
    Likes Received:
    1,364
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The instructions in the links you provided were intended for systems using EasyApache 3. With EasyApache 4, you'd have to follow the instructions below:

    1. Copy the Apache 2.4 template for EasyApache 4 to allow for customization:

    Code:
    cp -a /var/cpanel/templates/apache2_4/ea4_main.default /var/cpanel/templates/apache2_4/ea4_main.local
    2. Edit /var/cpanel/templates/apache2_4/ea4_main.local to change the entries to match your preferences:

    Code:
    vi /var/cpanel/templates/apache2_4/ea4_main.local
    For instance, if you wanted to disable the /cpanel alias, you'd remove this line when editing the file:

    Code:
    ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    3. Rebuild the Apache configuration file:

    Code:
    /scripts/rebuildhttpdconf
    Keep in mind the ".local" template takes precedence over the ".default" template. You will have to manually update the ".local" template every time a new default template is issued. As of cPanel 64.0.19, notifications are sent when the EA4 default templates are updated and a local template file exists:

    Fixed case CPANEL-12933: Notify admins of EA4 template changes if .local versions exist.

    Thank you.
     
    Sametto Chan likes this.
  5. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thank you!

    I'm on EA4 and v66.0.14 current version.

    1,2 number question. Is it on SSH for root access right? Or SFTP.

    Answer another my two question,

    2.
    Code:
    cp -a /var/cpanel/templates/apache2_4/ea4_main.default
    [root@x ~]# cp -a /var/cpanel/templates/apache2_4/ea4_main.default
    cp: missing destination file operand after ‘/var/cpanel/templates/apache2_4/ea4_main.default’
    Try 'cp --help' for more information.
    
    Looks like are not working command line.
     
    #5 Sametto Chan, Aug 22, 2017
    Last edited by a moderator: Aug 22, 2017
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,080
    Likes Received:
    1,364
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You'd use SSH as "root" with these instructions.

    That's not the full command referenced in my response. It's:

    Code:
    cp -a /var/cpanel/templates/apache2_4/ea4_main.default /var/cpanel/templates/apache2_4/ea4_main.local
    Thank you.
     
    Sametto Chan likes this.
  7. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    Code:
    <IfModule alias_module>
        ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
        ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
        ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
        ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
        ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
        ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi
        ScriptAliasMatch ^/?webmail$ /usr/local/cpanel/cgi-sys/wredirect.cgi
        ScriptAliasMatch ^/?webmail/ /usr/local/cpanel/cgi-sys/wredirect.cgi
        ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
    [% IF autodiscover_proxy_subdomains -%]
        ScriptAliasMatch ^/Autodiscover/Autodiscover.xml /usr/local/cpanel/cgi-sys/autodiscover.cgi
        ScriptAliasMatch ^/autodiscover/autodiscover.xml /usr/local/cpanel/cgi-sys/autodiscover.cgi
    [% END -%]
    
        Alias /bandwidth /usr/local/bandmin/htdocs/
        Alias /img-sys /usr/local/cpanel/img-sys/
        Alias /java-sys /usr/local/cpanel/java-sys/
        Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
        Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
        Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/
    
        ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/
        ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/
        [% IF file_test('f', '/usr/local/cpanel/cgi-sys/scgiwrap') %]ScriptAlias /scgi-bin /usr/local/cpanel/cgi-sys/scgiwrap[% END %]
    </IfModule>
    
    1. Can I remove WHM and cPanel, Webmail?

    2. But What about kPanel?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,080
    Likes Received:
    1,364
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can remove any of those "ScriptAliasMatch" if you want to disable the use of those aliases.

    Thank you.
     
  9. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    Also, Can I remove autodiscover Proxy_domains too?

    I can't enter "Backspace" remove of lines in SSH for vi, Possible for nano?
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,080
    Likes Received:
    1,364
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You can use the text editor of your preference (e.g. nano, vim).

    Yes, but keep in mind that will prevent the use of the autodiscover subdomain.

    Thank you.
     
  11. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    Alright, Also I'll use SFTP to edit that file? Or just only on SSH nano?
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,080
    Likes Received:
    1,364
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Yes, you could download the file via SFTP, edit it, and then upload the new copy.

    Thank you.
     
  13. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    Doesn't work. I removed lines then restarted httpd.conf say OK. I checked site.com/cpanel and whm still up.

    Code:
    [root@x ~]# /scripts/rebuildhttpdconf
    Built /etc/apache2/conf/httpd.conf OK
    
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,080
    Likes Received:
    1,364
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Try clearing your browser cache or testing from another browser to make sure you are not visiting a cached URL.

    Thank you.
     
  15. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    I cleared cache browser said still WHM and cPanel up. I'll use chrome incognito said same too. Another I'll use Firefox browser said same too.
     
  16. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,080
    Likes Received:
    1,364
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    This is working well on a test server. It's possible you made some incorrect changes to the ea4_main.local file. Could you open the /var/cpanel/templates/apache2_4/ea4_main.local file on the server using the "vi" command? EX:

    Code:
    vi /var/cpanel/templates/apache2_4/ea4_main.local
    Does it look formatted correctly? You will sometimes face encoding issues when editing a file on a Windows-based machine and then uploading it directly via SFTP.

    Thank you.
     
  17. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    I did just nano from SSH has saved file then httpd.conf is restarted but nothing.
    Screenshot_1.png
     
  18. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,080
    Likes Received:
    1,364
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look to see why it's not working.

    Thank you.
     
  19. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    Support ticket ID: 8806225
     
  20. Sametto Chan

    Sametto Chan Well-Known Member

    Joined:
    Jun 24, 2016
    Messages:
    233
    Likes Received:
    22
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    It is fixed! Thanks to cPanel support!

     
    cPanelMichael likes this.
Loading...

Share This Page