This is a practical Apache, PHP-FPM and Nginx Reverse Proxy book that shows you how to build a lean & powerful Apache server with the high-performance PHP-FPM application server from scratch.
In other words, it starts from the basic OS (CentOS 6.6) and builds each software stack up from ground up using the ‘yum’ package manager.
It also covers the security aspects of Apache and PHP – e.g. Symlink vulnerabilities, reading the /etc/password file, reading another user’s private files with just a few lines of PHP codes. This book will provide the sample code to show you how exactly this is done on a non-secured server.
We will also cover some benchmark tests by using the ‘ab’ benchmarking tool to stress test various php-fpm configuration.
Finally, it will also cover a chapter on installing Nginx as a reverse proxy to enhance performance.
Download the source code for the fictitious Virtualhosts:
Apache PHP-FPM & Nginx Reverse Proxy Configuration Files
note: the default port is “80” – but if you’re planning to run Nginx as reverse proxy, then change the line:
<VirtualHost *:80> to <VirtualHost *:8080>
ponyvps.com
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName ponyvps.com
DocumentRoot /home/pony/www
ErrorLog /home/pony/logs/error_log
CustomLog /home/pony/logs/access_log common
<IfModule mod_fastcgi.c>
Alias /php-fpm /home/pony/cgi-bin/php-fpm
FastCgiExternalServer /home/pony/cgi-bin/php-fpm -socket /home/pony/cgi-bin/pony.sock -pass-header Authorization -idle-timeout 100
</IfModule>
</VirtualHost>
donkeyvps.com
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName donkeyvps.com
DocumentRoot /home/donkey/www
ErrorLog /home/donkey/logs/error_log
CustomLog /home/donkey/logs/access_log common
<IfModule mod_fastcgi.c>
Alias /php-fpm /home/donkey/cgi-bin/php-fpm
FastCgiExternalServer /home/donkey/cgi-bin/php-fpm -socket /home/donkey/cgi-bin/donkey.sock -pass-header Authorization -idle-timeout 100
</IfModule>
</VirtualHost>
Book Errata
This section is reserved for any updates or errata found.
Practical Apache, PHP-FPM & Nginx Reverse Proxy Newsletter
Stay in touch with book updates, erratas and latest news by subscribing below: