Remove / Disable whm. subdomain

geetee

New Member
Hi,

I hope someone has an easy answer for this one.

I have a cPanel/WHM VPS and I am trying to remove just the subdomain for whm.mainserverdomain.com - forcing access only via port 2086/2087 - so I can access list port 2086/2087 in the firewall.

I want to leave the cpanel. webmail. subdomains functional.

I've been trying to do this with these 2 options in Tweak Settings in WHM:


1. Add proxy VirtualHost to httpd.conf to automatically redirect unconfigured cpanel, webmail, webdisk and whm subdomains to the correct port (requires mod_rewrite and mod_proxy)

2. Automatically create cpanel, webmail, webdisk and whm proxy subdomain DNS entries for new accounts. When this is initially enabled it will add appropriate proxy subdomain DNS entries to all existing accounts. (Use /scripts/proxydomains to reconfigure the DNS entries manually)



As soon as I uncheck the "unconfigured" option all the cpanel. and webmail. subdomains for all domains hosted stop working.

Obviously when I check it, whm.mainserverdomain.com comes back to life.

I have tried /scripts/proxydomains remove --domain=mainserverdomain.com and /scripts/proxydomains remove --subdomain=whm but all this seems to achieve is to remove the A records, leaving the apache rewrite directives active.

That means that all someone has to do is add a local hosts file entry to their machine for whm.mainserverdomain.com to be able to access WHM via port 80.

Commenting out the rewrites for whm. in httpd.conf solves it - but those changes are regularly overwritten automagically.

The comment in httpd.conf advises to amend the include file - but for the life of me I can't find where or which include file I need amend.

Any help or pointers gratefully received.

Many thanks
Graham
 
You can see which files are included where just by searching for "Include " in the main httpd.conf file. The files cPanel uses should be in /usr/local/apache/conf/includes

Personally, I just keep the whole config directory under version control and rollback any undesired changes whenever cPanel decides it wants to do something fancy.
 
Thanks.

There is nothing in any of the files in that directory, so all I can assume is that cPanel directly modifies httpd.conf and then distills it. Leaving no option but to have to edit httpd.conf directly to properly disable the whm. redirect.

I keep a backup anyway, but have never had to use it.

I'm thinking of implementing Tripwire anyway, so I can probably put httpd.conf under it's watch to alert me if it gets overwritten, saving a manual check job.

Just need to do some more research on Tripwire resource use etc. before committing to that.

Thanks again.
 
Hi geetee,

From the sound of it you just want to insure that logins to WHM are done with SSL? Doesn't the following option work for you?

In WHM -
Tweak Settings
Under Redirection check the box for "Always redirect users to the ssl/tls ports when visiting /cpanel, /webmail, etc.".

Then if you try to load whm.server.com it should tell you that SSL is required and give you a link.
 
Top