hoopycat wrote:
Since you're running Ubuntu 12.04, you can use PHP-FPM to move PHP processing out of Apache. This is generally a very good idea.
Thanks. I'm giving it a shot, but I've misconfigured something. I've tried referring to the guides at
http://www.howtoforge.com/using-php5-fp ... -12.04-lts and
http://alexcabal.com/installing-apache- ... -maverick/. Here are the steps I used:
sudo apt-get install libapache2-mod-fastcgi php5-fpm php5
sudo a2enmod actions fastcgi alias
sudo service apache2 restart
sudo nano /etc/apache2/sites-available/dryang.org
inserted this between <VirtualHost *:80> and </VirtualHost>:
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
</IfModule>
-------------
Alternatively, I've also tried:
FastCgiExternalServer /srv/www/dryang.org/public_html/php5.external -host 127.0.0.1:9000
AddHandler php5-fcgi .php
Action php5-fcgi /usr/lib/cgi-bin/php5.external
Alias /usr/lib/cgi-bin/ /srv/www/dryang.org/public_html/
-------------
However, with either one, I still get "Server API: Apache 2.0 Handler." Can anyone pick out what mistake I've made? apache2ctl -M lists fastcgi_module (shared), so it seems that it's enabled, just not configured to be used.
ps aux shows that things are loaded up:
Code:
root 28362 0.0 0.7 77060 3928 ? Ss 16:07 0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
www-data 28363 0.0 0.6 77060 3120 ? S 16:07 0:00 php-fpm: pool www
www-data 28364 0.0 0.6 77060 3120 ? S 16:07 0:00 php-fpm: pool www
www-data 28365 0.0 0.6 77060 3120 ? S 16:07 0:00 php-fpm: pool www
www-data 28366 0.0 0.6 77060 3120 ? S 16:07 0:00 php-fpm: pool www
www-data 28528 0.0 0.7 31456 4044 ? S 16:34 0:00 /usr/sbin/fcgi-pm -k start
/var/log/php5-fpm.log shows:
Code:
[22-Jul-2012 16:08:00] NOTICE: fpm is running, pid 28362
[22-Jul-2012 16:08:00] NOTICE: ready to handle connections
Edit: Success! Thanks to heckman in IRC for pointing out that I needed to disable mod_php:
Code:
sudo a2dismod php5
Using the "Alternatively, I've also tried" lines and restarting Apache results in: Server API: FPM/FastCGI.
A-KO wrote:
Caching. Why load dynamic modules when the content you are generating is staying static? This should vastly improve page load times and reduce i/o, memory, and CPU footprints.
Yep, I'd love to implement additional caching, but I don't know which direction to turn to. Is there a specific implementation or guide that you can suggest?
Thank you for your help!