tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: CGI script to work on Tomcat
Date Fri, 20 Jun 2014 20:51:01 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Rahul,

On 6/20/14, 3:10 PM, Rahul R wrote:
> This is from my conf/web.xml
> 
> <servlet> <servlet-name>cgi</servlet-name>
> 
> <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
>
> 
<init-param>
> <param-name>debug</param-name> <param-value>0</param-value> 
> </init-param> <init-param> <param-name>cgiPathPrefix</param-name>

> <param-value>WEB-INF/cgi</param-value> </init-param> <init-param>

> <param-name>passShellEnvironment</param-name> 
> <param-value>true</param-value> </init-param> <init-param> 
> <param-name>executable</param-name> 
> <param-value>perl</param-value> </init-param>
> 
> <load-on-startup>5</load-on-startup> </servlet>
> 
> 
> <servlet-mapping> <servlet-name>cgi</servlet-name> 
> <url-pattern>/cgi-bin/*</url-pattern> </servlet-mapping>
> 
> 
> Please let me know what do you mean by privileged usage.

https://tomcat.apache.org/tomcat-7.0-doc/cgi-howto.html

Since you have mapped the CGIServlet to /cgi-bin, then you will want
to have your HTML file (located in the webapp root) to reference
"/cgi-bin/read_toggle.cgi" as the action.

Note that the URL reference is mapped from the URL space
(/cgi-bin/read_toggle.cgi) into the webapp's resource space
(WEB-INF/cgi/read_toggle.cgi) which is why the paths don't appear to
match.

Finally, if the Perl script isn't that complicated, you should
consider re-writing it in Java since you are using a Java application
server. It will be much easier to deal with everything that way.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTpJ6zAAoJEBzwKT+lPKRYJHUP/0rhRGpRp0K+0wvDclh8zqlJ
QeX6sFeBtjroCtL716+BCdMW/hKnkPcQDElDvv5Rsh9A9CiRaC3iylUBhhk/wrZk
fjk3jeIKn5ZbiZXYBr4tg3Ut1hE/JjRwyCYduol68GPxRmucdCGmkSqacTZJEa0B
p0QJW6Q1x2GCk6P76IjBiCvCLclawhm02m2PZr/wcpv+JHcursDU/AATdcj01DZS
/2vLn6ojEKYYrBxTIjW5KDkJlcoiEn5EbsxgrQR3Dug8s1U9qc3tFPMtEFJrbqbW
Q4IrF2VJ4i3d5pJW8HCNGGHmK7kyJC8JmlJ3sE9fslsv9QFJlohmA1UrE4dA5sbb
mzg6A/cl8/xn/+pBpv2lXHbitcaPMYxsLdreOdjDsz/dnG3raoOhQ6f5HAIxcb7h
+CGssuJt7lXk0jl+eeqF/30Sb7QV7kcrSpq9pOuCRLfjd63HVGSlAO3hanOqlNGe
zarVAt1Wv7ALtjk1ddFjb/saIM3YpvIkuebr351yYyvXA0ifTtLt7++xVYDXLEMP
F7Qq5anQ0gVbCRRf0hAm83fBFRaKJc9BU44H285NmPRlr8eEskequ9p79BnKqvJt
9oB7D0OSdmH5kvsmDxB0yTQS+0bGttpgjrK77acY71YC3QH/xm3hvqKvC7ZqwRqJ
SAtPIeuNpuemtTURTx7p
=QCZU
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message