cPanel & WHM Version 100 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!
This object is in archive! 

Environment sanity check for the cPanel installer

Guest shared this idea 8 years ago
Open Discussion

cPanel requires a certain type of server environment to operate in. More information on this can be found here: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/InstallationGuide/ConfiguringOs


On behalf of a number of technical analysts that work for cPanel, we'd like to request that the cPanel installer check for the following:


* SELinux (verify not enabled)

* disk space (verify sufficient disk space)

* run level (verify is at 3)

* NetworkManager (verify not running, verify not enabled)

* extra yum groups (verify not installed)

* valid hostname (verify is an FQDN)

* sufficient memory (verify minimum requirements are met)

* /tmp perms (verify perms are 1777)


It is not sufficient to rely on a perfect server environment for each server that cPanel is installed on.


I understand that there are many, many ways in which a server can be set up improperly. The list above has been narrowed down to the problems that we (the technical analysts) have seen (multiple times in some cases), and cause or can lead to the most problems - either during the install (insufficient memory), or some time after (MySQL installed but completely broken). They should also be fairly simple and straightforward to check for.


The desired course of action if one of those conditions is found would be to:


A) print a brief message on the screen about the problem (e.g., "SELinux needs to be disabled before running the cPanel installer")


B) exit


Correcting the issue(s) should be done by the customer.


Thanks!

Best Answer
photo

cPanelJeff wrote:

We just received another ticket from another customer whose server had perms of 0755 on /tmp prior to the cPanel install, resulting in a non functional MySQL.


To illustrate the issue:


---------------------

[root@HOST ~]# mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

---------------------

[root@HOST /var/lib/mysql]# grep /tmp HOST.err

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibVUkH3b' (Errcode: 13)

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibhFbSR7' (Errcode: 13)

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibvw6g9c' (Errcode: 13)

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibsImDn6' (Errcode: 13)

/usr/sbin/mysqld: Can't create/write to file '/tmp/ib9onWov' (Errcode: 13)

---------------------

[root@HOST /var/lib/mysql]# perror 13

OS error code 13: Permission denied

---------------------

[root@HOST ~]# mysqld_safe --skip-grant-tables &

[root@HOST ~]# mysql mysql

mysql> select user,host from user;

Empty set (0.00 sec)

---------------------

[root@HOST ~]# mysql -NBe 'show databases'

information_schema

mysql

performance_schema

test

- - - - - - - - - - - - - - - - - - - - - - - - - -

Note the lack of dbs like horde, eximstats, etc.

- - - - - - - - - - - - - - - - - - - - - - - - - -

.

.

.

.

Possible fix instructions (assumes MySQL55 rpms; run "rpm -qa | grep -i ^mysql | sort" to be sure):


- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# chmod 1777 /tmp

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# mv .my.cnf .my.cnf.old

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# rpm -e --nodeps MySQL55-client MySQL55-devel

MySQL55-server MySQL55-shared MySQL55-test

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# mv /var/lib/mysql /var/lib/mysql.old

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# /scripts/check_cpanel_rpms

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# /usr/local/cpanel/bin/updatehorde --force

[root@host ~]# /usr/local/cpanel/bin/updateeximstats

[root@host ~]# /usr/local/cpanel/bin/hulkdsetup

[root@host ~]# /usr/local/cpanel/bin/leechprotectinstall

[root@host ~]# /usr/local/cpanel/bin/update-roundcube --force

- - - - - - - - - - - - - - - - - - - - - - - -

.

.

.

Alternatively, reinstall the OS, make sure that /tmp has permissions of 1777 first, then install cPanel.

Jeff,

THANK YOU THANK YOU for this. All of our new orders are having this problem. So we had to reinstall fresh centos chmod /tmp to 1777 and then install cPanel/WHM otherwise NOTHING was working correctly..


Thanks once again!

Replies (4)

photo
1

I have met mysql broken problem which has bothered me for a week. At last with the help of cPanel migration team, I found it was due to /tmp permission problems before installing cPanel.


So in my opinion environment check for cPanel installer is necessary as there are many, many misconfigured CentOS

photo
1

cPanelJeff wrote:

We just received another ticket from another customer whose server had perms of 0755 on /tmp prior to the cPanel install, resulting in a non functional MySQL.


To illustrate the issue:


---------------------

[root@HOST ~]# mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

---------------------

[root@HOST /var/lib/mysql]# grep /tmp HOST.err

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibVUkH3b' (Errcode: 13)

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibhFbSR7' (Errcode: 13)

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibvw6g9c' (Errcode: 13)

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibsImDn6' (Errcode: 13)

/usr/sbin/mysqld: Can't create/write to file '/tmp/ib9onWov' (Errcode: 13)

---------------------

[root@HOST /var/lib/mysql]# perror 13

OS error code 13: Permission denied

---------------------

[root@HOST ~]# mysqld_safe --skip-grant-tables &

[root@HOST ~]# mysql mysql

mysql> select user,host from user;

Empty set (0.00 sec)

---------------------

[root@HOST ~]# mysql -NBe 'show databases'

information_schema

mysql

performance_schema

test

- - - - - - - - - - - - - - - - - - - - - - - - - -

Note the lack of dbs like horde, eximstats, etc.

- - - - - - - - - - - - - - - - - - - - - - - - - -

.

.

.

.

Possible fix instructions (assumes MySQL55 rpms; run "rpm -qa | grep -i ^mysql | sort" to be sure):


- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# chmod 1777 /tmp

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# mv .my.cnf .my.cnf.old

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# rpm -e --nodeps MySQL55-client MySQL55-devel

MySQL55-server MySQL55-shared MySQL55-test

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# mv /var/lib/mysql /var/lib/mysql.old

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# /scripts/check_cpanel_rpms

- - - - - - - - - - - - - - - - - - - - - - - -

[root@host ~]# /usr/local/cpanel/bin/updatehorde --force

[root@host ~]# /usr/local/cpanel/bin/updateeximstats

[root@host ~]# /usr/local/cpanel/bin/hulkdsetup

[root@host ~]# /usr/local/cpanel/bin/leechprotectinstall

[root@host ~]# /usr/local/cpanel/bin/update-roundcube --force

- - - - - - - - - - - - - - - - - - - - - - - -

.

.

.

Alternatively, reinstall the OS, make sure that /tmp has permissions of 1777 first, then install cPanel.

Jeff,

THANK YOU THANK YOU for this. All of our new orders are having this problem. So we had to reinstall fresh centos chmod /tmp to 1777 and then install cPanel/WHM otherwise NOTHING was working correctly..


Thanks once again!

photo
1

Some but not all of the above checks are already a part of the installer. SELinux is disabled early in the installer.

photo
1

Yes, that's a must, in addition to other stuff so we can get a better install experience.

Please cPanel, have a look at your client's tickets to check possible issues and help us to prevent them.

Leave a Comment
 
Attach a file