manishrathi has asked for the wisdom of the Perl Monks concerning the following question:

CGI is one way to make web page dynamic on the webserver. I can use java technologies to make web pages dynamic. But that involves use of web containers apart from webserver. Is there any other way, I can make webpage dynamic by using webserver only ? Or all the scripts on the server side are called CGI only and thats the only way to make webpages dynamic on webserver ? For all other technologies (java or .net), we have to use webcontainer or application server ?

Replies are listed 'Best First'.
Re: making dynamic web pages
by bv (Friar) on Dec 21, 2009 at 18:08 UTC

    That is basically correct. There is another option, FastCGI, which uses a socket connection between the web server and the application to communicate. Anything beyond that would probably depend on whether any particular web server offers dynamic page generation.


    print map{(split//,'hark, suPerJacent other l')[$_]}(11,7,6,16,5,1,15,18..23,8..10,24,17,0,12,13,3,14,2,4);
      For FastCGI protocol, how would that protocol be used ? If there are two protocols being used, which one will be used by the request. What I mean is, when a request comes in and if that needs dynamic creation of the webpage, which protocol will be used by the web server to transfer the request data to application if there are more than one protocols are available ?
      Or there can be only one protocal on the webserver at a time, so whenever a request needs to dynamically create a web page, only this protocal can transfer request data to the application ?
      Pls explain
        used by the web server to transfer the request data to application if there are more than one protocols are available

        like every software you, configuration

Re: making dynamic web pages
by Marshall (Canon) on Dec 21, 2009 at 18:56 UTC
    CGI stands for "Common Gateway Interface". All web pages deal with this protocol. The implementation language does not matter!! CGI is the way that web gizmos interact, that is pretty much it!
    Anyway CGI is a protocol, not a language and it is not Perl or Java specific.

    Perl is great at implementing dynamic web pages from the server end. By "dynamic", I assume you mean that the content of the web page that is sent to the user varies. This can be done in many languages, Perl and Java are just two of them.

    Do a "google" on CGI and you will see lots of links to explain this: http://hoohoo.ncsa.illinois.edu/cgi/ is an old link, but shows up at the top of the list. I looked at the Wiki entry for CGI and did not find it particularly satisfying although the reference links are good.

    There are all sorts of frameworks that enable Perl server applications to be written easier. There are server side tools that can improve the performance of both Java and Perl web applications (fastCGI for Perl is just one of them).

      Is there any other protocol available on webserver to deal with webpages for dynamic content other than CGI ? Does CGI protocol vary for diferent web servers ? Is CGI protocol available on web servers only ?
        Is there any other protocol available on webserver to deal with webpages for dynamic content other than CGI ?
        No! Not for static content either!

        CGI "Common Gateway Interface" is the protocol of how browsers talk to web servers.

        Can I define and use a different proprietary protocol between a client and a server? You betcha! Happens all the time. But this server won't be able to talk to clients on the web.

        Does CGI protocol vary for different web servers? No. Microsoft has their .aspx pages. And there are lots of complications of talking to a web server like that, but this is all done via CGI, "Common Gateway Interface".

        To read more about Microsoft pages: http://msdn.microsoft.com/en-us/library/ms972976.aspx. What happens with pages like this is that they send a whole lot of data identified as "View_state" and other things. As a browser, you have to send this back via POST. This all happens via the CGI protocol. The difference is only what you receive and what you need to send back + your additional information in the POST.

        What differences does it make? None will be any easier to understand than the most common one, CGI.
Re: making dynamic web pages
by Anonymous Monk on Dec 21, 2009 at 19:45 UTC
Re: making dynamic web pages
by Marshall (Canon) on Dec 22, 2009 at 01:14 UTC
    I think the discussion has gotten "off track".
    Please describe your application and what it is supposed to do.
    An example would be very helpful.
    You will get help to implement this application in Perl.