Common Issues – Maxed out Apache Connections

Hello everyone!

This week in “Common Issues”, we will be discussing the ever common “ran out of connections” issues many clients with very big websites see daily. This problem is a fairly simple solution but it is a easily missed one that many technicians don’t fully complete and leave half done. The first step is to check to ensure that the client is indeed running out of connections and that the error isn’t coming from some other place. The best way to discover if they are out of connections is by doing the following command:

/etc/init.d/httpd status

If you see no periods (.) and all letters in the status line, then the client is indeed out of connections. To increase it, firstly, we need to make sure they are using Apache 2.2 or higher. You can check this by looking at the top of the last command and checking the version mentioned. If it is greater than 2.0 then we can go on and make the change needed:

[email protected] [~]# /etc/init.d/httpd status
Apache Server Status for localhost
Server Version: Apache/2.2.13 (Unix) mod_ssl/2.2.13
....

The change itself, is very easy to make but requires two steps. Step one is to open up /usr/local/apache/conf/httpd.conf and make the following additions (I make them typically right after the top comment in the file:

ServerLimit NEW_MAX_CONNECTIONS
MaxClients NEW_MAX_CONNECTIONS

Where NEW_MAX_CONNECTIONS is the new max connections level you would like. Now step 1 is complete. Step 2 is incredibly important as well. You must run the following command to distill your changes to the file:

/usr/local/cpanel/bin/apache_conf_distiller --update

Without running that command, your changes will not be distilled and the next time apache is rebuilt, your changes will be lost. Finally, lets restart Apache and run status again to see if the change is committed. If you see more lines then previously, you now have more allowed connections!

Thank you for reading and stay tuned!

Common Issues – Easyapache failing

Figured my “Common Issues” posts this week would be a little more specific and simple then the last few. This is an issue i’ve been noticing a new issue off and on with servers recently where easyapache will not work and fails with the following error:

[email protected] [~]# /scripts/easyapache
Acme::Spork version v0.0.8 required--this is only version v0.0.7  at /var/cpanel/perl/easy/Cpanel/Easy/Utils/BackGround.pm line 14.
BEGIN failed--compilation aborted at /var/cpanel/perl/easy/Cpanel/Easy/Utils/BackGround.pm line 14.
Compilation failed in require at (eval 18) line 3.
 ...propagated at /usr/lib/perl5/5.8.8/base.pm line 85.
 at (eval 16) line 3
 at /var/cpanel/perl/easy/Cpanel/Easy.pm line 15
BEGIN failed--compilation aborted at /var/cpanel/perl/easy/Cpanel/Easy.pm line 15.
Compilation failed in require at (eval 1) line 3.
 ...propagated at /usr/lib/perl5/5.8.8/base.pm line 85.
BEGIN failed--compilation aborted at /var/cpanel/perl/easy/Cpanel/Easy/Apache.pm line 8.
Compilation failed in require at /scripts/easyapache line 23.

In order to repair this, all you must do is install the Acme::Spork version v.0.0.8 that it requests. To do that just use the following commands:

[email protected] [~]# perl -MCPAN -e shell
cpan> install Acme::Spork

(Note: “cpan>” is a shell prompt, not part of the command)

This solves the issue with easyapache and allows you in. Please let me know if you have any issues with this solution, please post in the comments so all can benefit from any questions.