It’s been no secret to us in the high-performance, web server in-crowd that NGINX (pronounced “engine-x”) has been taking the webhosting world by storm for the last several years; *sites like WordPress, Facebook, Hulu, Github, SourceForge and more have been offloading some or many functions onto NGINX. I had originally been exposed to NGINX whilst researching for a higher-performance web server that was 64-bit friendlier than Apache, and that was did not use single threads. Apache has an enormous memory footprint on 64-bit systems and is a single-threaded application.
NGINX is a very flexible HTTP server that can also serve as a reverse proxy, load balancer, caching server, and an IMAP/POP3 proxy. Unlike Apache, however, the configuration is a little bit more involved and can be a big change for Apache loyalists.
In this is example, NGINX will be configured as a full webserver with PHP support. My goal when conjuring this project was to make a pre-configured Community GSI on the GoGrid Exchange with as little modification as possible to ensure a “pure” environment. If you’re anything like me, you might tremble at the thought of even using a typical, pre-configured server with a LAMP stack; I personally like setting things up from scratch, but there’ve been plenty of situations where I would’ve preferred a pre-configured solution. Hopefully I can capture the essence of my intentions.
One thing I should note before I get started is that NGINX does not have a module for PHP the way Apache does; PHP must be run using the FastCGI methodology. Much like the way you would pass requests to a Java container or reverse proxy, so must we for PHP.
The first thing I should mention is that I’m using the EPEL and IUS repositories to for the latest versions of NGINX and PHP-FPM. IUS is the official repository for RHEL/CentOS as referenced by PHP.net. Using these 2 repositories will not alter any existing packages on your system.