You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sravan Suryadevara <sr...@gmail.com> on 2010/06/10 09:30:20 UTC

Running Perl in Tomcat

Hi,

So I'm trying run a perl script within tomcat. Since I need to run
only one script, I figured itd be easier to just include it in tomcat
than install Apache HTTP server.
I'm currently using Tomcat 6.0.26 on CentOS 5. I'm using port 8100
(has worked before the cgi stuff), and my webapp is running from ROOT.

I followed the howto at
http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html and uncommented
the CGI servlet section and the servlet mapping.

Then I did made a new directory under
$CATALINA_HOME/webapps/ROOT/WEB-INF/ called cgi-bin.
Placed my script.cgi file in $CATALINA_HOME/webapps/ROOT/WEB-INF/cgi-bin

Then restarted tomcat. There are two problems:
1. http://localhost:8100/cgi-bin/script.cgi gives me a 404 saying
requested resource() is not available.
2. Another one of my html files does not load (it uses javascript) but
it has loaded before. My main html file still loads but that specific
one gives me a 404 as well.

I've been playing with different tutorials and things, but none seem
to be fixing this. Please help as quickly as you can.


Sincerely,
Sravan Suryadevara

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


Re: Running Perl in Tomcat

Posted by Sravan Suryadevara <sr...@gmail.com>.
Okay, after looking through the logs, I decided to check my web.xml
and context.xml files, so I realized that the servlet mapping included
for the CGI Servlet, maps to within the ROOT directory (where my
webapp is sitting). I also had to put the script in ROOT/WEB-INF/cgi.
So now it's working.

Thanks for the help,
Sravan


On Thu, Jun 10, 2010 at 2:40 PM, Pid <pi...@pidster.com> wrote:
> On 10/06/2010 09:54, Sravan Suryadevara wrote:
>>> "Only Contexts which are marked as privileged may use the CGI servlet"
>>>
>>> Did you mark the context as privileged?
>>>
>>>  http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
>>
>> I have, in conf/context.xml. Since I'm only running one app I figured
>> it wouldn't really be terrible if it was global.
>
> Have you tried setting it on the individual context?
>
> Are there any log messages of note, complaining about an error?
>
>
> p
>
>> Btw, the other html file is loading, I just named the link wrong on
>> one of the other pages.
>>
>> Sorry, about the urgency, now I know better.
>>
>> Thanks,
>> Sravan Suryadevara
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
>

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


Re: Running Perl in Tomcat

Posted by Pid <pi...@pidster.com>.
On 10/06/2010 09:54, Sravan Suryadevara wrote:
>> "Only Contexts which are marked as privileged may use the CGI servlet"
>>
>> Did you mark the context as privileged?
>>
>>  http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
> 
> I have, in conf/context.xml. Since I'm only running one app I figured
> it wouldn't really be terrible if it was global.

Have you tried setting it on the individual context?

Are there any log messages of note, complaining about an error?


p

> Btw, the other html file is loading, I just named the link wrong on
> one of the other pages.
> 
> Sorry, about the urgency, now I know better.
> 
> Thanks,
> Sravan Suryadevara
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 



Re: Running Perl in Tomcat

Posted by Sravan Suryadevara <sr...@gmail.com>.
> "Only Contexts which are marked as privileged may use the CGI servlet"
>
> Did you mark the context as privileged?
>
>  http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

I have, in conf/context.xml. Since I'm only running one app I figured
it wouldn't really be terrible if it was global.


Btw, the other html file is loading, I just named the link wrong on
one of the other pages.

Sorry, about the urgency, now I know better.

Thanks,
Sravan Suryadevara

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


Re: Running Perl in Tomcat

Posted by Pid <pi...@pidster.com>.
On 10/06/2010 08:30, Sravan Suryadevara wrote:
> Hi,
> 
> So I'm trying run a perl script within tomcat. Since I need to run
> only one script, I figured itd be easier to just include it in tomcat
> than install Apache HTTP server.
> I'm currently using Tomcat 6.0.26 on CentOS 5. I'm using port 8100
> (has worked before the cgi stuff), and my webapp is running from ROOT.
> 
> I followed the howto at
> http://tomcat.apache.org/tomcat-6.0-doc/cgi-howto.html and uncommented
> the CGI servlet section and the servlet mapping.

"Only Contexts which are marked as privileged may use the CGI servlet"

Did you mark the context as privileged?

 http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

> Then I did made a new directory under
> $CATALINA_HOME/webapps/ROOT/WEB-INF/ called cgi-bin.
> Placed my script.cgi file in $CATALINA_HOME/webapps/ROOT/WEB-INF/cgi-bin
> 
> Then restarted tomcat. There are two problems:
> 1. 

http://localhost:8100/cgi-bin/script.cgi gives me a 404 saying
> requested resource() is not available.
> 2. Another one of my html files does not load (it uses javascript) but
> it has loaded before. My main html file still loads but that specific
> one gives me a 404 as well.

That's unfortunate.  It's probably unrelated, but as you didn't provide
any more information we can't help you with that.


> I've been playing with different tutorials and things, but none seem
> to be fixing this. 

> Please help as quickly as you can.

Please read: "urgency"

 http://www.catb.org/~esr/faqs/smart-questions.html


p

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