“We will deprecate EasyApache 3 on December 31, 2018. After that date, we will no longer update EasyApache 3. In cPanel & WHM version 78, we will remove support for EasyApache 3.
If you do not upgrade to EasyApache 4, you cannot upgrade to cPanel and WHM version 78. For more information, read our EasyApache 4 documentation.”
If you are a cPanel server owner running EasyApache 3, you will see this warning message in your WHM.
In our role as Technical Support Services for web hosting companies, installing, configuring and managing cPanel servers is a major task we perform. Here’s how we migrate EasyApache 3 to 4 in our customers’ servers.
What is EasyApache? Why should you migrate EasyApache 3 to 4?
EasyApache is a feature in cPanel that helps to easily install and modify Apache modules, PHP modules, Tomcat, and other web server components from the WHM.
EasyApache 3 has been the commonly used tool in cPanel servers for a long time. But with the release of next version tool EasyApache 4, cPanel is deprecating version 3.
The major features of EasyApache 4, that makes it more desirable than 3, are these:
- EasyApache 4 is faster and more efficient than 3.
- EasyApache 4 allows multiple supported PHP versions at the same time. This is very important as different websites require different PHP versions for their custom code to work.
- EasyApache 3 had a huge drawback that whenever a change has to be made, it required a full recompile of Apache and PHP, which incurs a downtime. In EasyApache 4, every module is added as an RPM, and hence can be added and removed easily, without any downtime.
- Being RPM based, EasyApache 4 package updates happen automatically and is done by the OS. This helps to ensure a secure and stable system without manual overhead or service downtime.
- EasyApache 4 can detect errors and fix them automatically. This auto recovery process helps to ensure minimal service downtime.
- EasyApache 4 provides a comprehensive and easy interface that lists the packages, modules and PHP extensions in the server.
- EasyApache 4 includes PHP 7 support. PHP 7 is very fast and feature-rich, and many websites are now using PHP 7 for improved performance and speed.
Due to the enhanced features of EasyApache 4 and cPanel stopping EasyApache 3, cPanel server owners should migrate their versions from EasyApache 3 to 4 without delay.
In the cPanel servers that we manage, this migration is done with utmost caution, as even a minor hiccup can mess up the server environment.
cPanel EasyApache 3 to 4 migration – The pre-requisites!
EasyApache 3 and 4 are not identical. They are completely different tools. Due to this reason, there can be unexpected issues in some servers due to the change in environment.
Such environment changes can affect the functioning of some websites or applications. In the servers we manage, we take proper caution to avoid such hiccups.
Before switching the EasyApache version, we perform a compatibility check in the server, which includes cross-checking these aspects.
- EasyApache 4 Migration is supported only in cPanel/WHM version 58 or higher. So we ensure that the cPanel in the server is the latest available version, before doing the migration.
- EasyApache 4 is supported only in latest OS versions like CentOS 6 or 7, CloudLinux 6 or 7, Red Hat Enterprise Linux 6 or 7, etc. Servers running EOL OS versions cannot have this feature. If any servers are running EOL OS versions, we first migrate the websites to a server with updated and secure OS.
- EasyApache 4 only supports Apache version 2.4 and not older versions like 2.2. We examine the web server profiles and initiate Apache updates in case of profiles that are running older versions.
- EasyApache 4 supports PHP versions 5.4, 5.5, 5.6, and 7.0. We verify the compatibility of the website code and applications with the available PHP versions, and figure out any failure points that can happen due to the updates.
- To enable automatic updates for the EasyApache packages, we activate the RPM update and OS package update settings in the server.
Once we ensure that the pre-requisites are satisfied, we take appropriate backups and perform the EasyApache migration in the server. This can be done in two ways.
a. Update from command line using:
/scripts/migrate_ea3_to_ea4 –run
b. Update from WHM:
In “WHM >> Home >> Software >> EasyApache 4” interface, we can perform the migration and closely examine the progress log for any errors that may show up.
Inorder to perform migration via WHM, the cPanel updates should be configured to Current or Edge versions.
EasyApache 3 to 4 migration – What can go wrong
Software changes always come with their set of inherent risk factors. In cPanel, EasyApache 3 to 4 migration can affect a lot of areas, and many things can go wrong in the process.
1. Migration process failure
The EasyApache migration process can stall forever, or fail and give out error messages like these:
Installing profile “/etc/cpanel/ea4/profiles/custom/ea3_state_at_migration-1480729459.json”. An error occurred while installing profile “STDOUT output went to filehandle! at /usr/local/cpanel/Cpanel/SafeRun/Object.pm line 360.
This happens due to connectivity issues, configuration errors, RPM repository problems, compatibility issues or missing files.
2. Profile conversion errors
The migration script tries to match EasyApache 3 modules to EasyApache 4 RPMs. But if there are no matches found or compatibility errors occur, the script pauses or aborts the mission.
EasyApache 3 profile is available at ‘/var/cpanel/easy/apache/profile/_main.yaml’ location. The migration script converts it into an EasyApache 4 profile.
If there are no errors, the profile conversion happens successfully. In cases where compatibility issues are found, the script installs the cPanel Default profile in ‘/etc/cpanel/ea4/profiles/cpanel/default.json’ file.
In servers where there are custom PHP switch tools installed, having custom-built modules, hard-coded dependencies, or ones with conf files having an underscore (_) in the name, migration will not be fully successful.
3. PHP version changes
Websites running older versions of PHP, ones less than 5.6, will face issues after the migration. This is because EasyApache 4 supports only PHP 5.6 and above.
Due to change in the default character set to UTF-8 in PHP versions 5.6 and above, the character encoding in some websites can break.
4. SuPHP related issues
For servers with SuPHP enabled, users will have their custom php.ini file in place. But migrating these php.ini files to EasyApache 4 compatible format can fail if the following conditions are not met.
a. The system’s default PHP version must use the suPHP handler.
b. One or more .htaccess files must exist in the user’s home directory.
c. Each .htaccess file must contain a properly configured suPHP_ConfigPath directive.
d. The suPHP_ConfigPath directory must contain a php.ini file.
e. The php.ini file specified in the suPHP_ConfigPath directive must exist in the user’s home directory.
5. PHP module errors
During migration, custom modules or any EasyApache 3 customizations handled by pre or post scripts are not converted to EasyApache 4 system.
This can lead to errors in websites. For instance, if a site is using .htaccess file with a custom suPHP_configpath configured, the site can show this error after migration.
“Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”
This is because the PHP configuration from the include files located in /opt/cpanel/ea-php##/root/etc/php.d/ will not be loaded and the module will not be detected.
6. Performance issues
In servers where the PHP or Apache modules were tweaked to speed up websites, EasyApache migration can slow down the sites if that module go missing after the switch.
Recently a customer approached us saying this, after he did an EasyApache 3 to 4 migration:
"I have the feeling that we lost some of the performance of server. It seems that there is some loading time when switching between the pages of our website. Have any of the tweaks been reset after the update?"
When we investigated in depth, we could track the performance issue down to a missing Apache module that influenced the page load speed.
7. Template updates
EasyApache 4 can affect the templates for the vhosts entries in the Apache configuration files. In some servers, you may get this alert from cPanel after the migration.
The system detected that one or more templates were updated as a result of a change in the EasyApache 4 environment. The following “.default” templates have changed in a recent update in the EasyApache 4 environment. - *ssl_vhost.default* - *vhost.default*
The system generates such notices if there are custom templates for vhosts found in the server, as they won’t get updated after the switch.
cPanel EasyApache 3 to 4 migration – How we avoid the pitfalls
In the servers we manage, we perform EasyApache 3 to 4 migration after ensuring that all the pre-requisites are met. Taking appropriate backups and arranging off-peak hours for the task, forms part of it.
We closely monitor the migration process to ensure that there are no failures. If any failures pop up, we immediately resolve them after pinpointing the cause.
We keep track of the modules, templates, custom configuration and PHP versions in the old version, and ensure that these modules and settings and PHP versions are present after the migration too.
In cases where Apache or PHP modules or configuration parameters are found missing, we install and configure them manually to avoid a website or application downtime.
By comparing the website and applications before and after migration, we are able to quickly detect any errors and fix them without causing a huge downtime.
For servers where a major functionality issue occurs or majority websites are affected, we can even revert the migration with this command:
/scripts/migrate_ea3_to_ea4 –revert –run
Conclusion
Software changes are always risky, as they involve server environment changes. Today we saw how our Support Engineers migrate EasyApache from version 3 to 4 in our customers’ cPanel servers without incurring any downtime for websites.
0 Comments