ServerTune

Browse by category

Search    |    Advanced search

HowTo :: setup webmail.domain.tld as default

To setup webmail.domain.tld, you need to add and modify the VirtualHost for Apache. This can be accomplished by adding a second VirtualHost along side main VirtualHost of a domain:

You'll need to edit the newly copied virtual_host.conf file and make the file look like:

|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/usr/local/lib/php/|
<VirtualHost |IP

					 		 |:80>
|CUSTOM|
|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|
ServerName www.|DOMAIN|
ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
ServerAdmin |ADMIN|
DocumentRoot |DOCROOT|
|CGI|
|USECANONICALNAME|

User |USER|
Group |GROUP|
CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
<Directory |DOCROOT|>
Options +Includes -Indexes
php_admin_flag engine |PHP|
php_admin_flag safe_mode |SAFE_MODE|
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f |USER|@|DOMAIN|'
|*if OPEN_BASEDIR="ON"|
php_admin_value open_basedir |OPEN_BASEDIR_PATH|
|*endif|
</Directory>
|HANDLERS|
|MIMETYPES|
</VirtualHost>

<VirtualHost |IP|:80>
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 the following command to update the httpd.conf files:

You'll also need to 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.

 
 
Add comment
 
Views: 1255
 
Votes: 0
 
Comments: 0
 

Other articles in this Category

RSS