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.

webmail subdomain doesn't work

Discussion in 'E-mail Discussions' started by C4talyst, Oct 11, 2009.

  1. C4talyst

    C4talyst Well-Known Member

    Joined:
    Jun 21, 2008
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I have a fresh install of WHM/cPanel with one domain moved to it for testing. All seems well with our implementation, however, when you try to hit webmail.example.com, we get the default cPanel Apache page that says:

    Great Success !
    Apache is working on your cPanel® and WHM™ Server

    Anyone know what could be causing this?
     
  2. C4talyst

    C4talyst Well-Known Member

    Joined:
    Jun 21, 2008
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    This is resolved, I just needed to check the following option under "Tweak Settings":

    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)
     
  3. saninfosys.com

    Joined:
    Oct 4, 2009
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    While not the best method for accessing webmail, webmail.example.com (which only uses port 80) is acceptable as of version 11.23 of cPanel/WHM when the aforementioned tweak setting is enabled.
     
  5. InstaCarma_Tech

    InstaCarma_Tech Well-Known Member

    Joined:
    Apr 22, 2009
    Messages:
    228
    Likes Received:
    1
    Trophy Points:
    18
    1. Create an ‘A’ record for the sub-domain ‘webmail’ in the DNS zone file. It should look like :

    domain.com. IN A XX.XX.XXX.XXX
    localhost.domain.com. IN A 127.0.0.1
    domain.com. IN MX 0 domain.com.
    mail IN CNAME domain.com.
    www IN CNAME domain.com.
    ftp IN A XX.XX.XXX.XXX
    cpanel IN XX.XX.XXX.XXX
    whm IN A XX.XX.XXX.XXX
    webmail IN A XX.XX.XXX.XXX
    webdisk IN A XX.XX.XXX.XXX

    2. Put the following code inside .htaccess in the sub-domain folder ( virtual sub-domain which doesn’t have an entry in httpd.conf

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail.domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.webmail.domain.com$
    RewriteRule ^.*$ “http\:\/\/domain\.com\/webmail” [R=301,L]
     
  6. fevangelou

    fevangelou Member

    Joined:
    Oct 10, 2010
    Messages:
    20
    Likes Received:
    3
    Trophy Points:
    3
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I have found that the webmail.domain.tld redirect to domain.tld:2095 (the webmail port of cPanel) may not work as well.

    So here's a simpler .htaccess rule which you can set at the root of a cPanel account so it can affect all addon domains and best of all, it does not have a hardcoded domain on it :)

    Code:
    # Redirect webmail.domain.tld to domain:2095 for cPanel Webmail only
    RewriteCond %{HTTP_HOST} ^webmail\.(.+)$ [NC]
    RewriteRule ^(.*)$ http://%1/webmail/$1 [R=301,L]
    
    This will make sure webmail.domain.tld is redirected to domain.tld/webmail which in turn cPanel will push to domain:2095 - aka your webmail login. :)

    Enjoy!
     
Loading...

Share This Page