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!

Remove Apache ServerAlias setting for mail.domain.tld?

Discussion in 'EasyApache' started by thowden, May 16, 2018.

  1. thowden

    thowden Member

    Joined:
    May 17, 2013
    Messages:
    10
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    Hi All

    Reviewing the Apache configuration on a server WHM 70.x I noted that the httpd.conf file includes ServerAlias setting for "mail.clientdomain.tld" even when the DNS explicitly is set for remote mail and the "mail" host record is pointed to an external server / service IP address or cname.

    My understanding is that Apache will never respond to that ServerAlias.

    Looking at the Apache template:

    /var/cpanel/templates/apache2_4/ssl_vhost.default

    the values are populated from %vhost.serveralias_array variable and that I guess is populated from the account create process with a new account.

    Is there a method to change the setup so that the "mail." entry is removed from the Apache config ?

    Thanks

    Tony
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,903
    Likes Received:
    1,814
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello Tony,

    First, you'll want to exclude the "mail" alias from the AutoSSL system using the SSL/TLS Status option in cPanel:

    SSL TLS Status - Version 70 Documentation - cPanel Documentation

    You can then setup "mail.domain.tld" using the Subdomains option in cPanel. This automatically generates a separate virtual host for the "mail" subdomain and removes the existing "mail.domain.tld" entry from the ServerAlias line in the previous Virtual Host it was a part of. You can then update it's DNS record to suit your preference.

    If you'd like to disable mail as a serveralias entry at creation time for new domain names, then you'd need to follow the steps referenced on the following thread:

    Disable default www entry for all subdomains and hostname

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice