Migration from EasyApache 3 to EasyApache 4

On the test I migrated from EasyApache 3 to EasyApache 4.

Before starting the process, you must always make a backup copy of the server.

Opened the “WHM” – “Home” – “Software” panel – “EasyApache 4” and clicked the “Migrate” button.

The migration process lasted about 5 minutes.
Since the old EasyApache 3 used Apache2.2, and it is not supported on EasyApache 4, it was automatically updated to Apache2.4.
The configuration and version of PHP remained the same as 5.5, but since it was outdated, after migration, I opened the same menu (WHM – Home – Software – EasyApache 4), chose the version of PHP 5.6, the necessary PHP modules had to be selected, because for each versions of PHP they are selected individually.
The PHP version 7 decided not to choose to fix the code of sites less.

After the PHP update, you need to configure the php.ini file, it is located at /opt/cpanel/ea-php56/root/etc/php.ini, and on EasyApache 3 was /usr/local/lib/php.ini.

The Apache2 error log file is here by default /etc/apache2/logs/error_log and here /usr/local/apache/logs/error_log.

The error file PHP file, for some reason in php.ini by default was specified without a path:

error_log = error_log

Because of this, it was created in all the directories of the web server where errors occurred, so I indicated the full path.

This completes the migration, further actions depend on the errors that will be displayed in this file, if necessary, you will probably need to install missing PHP modules or fix the outdated site code.

See also:
Troubleshooting PHP Warning “Permission denied /var/cpanel/php/sessions/ea-php56/”

Troubleshooting PHP Warning “Permission denied /var/cpanel/php/sessions/ea-php56/”

Once I updated EasyApache 3 to EasyApache 4 in cPanel and noticed in the PHP logs the following:

[29-Mar-2018 15:54:45 UTC] PHP Warning:  Unknown: open(/var/cpanel/php/sessions/ea-php56/sess_3d96o7nnlnnr473p8619vqkdm1, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[29-Mar-2018 15:54:45 UTC] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/cpanel/php/sessions/ea-php56) in Unknown on line 0

The warning occurs because PHP can not write session files to a directory to which it does not have access rights.
I looked at the rights of this directory, the group and owner was root, and it was also allowed to write and execute for everyone, except reading.

To resolve this warning, you can open full access for everyone:

chmod 777 /var/cpanel/php/sessions/ea-php56

Or open a PHP configuration, for example in the nano editor:

nano /opt/cpanel/ea-php56/root/etc/php.ini

To find:

session.save_path = "/var/cpanel/php/sessions/ea-php56"

And change to:

session.save_path = "/tmp"

That used to be on the old EasyApache3 in the PHP configuration /usr/local/lib/php.ini.

After that, the warning did not appear.

See also:
Migration from EasyApache 3 to EasyApache 4

The warning solution “The MaxMind Geolite databases will soon be deprecated” in Cpanel

Once launched a server security check by clicking “Check Server Security” in “Main” – “Plugins” – “ConfigServer Security & Firewall” and saw a warning:

Firewall Check
CC_OLDGEOLITE option check
The MaxMind Geolite databases will soon be deprecated, disable CC_OLDGEOLITE to start using the new Geolite2 databases

This option determines which database to use, the old MaxMind Geolite or the new MaxMind Geolite2.
If the option “CC_OLDGEOLITE” is 1, which is in my case, then the old one is used, and if 0, then the new one.

To enable the use of a new one, open the CSF configuration for example in the text editor nano:

nano /etc/csf/csf.conf

Find the option CC_OLDGEOLITE and change its value from 1 to 0:

CC_OLDGEOLITE = "0"

In the nano editor, the Ctrl+X keys are used to exit, and y/n and Enter to save or discard the changes.

After the changes, restart CSF by clicking “Firewall Restart” in the menu “Main” – “Plugins” – “ConfigServer Security & Firewall”.

Configuring Cron Jobs in cPanel and WHM

Cron jobs are added separately for each user through the cPanel and WHM web interface, namely cPanel “Advanced” -> “Cron Jobs“.
Through the WHM panel “Home” -> “Server Configuration” -> “Configure cPanel Cron Jobs“.

But there are also system tasks that can not be seen through the panel.
They can be seen by connecting through SSH to the server and running the command from the root user:

crontab -e

or from another user via sudo:

sudo crontab -e

In the nano editor, the shortcut Ctrl+X is used to exit, and y/n to save or discard the changes.
The file itself with the tasks is located on the path /var/spool/cron/root

If an annoying report is sent to an e-mail when executing an assignment, you can hide the output of the task by adding the following code to the end of the command:

>/dev/null 2>&1

To restart the Cron service, use the command:

service crond restart

See also a similar article: Using and configuring CRON

How to start ClamAV scanning from the command line on the cPanel server

Here is an example of checking the public_html directory with the removal of infected files:

/usr/local/cpanel/3rdparty/bin/clamscan -ri --remove /home/user/public_html

Similarly, other directories are checked.

To start checking only the mail and public_html directory for all users:

/usr/local/cpanel/3rdparty/bin/clamscan -ri /home/*/mail
/usr/local/cpanel/3rdparty/bin/clamscan -ri /home/*/public_html

To update the anti-virus database, use the command:

/usr/local/cpanel/3rdparty/bin/freshclam

See also my article:
Installing and using ClamAV antivirus software

Location of log files cPanel

Below is a list of paths for cPanel log files.

Logs in the /var/cpanel/:
/var/cpanel/horde/log/ (Horde)
/var/cpanel/roundcube/log/ (RoundCube)
/var/cpanel/squirrelmail/ (SquirrelMail)
/var/cpanel/logs (different cPanel logs)
/var/cpanel/accounting.log (creation, deletion of accounts, etc.)
/var/cpanel/bandwidth.cache/{USERNAME} (Per account bandwidth history (Cached))
/var/cpanel/bandwidth/{USERNAME} (Per account bandwidth history (Human Readable))
/var/cpanel/updatelogs/updated.DATE.log (update logs)

Logs in the /usr/local/cpanel/logs/:
/usr/local/cpanel/logs/access_log (user access and action logs)
/usr/local/cpanel/logs/cpbackup (backup)
/usr/local/cpanel/logs/cphulkd.log (cPHulk Protection)
/usr/local/cpanel/logs/dnsadmin_log (dnsadmin)
/usr/local/cpanel/logs/error_log (cPanel errors)
/usr/local/cpanel/logs/license_log (Licenses)
/usr/local/cpanel/logs/build_locale_database_log
/usr/local/cpanel/logs/login_log (Login errors)
/usr/local/cpanel/logs/panic_log (Errors)
/usr/local/cpanel/logs/tailwatch_log (Tailwatch)
/usr/local/cpanel/logs/updated_analysis/{TIMESTAMP}.log
/usr/local/cpanel/logs/cpdavd_error_log (WebDisk)
/usr/local/cpanel/3rdparty/mailmain/logs (Mailman)
/usr/local/cpanel/logs/queueprocd.log
/usr/local/cpanel/logs/setupdbmap_log
/usr/local/cpanel/logs/easy/apache/
/usr/local/cpanel/logs/splitlogs_log
/usr/local/cpanel/logs/stats_log
/usr/local/cpanel/logs/safeapcherestart_log

Logs in the /var/log/:
/var/log/cpanel (cPanel installation logs)
/var/log/cpanel-install.log
/var/log/chkservd.log (service status)
/var/log/maillog (mail logs)
/var/log/messages (mail logs)
/var/log/exim_rejectlog
/var/log/exim_paniclog (mail logs with errors)
/var/log/exim_mainlog (mail logs about delivery and receipt)
/var/log/slowqueries (a log of slow MySQL queries, if they are enabled in my.cnf)
/var/log/easy-tomcat7/localhost-access_log
/var/log/easy-tomcat7/catalina.err
/var/log/easy-tomcat7/catalina.out

Logs in other directories:
/usr/local/apache/domlogs/DOMAIN
/usr/local/apache/logs/suphp_log (suPHP)
/usr/local/apache/logs/error_log (web server errors)
/usr/local/apache/domlogs/ftpxferlog (FTP)
/var/spool/exim/input/ (incoming mail queue)
/var/lib/mysql/SERVER_NAME.err (MySQL Errors)

How to restart services in cPanel

The services must be restarted through the WHM interface, by opening “Home” > “Restart Services”.

If the restart of the service through the WHM interface failed, then the script should be used:

/usr/local/cpanel/scripts/restartsrv_*

If you are using IPv6 and the command was executed:

service network restart

That IPv6 does not work to solve the problem:

/etc/init.d/cpipv6 restart (for cPanel & WHM version 11.52 and earlier)
/usr/local/cpanel/scripts/restartsrv_cpipv6 (for cPanel & WHM version 54 and later)

In extreme cases, you can try to restart the service directly:

/etc/rc.d/init.d/service restart
systemctl restart service-name.service

See also:
Location of log files cPanel

Location of configuration files cPanel & WHM

I will list and describe the standard paths to the cPanel & WHM configuration files:

/usr/local/apache/conf/httpd.conf (apache web server)
/usr/local/lib/php.ini (PHP)
/opt/cpanel/ea-php56/root/etc/php.ini (PHP)
/etc/ssh/sshd_config (SSH configuration)
/etc/proftpd.conf (proftpd FTP server)
/etc/pure-ftpd.conf (pure-ftpd FTP server)
/var/cpanel/cpanel.config (cpanel configuration)
/var/cpanel/root.accts (list of root domain owners)
/etc/wwwacct.conf (account file)
/etc/cpupdate.conf (cPanel update configuration)
/etc/cpbackup.conf (backups)
/var/spool/cron/ (scheduled cron jobs)
/etc/clamav.conf (clamav antivirus)
/etc/my.cnf (mysql databases)
/var/lib/pgsql/data/postgresql.conf & pg_hba.conf (postgreSQL databases)
/etc/exim.conf (exim mail server)
/etc/dovecot.conf (dovecot mail server)
/etc/valiases/domainname (forwarding settings)
/etc/vfilters/domainname (email filters)
/etc/userdomains (list of all domains, subdomains and their users)
/etc/localdomains (list of all local domains, sub-domains for exim from which mail can be sent)
/var/cpanel/users/ (cpanel user options)
/etc/named.conf (DNS name server)
/etc/resolv.conf (network settings)
/etc/sysconfig/network (network settings)
/etc/hosts (host configuration)
/etc/nameserverips (list of name servers (NS))

Solution of the error “Using unique option prefix pass instead of password is deprecated …”

I noticed some errors coming to the root mail with the subject and the text:

Cron /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.

The problem lies in the file ~ / .my.cnf, that is /root/.my.cnf in my case.

In which the parameter “pass” is obsolete and must be changed to a new “password”.

For example, that’s how it was when the error occurred:

[client]
user=root
pass=password

Changed to password and the error disappeared:

[client]
user=root
password=password

See also:
Connecting to MySQL from localhost without entering a password

How to enable Horde, SquirrelMail and RoundCube in cPanel

cPanel allows you to use several web interfaces at once for viewing mail, sometimes they can be disabled or perhaps some of them need to be disabled.

Settings are in “WHM” – “Server Configuration” – “Tweak Settings” – tab “Mail

Where can I specify On or Off opposite Enable Horde Webmail, Enable RoundCube Webmail or Enable SquirrelMail Webmail.

To save changes, click the button below “Save“.