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

net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6=1

ntsysv
enable memcache

reboot

ab -n 500 -c 10 http://192.168.10.110/

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

CGROUP_DAEMON="cpu:/limitcpu"

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

CGROUP_DAEMON="cpu:/limitcpu"


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

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


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

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

ExtendedStatus On

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


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

ServerName drupal.localdomain

<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

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

service httpd stop

nano /etc/hosts

drupal.localdomain

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 http://192.168.10.110/drupal/

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

switch to event module

ab -n 500 -c 10 http://192.168.10.110/drupal/