Add to Favourites Add to Favourites    Print this Article Print this Article

Using a custom VirtualHost template

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_host2*.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_host2*.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).  Note that there are actually 8 virtual_host files, but you only need to worry about the 4 that apply to you.   The files with the 2 in them are for apache 2.x.  The ones without the 2 in them are for apache 1.3.

Inside the virtual_host*.conf files, you'll find code that is similar to httpd.conf code, but contains what are known as tokens.  These tokens are what will be replaces with specific user data for each domain created.

Available tokens
Was this answer helpful?

Also Read