On Wed, Nov 20, 2013 at 12:21 AM, Felipe <felipeh...@gmail.com> wrote:
> Neven, > First of all, I'd like to thank you for all the help. I can say I have > learned a great deal through this experience. To clarify, the choice of > using tomcat for this was not mine. I am trying to lend a hand to a > professor of mine. This specific exercise is in his Unix class. For some > reason he thinks tomcat or at least every time he mentioned this exercise > to me he made reference to apache tomcat, is meant to be used in the > exercise. The exercise is on hosting a web page with perl scripts/cgi. So > in his instructions it's clearly using apache on Ubuntu. So he mentioned to > Felipe, just wanted to make sure you are aware, there are two often confused Apache projects: Apache HTTP Server (webserver) - also referred just as 'Apache' - http://httpd.apache.org/ Apache Tomcat (Java appserver) - also referred just as 'Tomcat' - http://tomcat.apache.org/ Searching online, this seems like a very typical CGI programming project many universities use in their curriculum. Also, it seems the examples come from "Guide to UNIX Using Linux" by Michael Palmer (ISBN: 978-1-4188-3723-5) Thus, Tomcat is not the best web server to serve your CGI scripts, this is usually done using Apache (httpd server) - as Konstantin pointed out - using Tomcat will not give you the most optimal performance. However, if you insist working with Tomcat, here's how you do it: (Thanks Konstantin for pointing that out) You probably should update web.xml of your application and not the global CATALINA_HOME/conf/web.xml... You application then looks like this: /home/luis/tomcat/apache-tomcat-8.0.0-RC5/webapps/FelipeAppWithCgi: META-INF/context.xml (to make your application privileged) WEB-INF/web.xml (to define servlet and servlet mapping) WEB-INF/cgi/projects.cgi (your cgi script) WEB-INF/cgi/subparseform.lib (your cgi library) ProjectAnalysis.html (your html form) index.html (your welcome page that includes) Here's the dropbox link I created that works with Tomcat: https://www.dropbox.com/sh/c32ecuryj2mgb6i/-eC0FQOCbF There are two ways to deploy it: 1) As a unpackaged folder "FelipeAppWithCgi" - you need to get all the files and directory structure 2) As a packaged WAR file "FelipeAppWithCgi.war" (WAR is essentially a zip archive with certain directory structure) Ultimately, CGI is a very old technology that had its own share of performance (and security) problems. Usually, CGI scripts were replaced with superior Java Servlet technology (or some other better technology) and hence the need for Tomcat application server (servlet container). Hopefully, the rest of the mailing list members share my sentiments about the CGI :) me that he was having trouble with the exercise and asked if I maybe I had > any idea. I'm not in his class, but I love working in linux and more > importantly helping out wherever I can. So I took it upon myself to try to > learn the material in this exercise and re-write the instructions, but now > -once again thanks for all the help > No worries. Glad we could shed some light.