CPanel / WHM – Change “Default Website” Page

You may have noticed that when visiting a CPanel Server ( running WHM ) if you don’t have a site configured for the hostname that you are accessing ( or possibly if you are accessing the server via the IP address ) you will end up seeing the “default website” page, and your browser’s URL will redirect to defaultwebpage.cgi ( or /cgi-sys/defaultwebpage.cgi )

CPanel / WHM – Change “Default Website” Page

You may have searched your system and ended up finding something like this file:

/usr/local/cpanel/cgi-sys/defaultwebpage.cgi

However, that’s not just a plain HTML file – it’s a beefy binary cgi script. No editing is going to take place there! (nor should it)

You may have also found the file that actually loads / redirects to the cgi script, which lives here:

/usr/local/apache/htdocs/index.html

However, I would not recommend customizing that file because it will get overwritten during a cPanel upgrade.

So, what is the right way?

Well it just so happens that in WHM there is a Web Template Editor that is meant for this very purpose:

CPanel / WHM – Change “Default Website” Page

The Web Template Editor allows you to create placeholder web pages. These pages will appear to visitors who navigate to a site on your server that:

  • Has not yet been configured by the domain owner (see the Default Website Page tab)
  • Has moved (see the Account Move tab)
  • Is experiencing a connection or firewall problem (see the Connection Selection tab)
  • Has been suspended (see the Account Suspended tab)

Info for the Default Website Template:

You are editing the Default Website Template.

This page appears to visitors who navigate to a site that has not been configured by the domain owner and sites that have been deleted.

If you have created /usr/local/apache/htdocs/index.php, index.cgi, or index.pl this page will be overridden by these scripts

This template file will be saved as /var/cpanel/webtemplates/root/english/default.tmpl

How to use a scriptable index ( like index.php or index.pl )

You can make changes to index.html, but during apache rebuilds and/or cpanel upgrades changes may be lost as the file is reverted to the system version. According to WHM, another file in that location may take precedence – like index.php – however to get index.php to load you may need to move or delete index.html in order to have a file like index.php or index.pl – load as the default. But again, during upgrades or rebuilds the index.html file will come back.

Also, please note when using php files that the permissions should probably be set to 644 and the owner and group of the file should be the apache user – most likely nobody:nobody

The other way to keep a file like index.php available even during upgrades and rebuilds is to set the DirectoryIndex priority setting in WHM so that .php files are prioritized:

CPanel / WHM – Change “Default Website” Page

Related Posts:

  • No Related Posts
This entry was posted in Tech Tips and tagged , . Bookmark the permalink.

2 Responses to CPanel / WHM – Change “Default Website” Page

  1. Matthew says:

    Thanks, this was exactly what I was looking for. Clear and detailed explanation! I’m surprised WHM shows that error page with a 200 code in the first place…

  2. Josh says:

    Thanks! That was much easier than other instructions I was trying to follow!

Leave a Reply

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