Find source of memory issues
I'm therefore looking for a way to work out why Apache is running out of memory. Is it a certain website that is mis-configured, is it simply lots of traffic and I need to upgrade my plan (it'd be nice to know which website too), or something else. Any advice/steps to find the root cause would be much appreciated!
6 Replies
In either case, if you are running Apache >= 2.4, I recommend that you use php-fpm for PHP (Debian/Ubuntu package name "php5-fpm").
> You have not given any detail about your particular setup
I'm happy to provide any info you need, just tell me what and how
Considering
I can't work out what the PHP setup options are or which I'm running…
> I can't work out what the PHP setup options are or which I'm running…
Create a file called "info.php" in the root of your web server containing this line:
Then visit the address http://example.com/info.php
Your server will probably say "Server API: Apache 2.0 Handler" which means you are using mod-php.
apt-get install apache2 php5-fpm
a2enmod proxy
a2enmod proxy_fcgi
nano /etc/apache2/sites-available/000-default.conf
Insert this in appropriate place:
<filesmatch \.php$="">SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost/"</filesmatch>
DirectoryIndex index.php index.html index.htm
then restart apache:
service apache2 restart