Tutorial VPS Centos how to install nginx PHP5 FastCGI Webserver

What’s FastCGI source fastcgi.com
FastCGI is simple because it is actually CGI with only a few extensions.
Like CGI, FastCGI is also language-independent. For instance, FastCGI provides a way to improve the performance of the thousands of Perl applications that have been written for the Web. Like CGI, FastCGI runs applications in processes isolated from the core Web server, which provides greater security than APIs. (APIs link application code into the core Web server, which means that a bug in one API-based application can corrupt another application or the core server; a malicious API-based application can, for example, steal key security secrets from another application or the core server.)

lets begin to see tutorial how to install nginx and fastcgi webserver

add EPEL repo to your centos

installation nginx to centos with yum command
# yum install nginx -y

nginx configuration file

Default config file: /etc/nginx/nginx.conf
Default SSL config file: /etc/nginx/conf.d/ssl.conf
Default virtual hosting config file: /etc/nginx/conf.d/virtual.conf
Default documentroot: /usr/share/nginx/html

Configure PHP As FastCGI

Install spawn-fcgi simple program for spawning FastCGI processes

Next, download spawn-fcgi init.d shell script:

Start php app server, enter:

By default php server listens on port. Finally, update /etc/nginx/nginx.conf as follows:

Modify / append as follows:

Save and close the file. Restart nginx:

Create /usr/share/nginx/html/test.php as follows:

Although FastCGI cannot duplicate the universality of CGI overnight, the FastCGI developers are committed to propagating FastCGI as an open standard. To that end, free FastCGI application libraries (C/C++, Java, Perl, Tcl) and upgrade modules for popular free servers (Apache, ISS, Lighttpd) are available.
Like CGI, FastCGI is not tied to the internal architecture of any Web server and is therefore stable even when server technology changes. An API reflects the internal architecture of a Web server, so when that architecture changes, so does the API.

Leave a Reply

Your email address will not be published. Required fields are marked *