{"id":228,"date":"2025-04-03T09:46:52","date_gmt":"2025-04-03T07:46:52","guid":{"rendered":"https:\/\/www.24x7serverguard.com\/blog\/?p=228"},"modified":"2025-04-03T09:46:52","modified_gmt":"2025-04-03T07:46:52","slug":"fix-template-error-the-template-file-must-be-given-in-cpanel","status":"publish","type":"post","link":"https:\/\/www.24x7serverguard.com\/blog\/cpanel\/fix-template-error-the-template-file-must-be-given-in-cpanel\/","title":{"rendered":"Fix: &#8220;Template Error: The Template File Must Be Given&#8221; in cPanel"},"content":{"rendered":"\n<p>If you encounter this error, it is likely due to a missing <strong>cPanel default page<\/strong> on the server. Follow these steps to resolve the issue:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Solution 1: Reset the Default Page in WHM<\/strong><\/h3>\n\n\n\n<p>1\ufe0f\u20e3 Log in to <strong>WHM<\/strong> as the root user.<br>2\ufe0f\u20e3 Navigate to:<br><strong>WHM \u2192 Account Functions \u2192 Web Template Editor<\/strong><br>3\ufe0f\u20e3 Click <strong>Revert to Default<\/strong> to restore the missing default page.<br>4\ufe0f\u20e3 Refresh the browser to check if the issue is resolved.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Solution 2: Manually Add Apache Configuration Entry<\/strong><\/h3>\n\n\n\n<p>If multiple domains are affected, you may need to update the <strong>Apache configuration manually<\/strong>.<\/p>\n\n\n\n<p>1\ufe0f\u20e3 Open the <strong>httpd.conf<\/strong> file in a text editor:<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">vi \/etc\/httpd\/conf\/httpd.conf<\/mark><\/p>\n\n\n\n<p>2\ufe0f\u20e3 Add the necessary configuration entry for the affected domain:<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">&lt;virtualHost 192.168.1.1:80><\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">ServerName domain.com<\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">DocumentRoot \/home\/domain\/public_html<\/mark><\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">&lt;\/VirtualHost><\/mark><\/p>\n\n\n\n<p>3\ufe0f\u20e3 Save the file and restart Apache:<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">service httpd restart<\/mark><\/p>\n\n\n\n<p>Or<\/p>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">systemctl restart httpd<\/mark><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u2705 Ensure that <strong>cPanel default pages<\/strong> are not accidentally removed.<br>\u2705 Verify that the <strong>Apache configuration<\/strong> includes the affected domains.<br>\u2705 Restart Apache after making changes to apply settings.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you encounter this error, it is likely due to a missing cPanel default page on the server. Follow these steps to resolve the issue: Solution 1: Reset the Default Page in WHM 1\ufe0f\u20e3 Log in to WHM as the root user.2\ufe0f\u20e3 Navigate to:WHM \u2192 Account Functions \u2192 Web Template Editor3\ufe0f\u20e3 Click Revert to Default [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":229,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[170,165,169,28,166,168,171,167],"class_list":["post-228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","tag-apacheconfig","tag-cpanelerror","tag-cpaneltroubleshooting","tag-servermanagement","tag-templateerror","tag-webhosting","tag-websiteerror","tag-whmfix"],"_links":{"self":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":1,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/posts\/228\/revisions\/230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media\/229"}],"wp:attachment":[{"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serverguard.com\/blog\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}