Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the big deal with CGI, WSGI, servlets and similar concepts?

Tags:

servlets

cgi

I was trying to understand CGI, WSGI, servlets and similar stuff. After reading, it seems CGI is just a way for server to run scripts and send its output instead of some static web page.

1) I don't understand what's the big deal here? It is just running a script and showing its output, right? Why do we have to give it a big name like "Common gateway interface"?

2) This brings another questions i.e. do all the web frameworks like django, drupal run their python and php files through cgi/wsgi/mod_php and similar interfaces? Again, why do we have to give names like cgi, wsgi when we run a script on a server?

3) It seems servlet is also a script running on a web server (just it is in java). Why another name for the same thing? Or is it different to CGI?

Thanks. I googled and researched a lot before asking and couldn't find satisfying answers.

like image 472
jd12345 Avatar asked Nov 01 '22 01:11

jd12345


1 Answers

Well, it seems you haven't googled and researched enough. Especially not for history of web application development.

Web development hasn't been born yesterday, the standards (and names) haven't been revealed by some godly entity. People tried different ways to get the same (or simillar) things working, and the Common Gateway Interface has been a specification aimed to standardize the things a bit. And well, in that times, 20+ years ago, Internet (and web development) was mainly an academic business, and the scholars love "big" names (well, marketing people love them even more).

And as for servlets, in the Java world (which has been always a bit specific), there had been applets for the client (browser) side tasks, thus the thing for the server-side tasks became the name servlet.

There is a lot more to add, you have to read about how things have evolved, not just how they are now.

like image 119
Jozef Chocholacek Avatar answered Nov 08 '22 08:11

Jozef Chocholacek