If you run a cPanel server, and need to upgrade your Apache or PHP version, cPanel provides the Easyapache tool to make these updates a breeze. While it can be run from WHM, it is generally preferred to run it from the command line.
Note: before you get started, make sure that you are running the below commands in a screen session. If your ssh connection drops, screen will keep the easyapache process running on the server for you.
As root, on the command line, in screen, run:
This will bring up an interactive menu. Unless you completely want to rebuild your apache and PHP configuration from the ground up, leave the selection on Previously Saved Config, then use the Tab key and the arrow keys until you have selected Start customizing based on profile.
Hit Enter to move to the next screen. Here you can choose which version of Apache you wish to run on your server. While Easyapache allows you to install versions of Apache that have reached end of life status, it is not recommended.
When you choose the version of PHP you wish to change to, make sure to research your site’s code base to see if it works with the new version. Keep in mind that Easyapache installs Zend Optimizer for PHP 5.2, and Zend Guard for PHP 5.3 and above; again, check to see that your site code is compatible before making changes.
On the next screen, Short Options List, you can select the most commonly used Apache and PHP modules. If there is a module you wish to install that is not on this list, select Exhaustive Options List. Otherwise, click Save and Build to begin the compile process.
Starting the Compile
Once you have hit Save and build, it is time to sit back and let Easyapache do its thing. At the end of the process, it will briefly restart apache. Until that time, do not restart apache, even if it appears to be down temporarily. Should you do so, you will not be able to bring apache back up until Easyapache can complete a new compile, leaving your sites down the whole time.
After the Compile
When the Easyapache process has finished, take some time to test your sites and make sure that they still run fine with the new versions of Apache and PHP. If you run into any trouble, you can run a new Easyapache using a saved configuration.
Of course, if at any point in the process you find yourself with questions, do not hesitate to contact Liquid Web’s Heroic Support™ Team.
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.