Using a custom VirtualHost template in DirectAdmin

If you wish to change the setup of the VirtualHosts for all domains, you can do so by creating your own custom templates.

cd /usr/local/directadmin/data/templates
cp virtual_host*.conf custom
cd custom

Once you’ve copied the 4 VirtualHost files (or just the ones you want) to the custom directory, you can then edit the new files you’ve just copied. DirectAdmin will always check for the custom file before going to the default ones. Failure to copy the virtual_host*.conf files to the custom directory before modifying them will result in a loss of all changes when DirectAdmin updates itself (the files are overwritten).

Once you are happy with your new virtual_host*.conf files they’ll need to be used in the real httpd.conf files. You can trigger DirectAdmin to rewrite all User httpd.conf files by running:

echo “action=rewrite&value=httpd” >> /usr/local/directadmin/data/task.queue

The command will be added the the task queue which is checked once per minute, so it may be a few minutes before all httpd.conf files have been rewritten. *Note: the main /etc/httpd/conf/httpd.conf is never overwritten (unless DirectAdmin is reinstalled) so any changes you make will be safe.

Source: http://directadmin.com/

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.