Monday, August 6, 2012

Adding custom directives to VirtualHosts

September 1, 2009 by  
Filed under Direct Admin

You can add extra settings for virtual hosts of a domain using DirectAdmin. Simple follow these 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. It will contain all VirtualHosts for all domain, subdomains and redirects. Any changes made by this page will only affect the VirtualHosts for the intended domain only. It won’t affect any other domains.
  • Paste the custom httpd.conf at the top textarea. It will be added into the |CUSTOM| token for all VirtualHosts for this domain.
  • All tokens that are available for the VirtualHost will be available with this feature. You can also set any token you wish. For example, if you with to change the DocumentRoot for a domain, you can write:

|?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.

You may also use this for ServerAlias. This allows another domain to be used to access the exact same content. To accomplish this, you would write

ServerAlias anotherdomain.com www.anotherdomain.com

Note that you have to correctly point aliased domain to this server.

GD Star Rating
loading...
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

No related posts.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!