Updating, recompiling, VirtualHost templates, customizations,  php safemode …Adding custom httpd.conf code to the VirtualHosts of a domain

Updating, recompiling, VirtualHost templates, customizations,  php safemode …Adding custom httpd.conf code to the VirtualHost of a domain

DirectAdmin Allows an Admin to insert some extra httpd.conf code that any User may require.  For accessing the control page for this functionality, try go to Admin Panel -> Admin Settings -> Customize Httpd Configurations.

Once you could see the list of domains, click the domain you wish it to insert the extra httpd.conf code to.

Go to the bottom of the page, you will see the current httpd.conf for that User.  It will contain all VirtualHosts for all domain and subdomains and redirects.

For Any changes are making by this page it will only affect the VirtualHosts for the domain in question, but not the other domains own by that user.  If all domains need these changes, then you would repeat this processes for each domain.

The top textarea is the where you will paste the custom httpd.conf code if you wish to insert.   The code you wish to write will be inserted into the |CUSTOM| token for all the VirtualHosts for this domain.

If You wish to edit the templates as needed for your requirements to move the |CUSTOM| token to a different position in the VirtualHost.

For All tokens that are available in the VirtualHost will be available with these features.

Other You also can set any token you wish.  For example, if you wish to change the DocumentRoot for a domain, you can then paste:


Please Note that this new DocumentRoot will be use for all DocumentRoots for this domain, even including https connections and subdomains, therefore it may not be a desired effect.

Consider Another common use is to add another ServerAlias.  This will allow another domain to be used to access the exact same content.  for accomplishing this, you would write

ServerAlias newdomain.com www.newdomain.com

To get newdomain.com and www.newdomain.com for point to the original domain for the VirtualHost.  You also will have to make sure that newdomain.com and www.newdomain.com both are resolving to the same IP as store in |IP|.


Please Note, the above example will be set to the DOCROOT token into all 4 templates, so this will also apply to all subdomains, and which may not be desired.

For only making the DOCROOT apply to the domain, but not to the subdomain, add an if, eg:

|*if !SUB|



Leave a Reply

Your email address will not be published. Required fields are marked *