CGI execution problem on Unix


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers CGI execution problem on Unix
# 1  
Old 05-27-2009
CGI execution problem on Unix

Hello everyone,

I have developed a cgi application on windows. i have created a folder in webapps of tomcat, within that a WEB-INF folder and in that cgi folder.
This cgi folder contains one executable. The web.xml is as follows:
Code:
<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>cmd /c</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>

now when i run this executable from the url it runs.
I want to do this same thing in unix but this is not working. for unix i have changed the above xml as follows:

Code:
           <init-param>
		  <param-name>executable</param-name>
		  <param-value>/bin/ksh -c</param-value>
	    </init-param>

the rest is same. Can someone plz help me wit dis????

Last edited by Yogesh Sawant; 05-27-2009 at 05:22 PM.. Reason: added code tags
# 2  
Old 05-28-2009
Is there anything left in the Tomcat error log, and what exactly is not working? You saw code displayed or got some kind of internal server error page?
# 3  
Old 05-28-2009
Hi

actually i am getting HTTP Status 404 - description The requested resource () is not available.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

UNIX network programming execution problem

I have started reading the book Unix Network Programming, Volume 1: The Sockets Networking API. I downloaded all the source code and performed all the steps present in README file.Now when i compile my first program it give the following error. sainandan@nandan:~/unpv13e/intro$ ./daytimetcpcli... (1 Reply)
Discussion started by: bsainandan
1 Replies

2. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

3. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

4. Shell Programming and Scripting

Execution problem unix commands in Perl CGI

I am trying to run SSH , mkdir and other unix commands using Perl CGI. But i am not able to Execute these commands. Please help me out !!!! SSH and mkdir is necessity for me. I will be thankful to you...!!!!! I am trying like: In perl CGI file i am writing like: @list = `ssh... (28 Replies)
Discussion started by: Navrattan Bansa
28 Replies

5. UNIX for Dummies Questions & Answers

Problem with CGI Script

Hello, I had to move our company's intranet to a new machine running Centos 5. Whenever cgi scripts now execute I find this error message in the logs: Mon Oct 05 11:19:39 2009] Premature end of script headers: vacation.cgi, referer: https:/{URL}] Could not find platform independent... (0 Replies)
Discussion started by: mojoman
0 Replies

6. Shell Programming and Scripting

problem for CGI create Cookie!!!!

Hi Everyone, I am facing the problem to create the cookie in CGI (bash script). Is it possible can create in cgi? or javascript better? Anyone got the sample to create the cookie in cgi(bash script)? Just the login will do ->> USERNAME and PASSWORD after create how to store into the... (2 Replies)
Discussion started by: ryanW
2 Replies

7. UNIX for Dummies Questions & Answers

mail script problem using cgi

dear all i've try several scripts and i think this is the simplest scripts that i can understand. please see below:- if ($num >= 4000000001) { #use CGI; #my $query = new CGI; #my $sendmail = "/usr/sbin/sendmail -t"; #my $reply_to = "bla@bla.com"; #my $subject =... (1 Reply)
Discussion started by: unknown2205
1 Replies

8. Shell Programming and Scripting

CGI problem

1. I need CGI in my own server. plz tell me how do it ? 2. U know somethink FREE servers with CGI ? thanks cYa (2 Replies)
Discussion started by: kezzol
2 Replies

9. UNIX for Dummies Questions & Answers

HTML-CGI on Unix

AAAHHH!! I've made a perl program that you can run on a web browser. This program needs to be run everyday, and I don't want to have to run it everyday. The problem is when I try running the program from my terminal, all it does is print stuff to the terminal page (the program involves a lot of... (4 Replies)
Discussion started by: sstevens
4 Replies

10. UNIX for Dummies Questions & Answers

UNIX CGI script

Hey everyone! I hope someone here is good with Unix CGI scripts. I'm having trouble with my CGI. Here's the deal I've created a program that searches the passwd file and cuts the users real name when it's given the login name. When i converted it to CGI i ran into some problems: 1) when you... (3 Replies)
Discussion started by: primal
3 Replies
Login or Register to Ask a Question