Written by on

Easy::Apache Configuration for PHP & WordPress on WHM

A customer recently asked about a recommended configuration for WHM’s Easy::Apache. He needed to reconfigure his Apache/PHP setup since it was lacking GD and PHP cURL and wanted to know if there were any other recommended changes. While every hosting need is different, I thought I could at least provide what one of our servers is running as far as Easy::Apache configuration is concerned.

I’d like to again preface this article by saying that your specific needs may vary from our specific needs, so exactly mirroring our setup is not recommended. The information presented here should be used as a guide to custom-tailoring your own setup. If you aren’t exactly sure what all this is about, I highly recommend that you leave your configuration alone or that you contact your hosting company/IT specialist to get help with customizing your setup.

All that said, I’d still like to point out that we cannot support those who break their Apache or PHP setup. Make changes to your server at your own risk.

Note that some of the options may differ from those offered in your version of Easy::Apache.

Profile

There isn’t anything interesting here except to show which version of Easy::Apache the server is using (v3.2.0 Builder 5041).

Apache Version

The server is running Apache 2.2 which is highly recommended for performance reasons. Easy::Apache notes that 2.2 isn’t recommended for PHP 4 (however, we don’t recommend PHP 4, so 2.2 shouldn’t be a problem).

PHP Major Version

The server has both PHP 4 and PHP 5 installed. This allows us to run specific cPanels with PHP 4 to do code testing. For non-developers, I recommend that PHP 5 only is used.

PHP Minor Version

The server is running PHP 4.4.9 and PHP 5.2.13. While the PHP 4 version is the newest available, it is still ancient at a year and a half old, for that reason, it is only used on testing sites and never for production sites. Version 5.2.13 was released last month (February 25, 2010) and is the latest available for 5.2.*, so PHP 5 is doing well for performance, security, feature, and bug fixes. At some point, I’ll upgrade the PHP 5 version to 5.3.*, but I’ll wait until I can do some more testing first so that nothing breaks unexpectedly.

Short Options List

These options are mirrored in the next list, but I figured I’d keep them here. The key enabled options to notice are Mod SuPHP, IonCube Loader for PHP, Mod Security, and Zend Optimizer for PHP.

Exhaustive Options List

This is probably the reason you are looking at this post. This image shows all the options selected for Apache and PHP.

As noted above, please do your research before making any changes to your server configuration, especially if active sites are running on the server. We cannot support people that break their server by changing their Easy::Apache configuration.

While every server’s needs will be specific to the needs of the sites running on the server, I’d like to point out some specific options in our configuration.

Of note are:

  • Mod FCGID and Fastcgi (in the PHP section) – I don’t believe that either of these options are necessary to get everything to work properly, but they don’t hurt.
  • Mod SuPHP – SuPHP is what allows the PHP code to execute with the permissions of the file’s owner. This is how shared hosting companies keep the owner and group names of all files the same as the FTP/SSH user of the account without running into permissions issues.
  • IonCube Loader for PHP – IonCube allows developers to encode their PHP files in a way that make it difficult for the end user to modify the code (not a fan personally). Additionally, it can speed up WordPress performance by caching the PHP files in a method that allows for rapid execution of the code.
  • Mod Security – Put simply, Mod Security looks for exploit attempts and blocks them. It’s a bit more complex than that, so I recommend visiting the link to read up on it if you are interested.
  • Zend Optimizer for PHP – Zend Optimizer (AKA Guard) allows developers to encode their PHP files in a way that make it difficult for the end user to modify the code (not a fan personally). Additionally, it can speed up WordPress performance by caching the PHP files in a method that allows for rapid execution of the code. Yes, this can and does coexist with IonCube well.
  • Curl and CurlSSL – I don’t believe that WordPress itself requires cURL, but much of the WordPress code will use it if it is available. There are many plugins that either require cURL or would have limited functionality without it.
  • Exif – This allows the media handler of WordPress to pull Exif data out of images.
  • FTP – The functions provided by this option are used to do plugin and WordPress upgrades via FTP.
  • GD – Without this, many of the image handling functions (resize, crop, etc) of WordPress and plugins won’t function.
  • Iconv – These functions allow WordPress to do character set conversions for everything from mail to RSS parsing.
  • Mbregex and Mbstring – These libraries provide functions used throughout the WordPress code.
  • Mcrypt – While this library isn’t used in WordPress, some plugins make use of the functions if they are available.
  • Mime Magic – This library isn’t currently in use in WordPress, but the latest trunk uses a function from it, so it is a good idea to keep it around just in case. In addition, some plugins/themes (including some of my own) make use of the functions.
  • Mysql and Mysql of the system – These are very important as WordPress relies on them.
  • Openssl – This library is used to handle processing connections encrypted with SSL certificates. Without this library, WordPress may not be able to connect to any SSL (https) encrypted location.
  • POSIX – These functions are used to ensure that WordPress maintains file permissions and ownerships properly.
  • Path Info Check – Without this option, some permalink setups may fail to work properly.
  • Pear – Pear allows for additional modules to be quickly and easily added to PHP. While most server admins will never use this, there are times when having access to it can mean the difference between a few minutes and a long day at the office.
  • Pspell – This library is used to add spell checking capabilities to TinyMCE, the editor on the back-end of WordPress.
  • Sockets – This library is used for managing FTP connections and mail handling via SMTP and POP in WordPress.
  • Zip – This library provides the fantastic ZipArchive class. This class allows for cross-platform compatible zip file creation and extraction. The latest development version of WordPress makes use of this function if it is available. In addition, PluginBuddy’s BackupBuddy makes use of this as a cross-platform compatibility method if the native zip commands don’t work.
  • Zlib – WordPress uses this library for a variety of features. A quick example is how WordPress compresses js and css files if the library is installed (making sites load faster). In addition, some plugins make use of these functions to compress the entire output of the site, making all the site content load faster.

Closing Thoughts

The most important thing to keep in mind when you go to make changes to any of your server’s software is that you do your homework so that everything works as well or better than it did before you made the changes. It’s not an easy job, but that’s why IT guys make the big bucks, right?

Comments

  1. What a fantastic and usefull article. – Thanks for sharing your experiences.

    Is there a way to confirm the profile you are running after you compile?
    I only seem to be able to check my Apache version, even through SSH, using: /usr/local/apache/bin/httpd -v

Respond

×

Sale Ends Today! Save 35% OFF BackupBuddy with coupon code BACKUPWP35