Thanks - I'll give it a try. 

-----Original Message-----
From: Mark Thomas [mailto:[EMAIL PROTECTED] 
Sent: 18 February 2005 19:51
To: Tomcat Users List
Subject: Re: CGI

There is another option. You can change the CGI servlet mapping to use
extension mapping. If you map it to *.cgi or *.pl or whatever you use on
your system, CGI scripts in the 'normal' web app path should be served
by the CGI servlet.

Mark

Kelly, Steve wrote:
> Hi Mark,
> 
> Yes, thanks. That confirms what I'm seeing. Only problem is I have 
> some freebie product (the Spellchecker plugin for HTMLArea) that needs

> to execute a perl script to call the Aspell spell checker, which gets 
> invoked from somewhere inside the plugin's javascript I believe using 
> some form of relative addressing. Does this mean I either need to edit

> the javascript or I can't do it ?
> 
> Steve.   
> 
> -----Original Message-----
> From: Mark Thomas [mailto:[EMAIL PROTECTED]
> Sent: 18 February 2005 19:28
> To: Tomcat Users List
> Subject: Re: CGI
> 
> Kelly, Steve wrote:
> 
>>Hi,
>> 
>>Is the following consistent with how CGI perl scripts should execute 
>>under a tomcat webapp?
>> 
>>I have a webapp called mywebapp and a perl script called myperl The 
>>web.xml file contains the following:
>> 
>>      <servlet>
>>        <servlet-name>cgi</servlet-name>
>> 
>><servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
>>        <init-param>
>>          <param-name>clientInputTimeout</param-name>
>>          <param-value>100</param-value>
>>        </init-param>
>>        <init-param>
>>          <param-name>debug</param-name>
>>          <param-value>6</param-value>
>>        </init-param>
>>        <init-param>
>>          <param-name>executable</param-name>
>>          <param-value>perl</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>
>>         
>>and
>> 
>>    <servlet-mapping>
>>        <servlet-name>cgi</servlet-name>
>>        <url-pattern>/cgi-bin/*</url-pattern>
>>    </servlet-mapping>
>> 
>>If I enter the url //localhost:8080/mywebapp/WEB-INF/cgi/myperl I get 
>>a "resource unavailable" error.
> 
> 
> Correct. Resources under WEB-INF are not directly accessible.
> 
> 
>>If I enter the url //localhost:8080/mywebapp/cgi-bin/myperl it 
>>executes the myperl script successsfully.
> 
> 
> Also correct.
> 
> 
>> 
>>If I edit the web.xml file to change the cgiPathPrefix to, for 
>>example, myscripts/cgi and then I enter the url 
>>//localhost:8080/mywebapp/myscripts/cgi/myperl it simply displays the 
>>perl script code.
> 
> 
> This is as expected for the configuration settings. However, I 
> wouldn't want to run my server like this. It is usually a bad thing 
> (tm) from a security point of view to expose your CGI script.
> 
> 
>>Again if I enter the url //localhost:8080/mywebapp/cgi-bin/myperl it 
>>executes the myperl script successsfully.
> 
> 
> Also, as expected from the config settings.
> 
> HTH,
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to