Perl/Cgi in Tomcat 5.5
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
What am I possibly missing?
I did:
1) I installed Tomcat on my PC.
2) In file
/cygdrive/c/Program Files/Apache Software Foundation/Tomcat 5.5/conf/web.xml
* I uncommented
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>6</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>
* in <!-- The mapping for the CGI Gateway servlet -->
I did:
<!-->
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*.cgi</url-pattern>
</servlet-mapping>
<-->
3) in
c/Program Files/Apache Software Foundation/Tomcat 5.5/server/lib
mv servlets-cgi.renametojar servlets-cgi.jar
4) in c/Program Files/Apache Software Foundation/Tomcat 5.5/server/webapps/host-manager/WEB-INF/cgi
I created file test.cgi and geve it chmod 777 permission
5) restarted tomcat
6) link
http://localhost:8080/cgi-bin/test.cgi
returns: The requested resource (/cgi-bin/test.cgi) is not available.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Please check your private messages.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
If you want to keep it there, you'll need to adjust your URL to point to that app.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Ben Souther:
You put your script into the host-manager application.
If you want to keep it there, you'll need to adjust your URL to point to that app.
Could you tell me how. I tried several approaches but failed.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Ben Souther:
Before I can do anything, you'll need to check your private messages and take care of the matter mentioned in there.
Just did it, so, if possible could you help.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
In Tomcat, each is located inside the tomcat/webapps directory.
Each application (or context) can be accessed by adding the contextPath to the end of the domain.
Example:
http://localhost:8080/myContextPath
Inside the webapps directory is a special folder named ROOT.
This is the root web application for the container.
If you just want to try running one JSP, HTML page, or in your case, a CGI script, put it inside the ROOT directory.
Example:
If you put a page named hello.html in:
tomcat/webapps/ROOT/
You could access it with the following URL:
http://localhost:8080/hello.html
I haven't done much with the CGI servlet that ships with Tomcat but this should be enough to enable you to reach it with a browser.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Ben Souther:
Servlet containers support the concept of web applications.
In Tomcat, each is located inside the tomcat/webapps directory.
Each application (or context) can be accessed by adding the contextPath to the end of the domain.
Example:
myContextPath[/b]]http://localhost:8080/myContextPath
Inside the webapps directory is a special folder named ROOT.
This is the root web application for the container.
If you just want to try running one JSP, HTML page, or in your case, a CGI script, put it inside the ROOT directory.
Example:
If you put a page named hello.html in:
tomcat/webapps/ROOT/
You could access it with the following URL:
http://localhost:8080/hello.html
I haven't done much with the CGI servlet that ships with Tomcat but this should be enough to enable you to reach it with a browser.
Thank you very much for your help. So far I used our unix servers whith Tomcat and now decided to install it myself on my computer.
http://localhost:8080/hello.html (located in ROOT) works fine which most probably means that tomcat, java and env variables are set correctly, right?
However http://localhost:8080/cgi-bin/ is not seen, although it seems that I correctly modified
c/Program Files/Apache Software Foundation/Tomcat 5.5/conf/web.xml
BTW am I right that I start and stop Tomcat with:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5w.exe
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by viktor boulg:
...
BTW am I right that I start and stop Tomcat with:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5w.exe
If you've installed with the '.exe' version of the installer, you should use the start menu items or the Window's Services panel.
Otherwise, you should use tomcat/bin/startup.bat from the command line.
I've never worked with the CGI Servlet so I'm not sure what else needs to be done to get it going.
Out of curiosity, why are you using Tomcat for a Perl application?
That's usually done with the Apache Web Server.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have uncommented the sections from web.xml. and rename the jar also.
When i'm running the at following path.
http://127.0.0.1:8080/work/cgi/Hello.cgi
It is displaying what is written in the script.
echo "Hello World!"
Please let me know what i'm missing. Seems as system is not recognizing it as cgi script.
Regards,<br />Pul_Mal
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Thanks in advance.
Regards,<br />Pul_Mal
| No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |











