Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Jan 20, 2011 8:54 pm 
Offline
Senior Member

Joined: Wed Jun 16, 2010 8:22 pm
Posts: 61
Website: http://www.kevinmccaughey.org
Hi,

Could someone please briefly explain NGinx & Fastcgi as if you're technically minded 10 year old son just asked you please?

I'm in the midst (been at it 2 weeks now) of getting to grips with installing it and I just realised that I don't really know what it is.

Thanks if you can spare the time :)

TT


Top
   
 Post subject: its magic
PostPosted: Thu Jan 20, 2011 9:04 pm 
Offline
Junior Member

Joined: Tue Jul 13, 2010 8:28 pm
Posts: 28
nginx is a webserver, much like apache, lighttpd and cherokee are webservers. They listen to requests for information from the outside world and usually send back the requested information.


fastcgi is a protocol that works on the backend that connects your interpretor of choice with the webserver. Because the webserver usually doesn't do the job of interpreting your code (well, with mod_php|perl|foo it does, but that's another story and a bad idea), something needs to execute your app code. Fastcgi is the method in which your app communicates this information with your webserver.


Top
   
PostPosted: Thu Jan 20, 2011 9:09 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
tentimes wrote:
Could someone please briefly explain NGinx & Fastcgi as if you're technically minded 10 year old son just asked you please?

Fastcgi is a protocol to hand off a request from a web server to another process to execute it, and to communicate back the result to be sent by the original server to the client. By allowing that second process to remain running it is more efficient than traditional CGI which had to execute a new child process for each request.

In terms of mental model, it pretty much works just like a normal web proxy but using its own protocol rather than HTTP.

-- David


Top
   
 Post subject:
PostPosted: Fri Jan 21, 2011 3:49 pm 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
Quote:
(well, with mod_php|perl|foo it does, but that's another story and a bad idea)


Why is running mod_php a "bad idea"?


Top
   
 Post subject:
PostPosted: Fri Jan 21, 2011 4:24 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
waldo wrote:
Why is running mod_php a "bad idea"?


1. The PHP engine gets loaded even if Apache is only serving a tiny static file. This wastes RAM. You shouldn't have to run a 15MB process to serve 15KB files.

2. PHP scripts are executed with the same privileges as the web server. This leads to various security issues when you have more than one website on the same server, especially if those sites are administered by different people. Various stopgap measures such as open_basedir and safe_mode have been invented, but they're nowhere near as secure as running a separate FastCGI process.

3. Because PHP is not thread-safe, mod_php prevents the use of mpm_worker, which is the officially preferred multiprocessing model for recent versions of Apache.

These things probably don't matter, though, if you only have one site on your server (or a bunch of sites all administered by you) and you don't have a lot of visitors.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group