Change default subdomain for webmail to mail

Scottnl

Registered
Oct 14, 2014
3
0
1
cPanel Access Level
Root Administrator
Hallo All,

This is my first post and straight away it's a question. By default the subdomain webmail.domain.com redirects to the email services. Is there any way to change this to mail.domain.com. The same goes for cpanel and whm. Ive looked everywhere but could not find anything on this matter.

Scott
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello :)

These entries are stored in the following file:

Code:
/var/cpanel/templates/apache2/main.default
You will need to copy this file to the following name:

Code:
/var/cpanel/templates/apache2/main.local
Note that the "apache2" part of the path may change, depending on the version of Apache installed on your system. Next, edit the newly copied local file to the modified values of your preference, save the file, and run the following commands:

Code:
/usr/local/cpanel/bin/apache_conf_distiller --update
/usr/local/cpanel/bin/build_apache_conf
/scripts/restartsrv_httpd
Thank you.
 

Scottnl

Registered
Oct 14, 2014
3
0
1
cPanel Access Level
Root Administrator
Thanks Michael for your answer.

I copied the file to main.local. There are a few places that you can replace webmail. Do you replace all of them or just the ones in the RewriteCond?

I'm pretty new to Cpanel and don't want to make mistakes.

Scott
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Yes, you must update the Rewrite rules and the ServerAliases entries to the updated names of your choosing.

Thank you.
 

Scottnl

Registered
Oct 14, 2014
3
0
1
cPanel Access Level
Root Administrator
I replaced webmail to mail and cpanel to server.

I also ran these scripts

Code:
/usr/local/cpanel/bin/apache_conf_distiller --update
/usr/local/cpanel/bin/build_apache_conf
/scripts/restartsrv_httpd
I am still redirected to default webpage. Am i missing something?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
It's likely you did not correctly edit the /var/cpanel/templates/apache2/main.local file. Could you provide an example of the changes you made?

Thank you.