Installing Nginx with PHP-FPM on a Linux server
Nginx (pronounced as Engine-x) is a high performance web server,reverse proxy, mail proxy server which was originally written by Igor Sysoev in 2005. Here we discuss about setting up a very basic nginx web server on your Linux server , capable of parsing php pages.
Installing Nginx on your Linux server
Installing nginx on your Linux server is very simple and even on the first try itself, you will not face any difficulties.
The steps that i have followed on my first nginx installation are given bellow (of course with the help of others tutorials and other resources available from net)
#(Change directory to /usr/local/src [ its a good practice to download and compile software's from /usr/local/src ] ) cd /usr/local/src #(download nginx source from "nginx.org") wget http://nginx.org/download/nginx-0.8.33.tar.gz #(Extract the source file ) tar -xzf nginx-0.8.33.tar.gz cd nginx-0.8.33 #Now configure Nginx , here we are using the 2 basic configuration options [ --sbin-path=/usr/local/sbin #the nginx binary path ] [ --with-http_ssl_module #Enables https module ] ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
since you have included the –with-http_ssl_module there is a possibility of getting the following error ( at least i got this error on a fresh centos machine since no pcre libraries were pre-installed on the system)
checking for PCRE library in /usr/include/pcre/ ... not found checking for PCRE library in /usr/pkg/ ... not found checking for PCRE library in /opt/local/ ... not found ./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre= option.
If you get the above error while configuring nginx , please download pcre (Perl Compatible Regular Expressions) from “http://www.pcre.org/” and change the nginx configure command as given bellow

