Category Archives: cPanel

cPanel being one of the most popular and widely used control panel in hosting
We share few tips which we come across while working day in and day out.

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 without any email account

No Email Accounts”!

This happens due to bulk of cache, temp files etc present in the .cpanel directory of domain. In order to rectify the problem we can remove the “.cpanel” directory inside the path /home/cpaneluser/.

Once removed restart the cpanel service and try access the cpanel page/email accounts.

The issue will be solved. No issues with the “.cpanel” directory, it will automatically recreate next time when you load the account’s cPanel.

Softacalous blank issue cPanel/WHM

While working one of the clients server

We saw an issue where going from WHM > plugin > Softacalous and opening it resulted in blank page.

The issue is due to corrupt files in softacalous.

To fix this issue softacalous need to be reinstalled

to reinstall to go

cd  /usr/local/cpanel/whostmgr/docroot/cgi/

rm -rf softaculous

cd /home

wget -N http://files.softaculous.com/install.sh
chmod 755 install.sh
./install.sh


Once done softacalous was working fine

cPanel – Can’t change hostname

While setting hostname from WHM  >>  Change Hostname
We were seeing below error
“The hostname was already set to server1k.online.net, syncing configuration only.
Error setting new hostname: Could not execute hostname binary
Could not set property: Connection timed out”
After googling found a alternate solution to this via cli
The command was   /usr/local/cpanel/bin/set_hostname  <hostname>

It would and could change hostname 🙂

 

Disable Mails from single cPanel account

We were having an issue where spams emails were sent from single cpanel account

We could not suspend the account and disable emails

So the solution to this was to keep website online and disable only emails

we use the below method to disable emails for a single cPanel account.

SSH to server and use below steps to disable cpanel for any account

The newwebho is the cpanel user name

root@online [~]# chmod 0 /home/newwebho/etc/
root@online[~]# chattr +ia /home/newwebho/etc/
root@eu [~]#

 

 

Disable Strict Mode mysql mariadb

While working on WHMCS I was not able to generate tickets

I found out issue was due to mysql being in strict mode

I tried disabling mysql strict mode  by adding entries in  /etc/my.cnf

sql_mode=””

However it didnt work out.

I have found that there is a /usr/my.cnf file that is enabling strict mode on  server.

This file contained the following:

====
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
====

I removed the STRICT_TRANS_TABLES option and saved the file. All that is left is to restart the MySQL server. You can do this at your convenience with the following command:

====
/scripts/restartsrv_mysql
====

Once it is restarted, strict mode should be disabled.

SSL connect attempt failed error

While working on one of clients server I was getting below error while updating cpanel license in server

root@hoskb [~]# /usr/local/cpanel/cpkeyclt
Updating cPanel license…Done. Update Failed!
Error message:
Transition to SSL failed: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

also while debugging did try yum update

however I got an error as well

root@host113 [~]# yum update
Loaded plugins: fastestmirror, rhnplugin
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File “/usr/share/yum-cli/yummain.py”, line 309, in user_main
errcode = main(args)
File “/usr/share/yum-cli/yummain.py”, line 157, in main
base.getOptionsConfig(args)
File “/usr/share/yum-cli/cli.py”, line 187, in getOptionsConfig
self.conf
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 665, in <lambda>
conf = property(fget=lambda self: self._getConfig(),
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 254, in _getConfig
self.plugins.run(‘init’)
File “/usr/lib/python2.4/site-packages/yum/plugins.py”, line 179, in run
func(conduitcls(self, self.base, conf, **kwargs))
File “/usr/share/yum-plugins/rhnplugin.py”, line 124, in init_hook
login_info = up2dateAuth.getLoginInfo()
File “/usr/share/rhn/up2date_client/up2dateAuth.py”, line 222, in getLoginInfo
login()
File “/usr/share/rhn/up2date_client/up2dateAuth.py”, line 190, in login
li = server.up2date.login(systemId)
File “/usr/share/rhn/up2date_client/rhnserver.py”, line 64, in __call__
raise up2dateErrors.SSLCertificateVerifyFailedError()
up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification.
e/rhn/up2date_client/rhnserver.py”, line 64, in __call__
raise up2dateErrors.SSLCertificateVerifyFailedError()
up2date_client.up2dateErrors.SSLCertificateVerifyFailedError: The SSL certificate failed verification.

The solution was to recreate certificate bundle file

I moved the old ca.bundle to /backup

cp /etc/pki/tls/certs/ca-bundle.crt  /root/backup/

To fix the issue, just download a new certificate bundle. I used the one from haxx.se.

 curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
The issue got fixed and can run any command on server without any issues

 

Source : http://eric.lubow.org/2011/security/fixing-centos-root-certificate-authority-issues/

No route to host: AH00056: connect to listener on [::]:443

While working on one of clients server I came across one of  the errors in Apache error logs

root@hosting [/usr/local/apache/logs]# tail -n 10 error_log
[Thu Jul 07 23:28:49.791175 2016] [core:warn] [pid 1845] (113)No route to host: AH00056: connect to listener on [::]:443

The error was due to basically iptables blocking

I went ahead and flushed iptables to get this issue resolved using below command

# iptables -F
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X#

/etc/init.d/iptables save
# /etc/init.d/iptables restart

I can see there are no more such errors now in error logs 🙂

 

 

 

 

 

Strict standard error in PHP

While working on one of clients website after migration from PHP 5.3 to PHP 5.6

I would see the error on “[01-Jul-2016 02:18:54 America/Chicago] PHP Strict Standards:  Declaration of Countries::getAttribute() should be compatible with CActiveRecord”

On googling around I could see the issue was fixed by making changing few settings in php.ini

Add & ~E_STRICT to the end of the active error reporting line. For example, if your current setting is:

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

You would change it to read:

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT

and restart httpd

This will fix the issue.

 

 

An installation already exists softacalous

While working on one server with cpanel I was facing this error

where I was getting “An installation already exists softacalous” while installing an application via softacalous

Where as in Softacalous I could not see any application installed.

While debugging I  found the error was occuring from  in file

/home/username/ .softaculous/ installations.php

I went ahead and truncated it and fixed this issue