If are you running a cPanel server and could like to quickly check the cPanel version, you may actually run the following command from your server.
# /usr/local/cpanel/cpanel -V
Make sure that you are logged as root user when running this command, otherwise, you will not able to check the version.
In case, you need to update the cPanel version, run the following command.
As a server administrator, you might want to follow-up which account has suspended for days and it’s the time for you to terminate it.
With a smart system administrator(lazy actually), you may have a custom script to check any of your account that been suspended for more than 2 months may terminate from the server automatically to save the resource/space from the server.
From this article, Mick Genie will guide you how to write a shell script and create it from the cronjob, however this step could only done by the root user.
1. Create a file name autoterminated_within60days.sh from /root/scripts/.
2. Insert the following code and save it.
for i in `find /var/cpanel/suspended/ -mtime +60 | cut -d’/’ -f5 | sed ‘1 d’`
y | /scripts/killacct $i;
3. Create a cronjob, by typing crontab -e in SSH.
4. Type as following line in the crontab to apply daily checking.
0 0 * * * /bin/sh /root/scripts/autoterminated_within60days.sh
By right, MySQL is one of the engine that used up lots of I/O and Memory resource from a server. Somehow you may use this scenario to setup so-called Clustering Web and MySQL server to reduce the I/O usage.
To setup remote MySQL server, you need 3 main steps as below.
1. Grant remote access to cPanel root user.
2. Add remote host information to /root/.my.cnf file.
3. Configure PHPMyAdmin configuration.
1. Grant remote access to cPanel root user,
To grant remote access to cPanel root user, you will need to amend the MySQL privilege as line below.
mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected]`192.168.1.1` IDENTIFIED BY ‘password’ WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO [email protected]`mysql.mickgenie.com` IDENTIFIED BY ‘password’ WITH GRANT OPTION;
2. Add remote host information to /root/.my.cnf file,
Next, you will need to change the host of the MySQL location to the slave server.
3. Configure PHPMyAdmin information,
Open file /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php, configure the setting as below.
$cfg[‘Servers’][$i][‘host’] = ‘mysql.mickgenie.com’;
$cfg[‘Servers’][$i][‘port’] = ‘3306’;
$cfg[‘Servers’][$i][‘socket’] = ”;
$cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
$cfg[‘Servers’][$i][‘extension’] = ‘mysql’;
$cfg[‘Servers’][$i][‘compress’] = FALSE;
You have done the setting.