Setting up webmail.domain.com as default for new domains.


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


Top Level » Apache Related Information

Setting up webmail.domain.com as default for new domains.Last Modified: Aug 11, 2014, 10:40 pm
1) You'll need to setup the virtualhost for apache.  This can be accomplished by adding a 2nd virtualhost along side the domains main one.

cd /usr/local/directadmin/data/templates
cp virtual_host2.conf custom
cd custom

You'll need to edit the newly copied virtual_host2.conf file and add the blue to the end of whatever you currently have (the contents may vary)
Just be sure to add the new VirtualHost below the existing one.

|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/usr/local/lib/php/|
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
  ServerName www.|DOMAIN|
  ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
  ServerAdmin |ADMIN|
  DocumentRoot |DOCROOT|
  |CGI|

...
...

</VirtualHost>
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
  ServerName webmail.|DOMAIN|
  ServerAdmin |ADMIN|
  DocumentRoot /var/www/html/squirrelmail
  CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
  CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
  ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
</VirtualHost>

Save and exit.  Then run

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

to rewrite the httpd.conf files.



2) 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.
 
Related Helpfiles
Using a custom VirtualHost template
Running DirectAdmin through apache on port 80
Setting up webmail.domain.com with Nginx
Setting up webmail.domain.com with nginx/apache proxy

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