http://www.perlmonks.org?node_id=353039

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

I found this web page that shows how to run a Perl script on Tomcat. Check it out: Perl/Tomcat

I was wondering what would be the benefit of this? Especially if you benchmarked it against mod_perl. Does anyone have any input?

peppiv

another round over here. Please.

Replies are listed 'Best First'.
Re: Perl in Tomcat
by Tomte (Priest) on May 13, 2004 at 12:29 UTC

    I was wondering what would be the benefit of this? Especially if you benchmarked it against mod_perl.
    Reading the article and the documentation of the CGIServlet-class: There are no benefits other than to be able to have a stand-alone tomcat execute CGI-programs (perl, bash, c++, ... it doesn't really matter); now that could be a real benefit. But you'd be still better off (performance-wise at least) using apache/mod_perl.

    regards,
    tomte


    An intellectual is someone whose mind watches itself.
    -- Albert Camus

Re: Perl in Tomcat
by exussum0 (Vicar) on May 13, 2004 at 12:32 UTC
    You get the same benefit of running it in Apache as a CGI. That is all that's really happening here. It still needs to fork and all that performance lacking goodness. with mod_perl, you have the interpreter right there. Tomcat using CGI's is a convenience and that's about it.. it wasn't architected to be anymore than that.

Re: Perl in Tomcat
by inman (Curate) on May 13, 2004 at 12:58 UTC
    Tomcat is a Java Application Server not a web server. Tomcat is designed to compile, run and manage Java web applications. The HTTP connector that ships with Tomcat is good enough to get you going (build and test some JSP apps etc.) but is normally replaced by a full web-server build such as Apache.

    If you are working with both Java applications and Perl applications then installing and running the Tomcat/Apache combination will give you a better understanding of a building and managing a typical environment.

    Of course if Tomcat works out for you then that's OK too!

      Tomcat is a Java Application Server not a web server.
      No, tomcat is quite a web server just like apache2 is, and they both support not only HTTP, but other protocols. The differnce is, tomcat by default supports internally java. with mod_perl of course, apache internally supports perl.

        That depends on your definition of a web server. Tomcat can serve HTML pages and handle CGI but it's capabilities are limited compared to a fully loaded web server such as Apache that was designed to be a web server from the outset.

        Tomcat ships with a number of connectors of which one is an HTTP connector. While the Native Tomcat HTTP connector is great, it is limited in functionality compared to a full webserver like Apache. The documentation explains the capabilities and limitations. The documentation also describes why you would choose to implement Tomcat and Apache.

        A production Java application environment typically consists of a Java Application Server (e.g. Tomcat) paired with a full web server. This pairing leverages the strengths of both applications.