Changing The Default Web Templates for cPanel

Changing The Default Web Templates for cPanel
5 (100%) 2 votes

cPanel currently has four templates that are visible to your users:

Default website: Appears to visitors who navigate to a site that points to the server but isn’t configured in Apache
Account move: Appears to visitors who navigate to a site that has moved
Connection selection: Appears to visitors who navigate to a site that is experiencing a connection or firewall problem
Account suspended: Appears to visitors who navigate to a site that has been suspended

You can modify the templates in WHM > Web Template Editor, but what if you have multiple servers you need to update templates for?

The templates are stored in a simple location:

/var/cpanel/webtemplates/$user/$language/$templatename.tmpl

$user : The reseller user (all accounts under this reseller will use its templates)

$language: The language in use for cPanel

$templatename: The name of the template, with .tmpl appended:

Default website: default.tmpl
Account move: moving.tmpl
Connection selection: redirect.tmpl
Account suspended: suspended.tmpl

This way, if you wanted to (for example) change all the suspended pages for accounts owned by root, simply drop your html code into the following file:

/var/cpanel/webtemplates/root/english/suspended.tmpl

The way cPanel works in regards to these templates, is to redirect all sites matching relevant situations (such as suspended websites) to a compiled CGI file in /usr/local/cpanel/cgi-sys:

movingpage.cgi
defaultwebpage.cgi
suspendedpage.cgi
redirect.cgi

The files load up the template and serve them to the visitor reaching the website or cPanel for the account in question.

Don't be selfish, share!Tweet about this on TwitterShare on RedditShare on TumblrBuffer this pageDigg thisShare on FacebookFlattr the authorEmail this to someoneShare on Google+Pin on PinterestPrint this pageShare on LinkedInShare on StumbleUpon

3 Comments

Leave a Reply

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

Log in