Webmail Error | Content of Error: Not Found

When you logged into webmail, you usually see the options choose Horde, Squirrel, Round Cube. But when when you click any of them you get the following Not Found Error.

=====================
Content of Error:
***************
Not Found

The server was not able to find the document (./502.shtml) you requested.
Please check the url and try again. You might also want to report this
error to your web hosting provider.
=====================

This might be causing because of some configuration issues with cPanel’s default PHP. You can simply fix it with the following script.

=====================
/scripts/makecpphp
=====================

Please don’t worry that the above script wont make changes to PHP compiled with apache. This is for cPanel’s default PHP in the server.

Assign dedicated IP to addon domain

This cannot be done through WHM using the option “Change Site’s IP Address”, an addon domain wont be showing there in list since it is not as a seperate cPanel account. For to assign dedicated IP for addon domain, you need to follow up the below steps manually.

(Before all domains TTL value should be reduced to 300 and assign IP only after 4 hours to reduce the downtime)

* Goto /var/cpanel/userdata/username/addondomaname
* change IP(dedicated) there.
* Then go to addon domains zone file – /var/named/addondomain.db
* change IP there too
* Then do distiller command to update apache configuration — /usr/local/cpanel/bin/apache_conf_distiller –update
( Please vi /usr/local/apache/conf/httpd.conf and make sure the change made in effect in the addon domains virtual host entry, look the IP there if changed to new one. If not please take the backup of conf first and do change to new IP there in the addon domain’s vhost entry)
* Restart apache

After this you can install ssl for addon domain

Exim issue – “connect ACL: ratelimit database not available”

Sometimes exim is messed up and when you are reviewing the exim_mainlog, you might see the following:

==========================
2012-05-11 07:42:16 [16332] Failed to get write lock for /var/spool/exim/db/ratelimit.lockfile: timed out
2012-05-11 07:42:16 [16332] H= temporarily rejected connection in “connect” ACL: ratelimit database not available
==========================

This issue causes because of cache databases corruption and of the presence of db lock files in the path “/var/spool/exim/db/”. Please go ahead and clear all files in that path.

do, rm -rf /var/spool/exim/db/*

then restart exim.

If that didn’t fix, you should empty the “.MYD” files present in the “eximstats” database.

Go to “/var/lib/mysql/eximstats”

# > defers.MYD, > sends.MYD etc

Then please restart exim.

Proxy subdomains not working

When proxy subdomains such as cpanel.domain.com, webmail.domain.com is not working, first make sure that Proxy subdomains is turned on in “Main >> Server Configuration >> Tweak Settings”. If the problem again persist, then go and add the virtual host entry manually in very bottom of httpd.conf file.

======================================================
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS

ServerName server.hostname.com
ServerAlias cpanel.* whm.* webmail.* webdisk.*
DocumentRoot /usr/local/apache/htdocs
ServerAdmin servers@domain.com

suPHP_UserGroup nobody nobody

RewriteEngine On

SSLProxyEngine On

RewriteCond %{HTTP_HOST} ^cpanel.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
RewriteCond %{HTTP_HOST} ^webmail.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
RewriteCond %{HTTP_HOST} ^whm.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
RewriteCond %{HTTP_HOST} ^webdisk.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
RewriteCond %{HTTP_HOST} ^cpanel.
RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
RewriteCond %{HTTP_HOST} ^webmail.
RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
RewriteCond %{HTTP_HOST} ^whm.
RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
RewriteCond %{HTTP_HOST} ^webdisk.
RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
UseCanonicalName Off

Include “/usr/local/apache/conf/includes/post_virtualhost_global.conf”
Include “/usr/local/apache/conf/includes/post_virtualhost_2.conf”
======================================================

E-mail accounts not showing in cPanel

The issue when you open “Email accounts” in cPanel, it sometimes doesn’t show up the list of Email accounts the domain have but only just a blank page. This happens due to bulk of cache, temp files etc present in the .cpanel directory of domain. You can remove the “.cpanel” directory inside the path /home/cpaneluser/. The issue will be solved.

And don’t worry about the “.cpanel” directory, it will automatically recreate next time when you load the account’s cPanel.

Joomla site error after changing account’s username

When renaming cpanel username of a Joomla site, please note that that only changes in cPanel related settings and the database name. The change never make any effect on the 3rd party softwares the site is using. That is the username wont be changed automatically in the Joomla configuration file. We need to change the username manually in the “configuration.php” file of Joomla.

The following error we get sometimes after changing account’s username and when the change not automatically made in Joomla configuration file.

========================
*Warning*: require_once()
[function.require-once]:
open_basedir restriction in effect.
File(/home/oldusername/public_html//includes/version.php) is not within the
allowed path(s): (/home/newusername:/usr/lib/php:/usr/local/lib/php:/tmp) in *
/home/newusername/public_html/includes/joomla.php* on line *71*
========================

In above it is clear that, because of old username entry in Joomla config file, when we try to load up the site, Joomla seeks for the olduser and found it doesn’t exist inside anywhere in the public_html directory of site. So it finally tries to jump outside of the home user directory and for to search the user outside of it. But the PHP open_basedir restriction wont allow it to go outside of the public_html directory and errors generates when we load the site on browser.

To rectify this, please manually change to new username in the Joomla configuration file too.

If you are still facing the database connecting issue when loading site, then got to check your site’s database. May be it still contains old username as starting name for tables in it. You need to rename them all.

For that, following the below steps:
#cd /var/lib/mysql
#mysqldump user_db > user_db.sql
#replace oldusername newusername — user_db.sql
#mysqladmin drop user_db
#mysqladmin create user_db
#mysql user_db < user_db.sql

Your site will be loading fine for sure 🙂

The last attempt to update cPanel & WHM was blocked

When you login into WHM and you see the message “The last attempt to update cPanel & WHM was blocked” most of the times at the top portion.

=========
fatal: Upgrades past 11.30 are blocked because your exim is older than 4.70 and eximup is disabled.
=========

This because cPanel is set to update itself on time basis, but eximup is disabled among the settings. You can correct it in option “update preferences” through WHM itself.

When using temporary URL for wordpress

We know if a user wish to change the hosting server, he or she wont remove the account completely from the old server without starting their account resolved from new server. This because, no one wants their site down even for a single minute.

There is a common method which a user can test their new account in new host by calling temporary URL in browser. The user can see their new account in new host by using the URL like http://newserverip/~cpanelusername, this loads up their new site in new server. Please remember, actually this time the site is not globally resolving to the new server.. The client here wants to load the site and just need to check it in new server. The temporary URL (http://newserverip/~cpanelusername) works for a normal website, we know that. But it doesn’t work simply for a WordPress site.

For a wordpress site, you got to do the following changes in the wp-config file of account present in the new server.

==============
define(‘WP_HOME’,’http://newserverip/~cpanelusername’);
define(‘WP_SITEURL’,’http://newserverip/~cpanelusername’);
==============

Also in mysql
==============
#: mysql> select option_value from wp_options where option_name =’siteurl’; (::: wp_options < update wp_options set option_value=’http://newserverip/~cpanelusername/’ where option_name =’siteurl’;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
==============

You can revert the changes made once the account starts resolving from new server globally.