Well, butter my butt and call me a biscuit.  Accessing that URL works!

I think I can handle it from here.  Thanks again.

P.S.  Sorry for the nomenclature confusion, I'm really a chemist, not a 
computer programmer.


________________________________
From: Christopher Schultz <ch...@christopherschultz.net>
Reply-To: Tomcat Users List <users@tomcat.apache.org>
Date: Wed, 13 Jan 2010 10:37:56 -0500
To: Tomcat Users List <users@tomcat.apache.org>
Conversation: how do I enable CGI scripts in Tomcat 6?
Subject: Re: how do I enable CGI scripts in Tomcat 6?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert,

On 1/13/2010 9:25 AM, Grossman, Robert B wrote:
>     <servlet>
>         <servlet-name>cgi</servlet-name>
>         <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
>         <init-param>
>           <param-name>debug</param-name>
>           <param-value>1</param-value>
>         </init-param>
>         <init-param>
>           <param-name>cgiPathPrefix</param-name>
>           <param-value>WEB-INF/cgi-bin</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>
>
> (4) Our web app is in /home/aceorg/aceorg/DEV-2.2/. It has two
> branches, epoch-plugin/ and courseware/. epoch-plugin/web/WEB-INF/ now
> contains cgi-bin/, which contains many cgi scripts, including login.cgi.

Just to get some nomenclature straight: the term "branch" is meaningless
to the servlet specification. If that term has some internal meaning to
you, it does not to us. The directory /home/aceorg/DEV-2.2 is more
likely the appBase for a <Host> defined in Tomcat's conf/server.xml.
That means it's the directory used for auto-deployed WAR files and
directory-based webapps. The epoch-plugin and courseware "branches", as
you call them, are really independent webapps. You can tell because each
one of them has a separate WEB-INF/web.xml file.

> Most of our web app requires a login, so we are unable to point our
> browser to WEB-INF/cgi-bin/login.cgi directly.

If you have an executable file in WEB-INF/cgi-bin/login.cgi, then you
should be accessing it using this URL:

http://host/epoch-plugin/cgi-bin/login.cgi
and not
http://host/epoch-plugin/WEB-INF/cgi-bin/login.cgi

Note that you configured this explicitly in the CGIServlet (see above)
using the url-pattern of "/cgi-bin/*". There's no "WEB-INF" in that path.

> However, we do have a public access folder at
> epoch-plugin/web/public/, which a Web browser can access at
> http://domain/epoch-plugin/public/, so I made a symlink
> public/webmo/cgi-bin to point to WEB-INF/cgi-bin. When we point a
> browser to
> http://domain/epoch-plugin/public/webmo/cgi-bin/login.cgi, we see the
> text for WEB-INF/cgi-bin/login.cgi.

Your URL path for the CGIServlet is "/cgi-bin/*" not
"/public/webmo/cgi-bin/*", so the CGIServlet isn't being invoked. By
adding that symlink, you have allowed the DefaultServlet to serve the
raw bytes of the .cgi file, so you see the source code of your perl
script (or whatever).

Try removing the symlink and hitting this URL:

http://host/epoch-plugin/cgi-bin/login.cgi

What happens?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktN6NQACgkQ9CaO5/Lv0PBv7wCgv16UkUZM2edmPV5i9jvFQ6aV
o5EAn144Hb9S+ccbTUz7wSfNYkhRnibh
=gcZp
-----END PGP SIGNATURE-----

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



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

Reply via email to