change url webmail

marcossaoleo

New member
Joined
Oct 10, 2019
Messages
2
I need to change the path of my webmail.
ex:
domain.com/webmail -> webmail.domain.com

domain is on 2 servers, so i have 2 webmail too.

server 1: webmail.domain.com (correct, email only)
server 2: domain.com/webmail (web and bank only)

how to proceed?
 

scriptkitty

Verified User
Joined
Jul 10, 2019
Messages
40
You would need an A record for the webmail subdomain and the a vhost entry for webmail pointing the docroot to /var/www/html/roundcube .

Is this for the same exact domain name located on two different servers? The problem is how you would point the webmail subdomain to two different servers. Do you plan to possibly use webmail1 & webmail2 subdomains to differentiate between the two servers’ webmails? Or something similar?
 

system-admin

Verified User
Joined
Aug 1, 2019
Messages
31
Kindly follow following Link to create webmail as subdomain:

https://help.directadmin.com/item.php?id=92

1) We'll need to add a webmail.* VirtualHost to each domain. We can make use of a feature that let's us globally specify CUSTOM# tokens, without altering the original templates.
Create the file
/usr/local/directadmin/data/templates/custom/virtual_host2.conf.CUSTOM.4.post

and add the code
</VirtualHost>
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
ServerName webmail.|DOMAIN|
ServerAdmin |ADMIN|
DocumentRoot /var/www/html/roundcube
CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>

taking note that we *start* the code with the closing </VirtualHost> because the CUSTOM4 token is before the trailing VH in the virtual_host2.conf template.

The above is for port http:80, but similar code can be used in virtual_host2_secure.conf.CUSTOM.4.post if you want it for https on the domain, you'd just need to add the lines after the opening <VH>:
SSLEngine on
SSLCertificateFile |CERT|
SSLCertificateKeyFile |KEY|
|CAROOT|



2) Then run
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d

to rewrite the httpd.conf files.


3) You'll also need to setup the dns portition.
cd /usr/local/directadmin/data/templates
cp dns_a.conf custom
cd custom
echo "webmail=|IP|" >> dns_a.conf

This will setup the webmail A record for new dns zones. For existing dns zones, you'll have to manually add the webmail A record to point to the domains IP.
 
Top