How to setup per-domain Aliases

by admin on Sep.07, 2009, under DirectAdmin

If you want to disable /webmail for just one domain (for example), one way to do that is to change the Aliases to be within the VirtualHosts instead of 1 global Alias.
To do that, we’ll need to use the virtual_host2.conf template (for apache 2) and use the custom httpd config settings, found in the Admin Level. This guide assumes you’re using apache 2 with custombuild.
1) Setup the custom template so it’s safe from DA updates:

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

2) Edit the copied virtual_host2.conf file, and insert the following at the top of the file:

|?WEBMAIL=ON|

Then just below the token that says |CUSTOM| (in the same file) add:

|*if WEBMAIL="ON"|
Alias /webmail /var/www/html/webmail/
|*endif|

3) Go to:
Admin Level -> Custom httpd config -> domain.com
In the textarea at the top, insert this one line:

|?WEBMAIL=OFF|

which will shut off webmail for just that one domain.
4) Remove the global Alias from the /etc/httpd/conf/extra/httpd-aliases.conf file.
5) Issue a full user httpd.conf rewrite, then restart apache.

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

Related posts:

  1. Setup a per-user php.ini to allow open_basedir with suPhp new way: If you wish to use per-user php.ini files...
  2. How to downgrade from apache 2 back to apache 1.3 If you need to go back to apache 1.3 after...
  3. Wildcard *.domain.com If you’d like to setup your domain to accept anything.domain.com,...
  4. Adding custom httpd.conf code to the VirtualHosts of a domain DirectAdmin Allows Admin to insert extra httpd.conf code that a...
  5. Using a custom VirtualHost template If you wish to change the setup of the VirtualHosts...

Related posts brought to you by Yet Another Related Posts Plugin.

:, , ,
No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Kontak

Budhi Indah A 31
Cimindi Cimahi 40514
West Java
Indonesia

Phone/SMS :
Info/Bantuan : 62-8158-6270622
Billing/konfirmasi : 62-8888-763551

Self Advertise


My site is worth $7548.2.
How much is yours worth?