{"id":3084,"date":"2020-04-29T03:12:00","date_gmt":"2020-04-28T21:42:00","guid":{"rendered":"https:\/\/www.24x7serversupport.com\/blog\/?p=3084"},"modified":"2020-05-03T04:23:28","modified_gmt":"2020-05-02T22:53:28","slug":"adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/","title":{"rendered":"Adding custom httpd.conf code to the VirtualHosts of a domain"},"content":{"rendered":"\n<p>DirectAdmin Allows Admin to insert extra httpd.conf code that a User may require. &nbsp;To access the control page for this functionality, go to Admin Panel -&gt; Admin Settings -&gt; Customize Httpd Configurations.<br><br>Once you see the list of domain, click the domain you wish to insert the extra httpd.conf code to.<br><br>At the bottom of the page, you&#8217;ll see the current httpd.conf for that User. &nbsp;It will contain all VirtualHosts for all domain, subdomains and redirects. &nbsp;Any changes made by this page will only affect the VirtualHosts for the domain in question, not the other domains owned by that user. &nbsp;If all domains need the changes, then you would repeat this process for each domain.<br><br>The top textarea is where you will paste the custom httpd.conf code you wish to insert. &nbsp; The code you write will be inserted into the |CUSTOM| token for all VirtualHosts for this domain. &nbsp;You can edit the templates as needed if you require to move the |CUSTOM| token to a different position in the VirtualHost.<br><br>All tokens that are available for the VirtualHost will be available with this feature. &nbsp;You can also set any token you wish. &nbsp;For example, if you with to change the DocumentRoot for a domain, you can paste:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">|?DOCROOT=\/new\/path\/you\/want|<\/pre>\n\n\n\n<p>Note that this new DocumentRoot will be used for all DocumentRoots for this domain, including https connections and subdomains, so it may not be a desired effect.<br><br>Another common use is to add another ServerAlias. \u00a0This allows another domain to be used to access the exact same content. \u00a0To accomplish this, you would write<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ServerAlias newdomain.com www.newdomain.com<\/pre>\n\n\n\n<p>To get newdomain.com and www.newdomain.com to point to the original domain for the VirtualHost. \u00a0You will also have to make sure that newdomain.com and www.newdomain.com both resolve to the same IP as stored in |IP|.<\/p>\n\n\n\n<p>Note, the above example will set the DOCROOT token into all 4 templates, so this will also apply to all subdomains, which may not be desired.<br>To only make the DOCROOT apply to the domain, and not to the subdomain, add an if, eg:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">|*if !SUB|<br>|?DOCROOT=\/new\/path\/you\/want|<br>|*endif|<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>DirectAdmin Allows Admin to insert extra httpd.conf code that a User may require. &nbsp;To access the control page for this functionality, go to Admin Panel -&gt; Admin Settings -&gt; Customize Httpd Configurations. Once you see the list of domain, click the domain you wish to insert the extra httpd.conf code to. At the bottom of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[273],"tags":[],"class_list":["post-3084","post","type-post","status-publish","format-standard","hentry","category-directadmin"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Adding custom httpd.conf code to the VirtualHosts of a domain | 24x7serversupport Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding custom httpd.conf code to the VirtualHosts of a domain | 24x7serversupport Blog\" \/>\n<meta property=\"og:description\" content=\"DirectAdmin Allows Admin to insert extra httpd.conf code that a User may require. &nbsp;To access the control page for this functionality, go to Admin Panel -&gt; Admin Settings -&gt; Customize Httpd Configurations. Once you see the list of domain, click the domain you wish to insert the extra httpd.conf code to. At the bottom of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-28T21:42:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-02T22:53:28+00:00\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/\",\"name\":\"Adding custom httpd.conf code to the VirtualHosts of a domain | 24x7serversupport Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"datePublished\":\"2020-04-28T21:42:00+00:00\",\"dateModified\":\"2020-05-02T22:53:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Adding custom httpd.conf code to the VirtualHosts of a domain\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding custom httpd.conf code to the VirtualHosts of a domain | 24x7serversupport Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/","og_locale":"en_US","og_type":"article","og_title":"Adding custom httpd.conf code to the VirtualHosts of a domain | 24x7serversupport Blog","og_description":"DirectAdmin Allows Admin to insert extra httpd.conf code that a User may require. &nbsp;To access the control page for this functionality, go to Admin Panel -&gt; Admin Settings -&gt; Customize Httpd Configurations. Once you see the list of domain, click the domain you wish to insert the extra httpd.conf code to. At the bottom of [&hellip;]","og_url":"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/","og_site_name":"24x7serversupport Blog","article_published_time":"2020-04-28T21:42:00+00:00","article_modified_time":"2020-05-02T22:53:28+00:00","author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/","url":"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/","name":"Adding custom httpd.conf code to the VirtualHosts of a domain | 24x7serversupport Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"datePublished":"2020-04-28T21:42:00+00:00","dateModified":"2020-05-02T22:53:28+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/adding-custom-httpd-conf-code-to-the-virtualhosts-of-a-domain\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Adding custom httpd.conf code to the VirtualHosts of a domain"}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=3084"}],"version-history":[{"count":1,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3084\/revisions"}],"predecessor-version":[{"id":3085,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3084\/revisions\/3085"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=3084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=3084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=3084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}