Testing the performance of Drupal 7 on Centos 6 powered by Apache 2.4 Event and PHP-FPM

Here is a quick tutorial where I install Apache 2.4 and PHP-FPM 5.6 into the virtual machine that I used in the previous related article called "Speeding up Drupal 7 on Centos 6 with Memcache APC and some modules". You should watch the video to get the full details of what I am doing, because this page is just mainly here to hold the commands that I will be using.

You can watch the video at: https://www.youtube.com/watch?v=D9fPQn66f24

nano /etc/sysctl.conf


enable memcache


ab -n 500 -c 10

yum install centos-release-scl
yum -y install httpd24 php56-php-fpm php56-php-opcache php56-php-pecl-uploadprogress php56-php-pecl-memcache php56-php-pdo php56-php-mysqlnd php56-php-mbstring php56-php-gd links

nano /opt/rh/httpd24/root/etc/sysconfig/httpd


nano /opt/remi/php56/root/etc/sysconfig/php-fpm


nano /opt/rh/httpd24/root/etc/httpd/conf.d/fcgi.conf

<FilesMatch \.php$>
  SetHandler "proxy:unix:/var/lib/apache2/fastcgi/www.socket|fcgi://localhost"

nano /opt/rh/httpd24/root/etc/httpd/conf.d/status.conf

<Location /server-status>
    SetHandler server-status
    Require host
    Require all granted

ExtendedStatus On

<Location /server-info>
    SetHandler server-info
    Require host
    Require all granted

nano /opt/rh/httpd24/root/etc/httpd/conf/httpd.conf

ServerName drupal.localdomain

<IfModule dir_module>
    DirectoryIndex index.php index.html

<Directory "/opt/rh/httpd24/root/var/www/html">
    AllowOverride All

service httpd stop

nano /etc/hosts


service httpd24-httpd start


nano /opt/remi/php56/root/etc/php-fpm.d/www.conf

listen = /var/lib/apache2/fastcgi/www.socket

listen.owner = apache
listen.group = apache


mkdir -p /var/lib/apache2/fastcgi
chown apache /var/lib/apache2/fastcgi

service php56-php-fpm start

You get an error.

audit2allow -w -a

audit2allow -a -M php-fpm

semodule -i php-fpm.pp

service php56-php-fpm start

error again

grep httpd_t /var/log/audit/audit.log | audit2allow -M php-fpm-again

semodule -i php-fpm-again.pp

ab -n 500 -c 10

nano /opt/rh/httpd24/root/etc/httpd/conf.modules.d/00-mpm.conf

switch to event module

ab -n 500 -c 10