I want to redirect port 2096 to client /webmail


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Email » Webmail Clients

I want to redirect port 2096 to client /webmailLast Modified: Sep 7, 2019, 10:54 pm
If imported cPanel Users are trying to go to theirdomain.com:2096 to access webmail, you can setup Apache to redirect that back to https://theirdomain.com/webmail.

We'll assume you're running plain apache for this example.  Other webservers can use this strategy/template system, but not covered here.

  1. Tell Apache to listen on this port. Edit

    /etc/httpd/conf/extra/httpd-includes.conf

    and add one line of code

    Listen 2096

    DirectAdmin will not overwrite this file, changed in there are safe.
  2. Add a https:2096 VirtualHost to each domain.  For this we make use of the Global pre-post CUSTOM token templates.   Create the file:

    /usr/local/directadmin/data/templates/custom/virtual_host2_secure.conf.CUSTOM.4.post

    and insert the following code:

    </VirtualHost>
    <VirtualHost |IP|:2096>
           SSLEngine on
           SSLCertificateFile |CERT|
           SSLCertificateKeyFile |KEY|
           |CAROOT|
           ServerName www.|DOMAIN|
           ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
           Redirect 301 / https://|DOMAIN|/webmail

    where you might notice the VirtualHost tags seem out of order, but this is correct, since we're inserting it into the the end of the CUSTOM4 token in virtual_host2_secure.conf, which is within the 443 VirtualHost, hence we end it first, and start a new one, and let the virtual_host2_secure.conf close our new VirtualHost.
  3. Then rewrite the configs to push the change to all domains:

    cd /usr/local/directadmin/custombuild
    ./build update
    ./build rewrite_confs


© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST