AWS The Timeout Specified Has Expired

A CRAZY error was appearing on my AWS EC2 apache server log. So I tried to work out why it was happening and fix it.

AWS EC2 apache server log

SOLUTION: See section below on extension=apc.so

sudo /opt/bitnami/ctlscript.sh restart

STOP INSTANCE

START INSTANCE

$ sudo apt-get update

$ sudo apt-get install unzip

$ sudo apt-get install libwww-perl libdatetime-perl

curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -O
unzip CloudWatchMonitoringScripts-1.2.1.zip
rm CloudWatchMonitoringScripts-1.2.1.zip
cd aws-scripts-mon

cd aws-scripts-mon

./mon-put-instance-data.pl –mem-util –verify –verbose

AWS EC2 apache server log

ec2 error proxy_fcgi:error”
“EC2 disable APC extension”

AWS EC2 apache server log

/opt/bitnami/php/etc
vi php.ini
Go to the bottom of the file (capital G if you don’t use vi regularly, and press i to begin inserting code)
Comment out the line about “extension=apc.so”
Write in a line about “extension=xcache.so”

Save and quit by pressing Esc -> :wq (enter)
type in “sudo /opt/bitnami/ctlscript.sh restart”

WORKED!!!

But then its down again… 20 min later…

AWS EC2 apache server log

“linux Disable php_fpm”

ps aux | grep php

AWS EC2 apache server log

Changed maxChild and maxWorkers to 50 (from 5)

apt-get install php5-fpm

apt-get remove libapache2-mod-php5

References:

Sam Deering is a web developer from England (currently living in Australia). In his spare time he enjoys coding, playing chess, reading and investing.

Leave a Reply

Your email address will not be published. Required fields are marked *