You need to setup the virtualhost for apache2.

[root@ck]# cd /usr/local/directadmin/data/templates
[root@ck]# cp virtual_host2.conf custom
[root@ck]# cd custom


Now you can edit the new virtual_host2.conf (apache 2) file in custom folder and just add the codes to the end.

<VirtualHost |IP|:80>
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


Simply save and exit. Then run below to rewrite the httpd.conf files.

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


Finally you need to setup dns part.

[root@ck]# cd /usr/local/directadmin/data/templates
[root@ck]# cp dns_a.conf custom
[root@ck]# cd custom
[root@ck]# echo "webmail=|IP|" >> dns_a.conf


Note: Please check custom folder if there is a file with dns_a.conf name. Also dont forget that is only setup webmail A record for new domains. For existing domains, you’ll have to add manually.

Source: DirectAdmin

Leave a Reply

Your email address will not be published. Required fields are marked *