Adding Custom Directives to VirtualHosts
You can add extra settings for virtual hosts of a domain using DirectAdmin. For official documentation, see DirectAdmin: Custom HTTP Configurations.
Steps
- Go to Admin Panel → Admin Settings → Customize Httpd Configurations.
- Click the domain from the list that you want to insert the extra httpd.conf code to.
- At the bottom of the page, you'll see the current httpd.conf for that User.
- Paste the custom httpd.conf at the top textarea. It will be added into the |CUSTOM| token for all VirtualHosts for this domain.
Example: Change DocumentRoot
|?DOCROOT=/new/doc/root/|
Note that this new DocumentRoot will be used for all DocumentRoots for this domain, including https connections and subdomains. So use it with care.
Using ServerAlias
You may also use this for ServerAlias. This allows another domain to be used to access the exact same content:
ServerAlias anotherdomain.com www.anotherdomain.com