RE: Trouble getting CGI script to execute
Thanks David. Question 1: Yes. I've made this mistake enogh times in the past that I'm pretty good about it now. Plus I have made other changes that required (and received) a Tomcat reboot after doing that name change. Question 2: That's a good thought... I've gone through the mappings and cannot find anything that would interfere with my cgi script Good thinking. Any other ideas? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: David Smith [mailto:[EMAIL PROTECTED] Sent: Wed 2/9/2005 6:02 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute I know I'm coming into this very late. I was hoping Mark was going to nail this on the head for you -- especially since I don't actually use the cgi-servlets piece in my stuff. But I also hate to see a problem like this get stalled. Question 1: This is a basic one, but I've had my share of Homer Simpson moments. Did you restart the server after renaming $CATALINA_HOME/server/lib/servlets-cgi.renametojar to $CATALINA/server/lib/servlets-cgi.jar and uncommenting the relevant parts of $CATALINA_HOME/conf/web.xml? Question 2: What do you have in your web.xml file for servlet mappings? It seems to me some kind of mapping is overriding the mappings in $CATALINA_HOME/conf/web.xml and simply offering the file from WEB-INF/cgi-bin/ rather than executing it. --David Brelsfoard, Alex wrote: Thanks I really appreciate your help. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 09, 2005 4:42 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Luckily this server is dedicated to this one application. And I have everything backed up. Though security is ALWAYS an issue, it's at least less of an issue on this server. If today's attempts do not get this woprking, I am most likely just going to turn off Tomcat's CGI abilities and then install Apache and just limit the heck out of it. Here is the CGI bits from the web.xml config file: snip This looks fine. I am afraid I have run out of ideas. If this was my system I would run up tomcat under a debugger and start stepping through code. It must be a configuration problem but I just can't figure out what. 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]
RE: Trouble getting CGI script to execute
No worries. I really appreciate any help I can get. I'm familiar with Apache, but I've just been tossed Tomcat and already have projects that need to be finished in a timely manner. Such is the life of our line of work... Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: Warron French [mailto:[EMAIL PROTECTED] Sent: Wed 2/9/2005 6:24 PM To: Tomcat Users List Subject: RE: Trouble getting CGI script to execute Sorry, hopefully I haven't misguided you. I don't know tomcat at all. I don't really know Jboss either, but eventually I will be learning it too. Warron French Sr. Network Engineer Xtria, LLC -Original Message- From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 4:00 PM To: Tomcat Users List Subject: RE: Trouble getting CGI script to execute OK, now we're getting somewhere. There was no entry for mime-type for file extension cgi. I added: mime-mapping extensioncgi/extension mime-typeapplication/x-httpd-cgi/mime-type /mime-mapping Which was not there before. Do I have the correct mime-type info there? When I go to my script (via the web) now it asks me to download the file. This mean something to someone? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Warron French [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:42 PM To: Tomcat Users List Subject: RE: Trouble getting CGI script to execute I use apache to enable cgi scripts, and I had the same problem as you. So, since I don't know Tomcat so well, I can offer you this. Check in your config file to make sure that you have the line(s): AddType application/x-httpd-cgi .cgi .sh .pl AddHandler cgi-script .cgi .sh .pl (I am not actually using this line but maybe you need to) Also, in my httpd.conf file I am using some directives and options such as: Directory /home/nrccwdt/public_html/ Options +Includes +ExecCGI XbitHack On /Directory I am sure you know how the Directory directive works, but make sure that you do have the Options +ExecCGI, and XbitHack On lines also. Good luck, Warron French Sr. Network Engineer Xtria, LLC -Original Message- From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:28 PM To: tomcat-user@jakarta.apache.org Subject: Trouble getting CGI script to execute I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble getting CGI script to execute
Ok. I may try to go through and try this setup myself to see what happens, but that won't happen until tonight. My boss seems to expect me to do some work for the department -- go figure. In the meantime, you may want to try removing the existing servlet mappings from your web application's web.xml file, reload the context and try the cgi script. If that works, we've found our gremlin. According to the servlet spec, nothing in the WEB-INF directory can be directly accessed by the client. That's what leads met to believe a servlet somewhere is handling the request and passing back the raw file. Does the app hide anything else in the WEB-INF folder (images, css, pages, etc., ...) and send it to the client on request? --David Brelsfoard, Alex wrote: Thanks David. Question 1: Yes. I've made this mistake enogh times in the past that I'm pretty good about it now. Plus I have made other changes that required (and received) a Tomcat reboot after doing that name change. Question 2: That's a good thought... I've gone through the mappings and cannot find anything that would interfere with my cgi script Good thinking. Any other ideas? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: David Smith [mailto:[EMAIL PROTECTED] Sent: Wed 2/9/2005 6:02 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute I know I'm coming into this very late. I was hoping Mark was going to nail this on the head for you -- especially since I don't actually use the cgi-servlets piece in my stuff. But I also hate to see a problem like this get stalled. Question 1: This is a basic one, but I've had my share of Homer Simpson moments. Did you restart the server after renaming $CATALINA_HOME/server/lib/servlets-cgi.renametojar to $CATALINA/server/lib/servlets-cgi.jar and uncommenting the relevant parts of $CATALINA_HOME/conf/web.xml? Question 2: What do you have in your web.xml file for servlet mappings? It seems to me some kind of mapping is overriding the mappings in $CATALINA_HOME/conf/web.xml and simply offering the file from WEB-INF/cgi-bin/ rather than executing it. --David Brelsfoard, Alex wrote: Thanks I really appreciate your help. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 09, 2005 4:42 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Luckily this server is dedicated to this one application. And I have everything backed up. Though security is ALWAYS an issue, it's at least less of an issue on this server. If today's attempts do not get this woprking, I am most likely just going to turn off Tomcat's CGI abilities and then install Apache and just limit the heck out of it. Here is the CGI bits from the web.xml config file: snip This looks fine. I am afraid I have run out of ideas. If this was my system I would run up tomcat under a debugger and start stepping through code. It must be a configuration problem but I just can't figure out what. 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Trouble getting CGI script to execute
Yeah, it's good thinking. But these are my only mappings: servlet-mapping servlet-namedefault/servlet-name url-pattern//url-pattern /servlet-mapping !-- The mapping for the JSP servlet -- servlet-mapping servlet-namejsp/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping !-- The mapping for the CGI Gateway servlet -- servlet-mapping servlet-namecgi/servlet-name url-pattern*.cgi/url-pattern /servlet-mapping Doesn't look like any overwriting here --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: David Smith [mailto:[EMAIL PROTECTED] Sent: Thu 2/10/2005 9:27 AM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Ok. I may try to go through and try this setup myself to see what happens, but that won't happen until tonight. My boss seems to expect me to do some work for the department -- go figure. In the meantime, you may want to try removing the existing servlet mappings from your web application's web.xml file, reload the context and try the cgi script. If that works, we've found our gremlin. According to the servlet spec, nothing in the WEB-INF directory can be directly accessed by the client. That's what leads met to believe a servlet somewhere is handling the request and passing back the raw file. Does the app hide anything else in the WEB-INF folder (images, css, pages, etc., ...) and send it to the client on request? --David Brelsfoard, Alex wrote: Thanks David. Question 1: Yes. I've made this mistake enogh times in the past that I'm pretty good about it now. Plus I have made other changes that required (and received) a Tomcat reboot after doing that name change. Question 2: That's a good thought... I've gone through the mappings and cannot find anything that would interfere with my cgi script Good thinking. Any other ideas? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: David Smith [mailto:[EMAIL PROTECTED] Sent: Wed 2/9/2005 6:02 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute I know I'm coming into this very late. I was hoping Mark was going to nail this on the head for you -- especially since I don't actually use the cgi-servlets piece in my stuff. But I also hate to see a problem like this get stalled. Question 1: This is a basic one, but I've had my share of Homer Simpson moments. Did you restart the server after renaming $CATALINA_HOME/server/lib/servlets-cgi.renametojar to $CATALINA/server/lib/servlets-cgi.jar and uncommenting the relevant parts of $CATALINA_HOME/conf/web.xml? Question 2: What do you have in your web.xml file for servlet mappings? It seems to me some kind of mapping is overriding the mappings in $CATALINA_HOME/conf/web.xml and simply offering the file from WEB-INF/cgi-bin/ rather than executing it. --David Brelsfoard, Alex wrote: Thanks I really appreciate your help. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 09, 2005 4:42 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Luckily this server is dedicated to this one application. And I have everything backed up. Though security is ALWAYS an issue, it's at least less of an issue on this server. If today's attempts do not get this woprking, I am most likely just going to turn off Tomcat's CGI abilities and then install Apache and just limit the heck out of it. Here is the CGI bits from the web.xml config file: snip This looks fine. I am afraid I have run out of ideas. If this was my system I would run up tomcat under a debugger and start stepping through code. It must be a configuration problem but I just can't figure out what. 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] - To unsubscribe, e
Re: Trouble getting CGI script to execute
Ok. Just completed this myself using Tomcat 5.5.7, JDK 5 on a Mandrake Linux system and got it to work right. Here's what I did from clean install: 1) Setup Tomcat -- there's tons of docs on this and no need to rehash things. 2) Renamed $CATALINA_HOME/server/lib/servlets-cgi.renametojar to $CATALINA_HOME/server/lib/servlets-cgi.jar. 3) Made two changes to the global web.xml at $CATALINA_HOME/conf/web.xml: a) Uncommented the servlet element for the cgi servlet b) Uncommented the servlet-mapping for the cgi servlet. i) I should mention here I added a parameter for my paricular test cgi script: init-param param-nameexecutable/param-name param-value/bin/bash/param-value /init-param c) Just a note: I would imagine this stuff could also be copy/pasted to your webapp's web.xml file instead. 4) Created a testapp directory in the webapps directory 5) Created a WEB-INF directory in the testapp directory 6) Created a cgi directory in the WEB-INF directory 7) Placed a very basic shell script in the cgi directory making sure execute privileges were set for it. 8) Wrote a minimal web.xml file essentially empty except for the DOCTYPE declaration, and a web-app root element. 9) Started Tomcat 10) Opened a browser and requested http://localhost:8080/testapp/cgi/hello-world.sh My very basic cgi (the blank line between the Content-type header and the rest is necessary): echo 'Content-type: text/html' echo '' echo '!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2 Final//EN' echo 'HTML' echo 'headtitleTest CGI script/title/head' echo 'bodyh3 align=centerHello World from the testapp CGI folder!!!/h3/body' echo '/HTML' echo '' I've seen the above howto for better or worse in a few places on the net. A quick google search should find something. The only real difference that I can see between my setup and yours, Alex, is the mapping. I used a mapping of /cgi as provided in the global web.xml file and you mapped yours with *.cgi. I don't know what kind of difference that makes except the path to the cgi might get real interesting. My suggestion would be to start over with an empty webapp and set it up as I described above. If it works, go back and look for differences between the broken app and the working one. Good luck. If this doesn't do it, I'm out of ideas. --David Brelsfoard, Alex wrote: Yeah, it's good thinking. But these are my only mappings: servlet-mapping servlet-namedefault/servlet-name url-pattern//url-pattern /servlet-mapping !-- The mapping for the JSP servlet -- servlet-mapping servlet-namejsp/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping !-- The mapping for the CGI Gateway servlet -- servlet-mapping servlet-namecgi/servlet-name url-pattern*.cgi/url-pattern /servlet-mapping Doesn't look like any overwriting here --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: David Smith [mailto:[EMAIL PROTECTED] Sent: Thu 2/10/2005 9:27 AM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Ok. I may try to go through and try this setup myself to see what happens, but that won't happen until tonight. My boss seems to expect me to do some work for the department -- go figure. In the meantime, you may want to try removing the existing servlet mappings from your web application's web.xml file, reload the context and try the cgi script. If that works, we've found our gremlin. According to the servlet spec, nothing in the WEB-INF directory can be directly accessed by the client. That's what leads met to believe a servlet somewhere is handling the request and passing back the raw file. Does the app hide anything else in the WEB-INF folder (images, css, pages, etc., ...) and send it to the client on request? --David Brelsfoard, Alex wrote: Thanks David. Question 1: Yes. I've made this mistake enogh times in the past that I'm pretty good about it now. Plus I have made other changes that required (and received) a Tomcat reboot after doing that name change. Question 2: That's a good thought... I've gone through the mappings and cannot find anything that would interfere with my cgi script Good thinking. Any other ideas? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: David Smith [mailto:[EMAIL PROTECTED] Sent: Wed 2/9/2005 6:02 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute I know I'm coming into this very late. I was hoping Mark was going to nail this on the head for you -- especially since I don't actually use the cgi-servlets piece in my stuff. But I also hate to see a problem like this get stalled. Question 1: This is a basic one, but I've had my share
RE: Trouble getting CGI script to execute
Luckily this server is dedicated to this one application. And I have everything backed up. Though security is ALWAYS an issue, it's at least less of an issue on this server. If today's attempts do not get this woprking, I am most likely just going to turn off Tomcat's CGI abilities and then install Apache and just limit the heck out of it. Here is the CGI bits from the web.xml config file: servlet servlet-namecgi/servlet-name servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class init-param param-nameclientInputTimeout/param-name param-value100/param-value /init-param init-param param-namedebug/param-name param-value6/param-value /init-param init-param param-namecgiPathPrefix/param-name param-valueWEB-INF/cgi/param-value /init-param load-on-startup5/load-on-startup /servlet . servlet-mapping servlet-namecgi/servlet-name url-pattern/cgi-bin/*/url-pattern /servlet-mapping Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 6:41 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: OK. I should have spotted this from your last post. Your context path should be path=/myapp NOT path=myapp Yeah, you're right. Oops. Thanks. 1 problem down. n to go... Script should be: /station/endeca/4.5.4/i86pc-linux/webapps/myapp/WEB-INF/cgi/script.cgi Good, this is where I put it originally. OK tried it Still asking me if I want to download the script Poop. This really bothers me. Since the cgi script is in the WEB-INF directory you should not be able to access it. I hope this is a config error but if I were you I would have some security concerns right now. Can you post the cgi parts of your web.xml as well please. I assume that has been modified too. Can you also check that ${CATALINA_HOME}/webapps/ROOT does not contain a directory called myapp. If it does - delete it. 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]
Re: Trouble getting CGI script to execute
Brelsfoard, Alex wrote: Luckily this server is dedicated to this one application. And I have everything backed up. Though security is ALWAYS an issue, it's at least less of an issue on this server. If today's attempts do not get this woprking, I am most likely just going to turn off Tomcat's CGI abilities and then install Apache and just limit the heck out of it. Here is the CGI bits from the web.xml config file: snip This looks fine. I am afraid I have run out of ideas. If this was my system I would run up tomcat under a debugger and start stepping through code. It must be a configuration problem but I just can't figure out what. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Trouble getting CGI script to execute
Thanks I really appreciate your help. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 09, 2005 4:42 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Luckily this server is dedicated to this one application. And I have everything backed up. Though security is ALWAYS an issue, it's at least less of an issue on this server. If today's attempts do not get this woprking, I am most likely just going to turn off Tomcat's CGI abilities and then install Apache and just limit the heck out of it. Here is the CGI bits from the web.xml config file: snip This looks fine. I am afraid I have run out of ideas. If this was my system I would run up tomcat under a debugger and start stepping through code. It must be a configuration problem but I just can't figure out what. 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]
Re: Trouble getting CGI script to execute
I know I'm coming into this very late. I was hoping Mark was going to nail this on the head for you -- especially since I don't actually use the cgi-servlets piece in my stuff. But I also hate to see a problem like this get stalled. Question 1: This is a basic one, but I've had my share of Homer Simpson moments. Did you restart the server after renaming $CATALINA_HOME/server/lib/servlets-cgi.renametojar to $CATALINA/server/lib/servlets-cgi.jar and uncommenting the relevant parts of $CATALINA_HOME/conf/web.xml? Question 2: What do you have in your web.xml file for servlet mappings? It seems to me some kind of mapping is overriding the mappings in $CATALINA_HOME/conf/web.xml and simply offering the file from WEB-INF/cgi-bin/ rather than executing it. --David Brelsfoard, Alex wrote: Thanks I really appreciate your help. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 09, 2005 4:42 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Luckily this server is dedicated to this one application. And I have everything backed up. Though security is ALWAYS an issue, it's at least less of an issue on this server. If today's attempts do not get this woprking, I am most likely just going to turn off Tomcat's CGI abilities and then install Apache and just limit the heck out of it. Here is the CGI bits from the web.xml config file: snip This looks fine. I am afraid I have run out of ideas. If this was my system I would run up tomcat under a debugger and start stepping through code. It must be a configuration problem but I just can't figure out what. 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]
RE: Trouble getting CGI script to execute
Sorry, hopefully I haven't misguided you. I don't know tomcat at all. I don't really know Jboss either, but eventually I will be learning it too. Warron French Sr. Network Engineer Xtria, LLC -Original Message- From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 4:00 PM To: Tomcat Users List Subject: RE: Trouble getting CGI script to execute OK, now we're getting somewhere. There was no entry for mime-type for file extension cgi. I added: mime-mapping extensioncgi/extension mime-typeapplication/x-httpd-cgi/mime-type /mime-mapping Which was not there before. Do I have the correct mime-type info there? When I go to my script (via the web) now it asks me to download the file. This mean something to someone? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Warron French [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:42 PM To: Tomcat Users List Subject: RE: Trouble getting CGI script to execute I use apache to enable cgi scripts, and I had the same problem as you. So, since I don't know Tomcat so well, I can offer you this. Check in your config file to make sure that you have the line(s): AddType application/x-httpd-cgi .cgi .sh .pl AddHandler cgi-script .cgi .sh .pl (I am not actually using this line but maybe you need to) Also, in my httpd.conf file I am using some directives and options such as: Directory /home/nrccwdt/public_html/ Options +Includes +ExecCGI XbitHack On /Directory I am sure you know how the Directory directive works, but make sure that you do have the Options +ExecCGI, and XbitHack On lines also. Good luck, Warron French Sr. Network Engineer Xtria, LLC -Original Message- From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:28 PM To: tomcat-user@jakarta.apache.org Subject: Trouble getting CGI script to execute I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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]
RE: Trouble getting CGI script to execute
I use apache to enable cgi scripts, and I had the same problem as you. So, since I don't know Tomcat so well, I can offer you this. Check in your config file to make sure that you have the line(s): AddType application/x-httpd-cgi .cgi .sh .pl AddHandler cgi-script .cgi .sh .pl (I am not actually using this line but maybe you need to) Also, in my httpd.conf file I am using some directives and options such as: Directory /home/nrccwdt/public_html/ Options +Includes +ExecCGI XbitHack On /Directory I am sure you know how the Directory directive works, but make sure that you do have the Options +ExecCGI, and XbitHack On lines also. Good luck, Warron French Sr. Network Engineer Xtria, LLC -Original Message- From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:28 PM To: tomcat-user@jakarta.apache.org Subject: Trouble getting CGI script to execute I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Trouble getting CGI script to execute
Virendra Agarwal wrote: I think you can run cgi script under Apache only when installed under cgi-bin subdir. Right, sorry, forgot to include that. I have placed the script in a cgi-bin folder. When I go to the folder that script is listed there in the directory listing. When I click on the file, that's when I get the contents of the script displayed on the screen like a txt file. Same thing happens if you type in the appropriate address fully. I have edited the part in the web.xml conf file referencing the cgi servlet to verify that the cgi-bin folder containing my script is being affected, and it is. Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:37 PM To: Brelsfoard, Alex Subject: Re: Trouble getting CGI script to execute In a message dated 2/8/2005 3:28:41 PM Eastern Standard Time, [EMAIL PROTECTED] writes: I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. I think you can run cgi script under Apache only when installed under cgi-bin subdir. Virendra Agarwal
Re: Trouble getting CGI script to execute
Exactly where did you put your script? If you follow http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html and use the defaults it is impossible to see the text of your script. Assuming you only uncommented the global web.xml and did not edit any of the settings, your script should be in: /WEB-INF/cgi/ and it is accessed through /yourcontext/cgi-bin/yourscript.cgi Mark Brelsfoard, Alex wrote: I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Trouble getting CGI script to execute
I do not have apache installed on this server. I was hoping to be able to do everything I want with just one server. I understand that if I cannot get this to work with Tomcat, then I will have to install apache as well. But I have to try. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:52 PM To: Brelsfoard, Alex Subject: Re: Trouble getting CGI script to execute In a message dated 2/8/2005 3:45:01 PM Eastern Standard Time, [EMAIL PROTECTED] writes: I have edited the part in the web.xml conf file referencing the cgi servlet to verify that the cgi-bin folder containing my script is being affected, and it is. cgi has nothing to do with tomcat or web.xml. You should be able to run cgi program from Apache without integrating Tomcat which is J2EE Servlet container. go to apache default port http://localhost:80/cgi-bin/prog
RE: Trouble getting CGI script to execute
OK, now we're getting somewhere. There was no entry for mime-type for file extension cgi. I added: mime-mapping extensioncgi/extension mime-typeapplication/x-httpd-cgi/mime-type /mime-mapping Which was not there before. Do I have the correct mime-type info there? When I go to my script (via the web) now it asks me to download the file. This mean something to someone? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Warron French [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:42 PM To: Tomcat Users List Subject: RE: Trouble getting CGI script to execute I use apache to enable cgi scripts, and I had the same problem as you. So, since I don't know Tomcat so well, I can offer you this. Check in your config file to make sure that you have the line(s): AddType application/x-httpd-cgi .cgi .sh .pl AddHandler cgi-script .cgi .sh .pl (I am not actually using this line but maybe you need to) Also, in my httpd.conf file I am using some directives and options such as: Directory /home/nrccwdt/public_html/ Options +Includes +ExecCGI XbitHack On /Directory I am sure you know how the Directory directive works, but make sure that you do have the Options +ExecCGI, and XbitHack On lines also. Good luck, Warron French Sr. Network Engineer Xtria, LLC -Original Message- From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:28 PM To: tomcat-user@jakarta.apache.org Subject: Trouble getting CGI script to execute I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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]
Re: Trouble getting CGI script to execute
You are heading in the wrong direction. You don't need to specify a mime-type. (Neither do you need Apache.) You have a simple configuration error. See my previous post. Mark Brelsfoard, Alex wrote: OK, now we're getting somewhere. There was no entry for mime-type for file extension cgi. I added: mime-mapping extensioncgi/extension mime-typeapplication/x-httpd-cgi/mime-type /mime-mapping Which was not there before. Do I have the correct mime-type info there? When I go to my script (via the web) now it asks me to download the file. This mean something to someone? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Warron French [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:42 PM To: Tomcat Users List Subject: RE: Trouble getting CGI script to execute I use apache to enable cgi scripts, and I had the same problem as you. So, since I don't know Tomcat so well, I can offer you this. Check in your config file to make sure that you have the line(s): AddType application/x-httpd-cgi .cgi .sh .pl AddHandler cgi-script .cgi .sh .pl (I am not actually using this line but maybe you need to) Also, in my httpd.conf file I am using some directives and options such as: Directory /home/nrccwdt/public_html/ Options +Includes +ExecCGI XbitHack On /Directory I am sure you know how the Directory directive works, but make sure that you do have the Options +ExecCGI, and XbitHack On lines also. Good luck, Warron French Sr. Network Engineer Xtria, LLC -Original Message- From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:28 PM To: tomcat-user@jakarta.apache.org Subject: Trouble getting CGI script to execute I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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]
RE: Trouble getting CGI script to execute
This is one area I was not entirely sure about. I did uncomment everything and did NOT change anything. I do not really have a ROOT url. I setup a /cgi-bin directory in server.xml. I then created a WEB-INF and cgi folders and placed my script in there. So the path to the file is /path/cgi-bin/WEB-INF/cgi/script.cgi And the URL: domain.com/cgi-bin/script.cgi Did I miss something here? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:55 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Exactly where did you put your script? If you follow http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html and use the defaults it is impossible to see the text of your script. Assuming you only uncommented the global web.xml and did not edit any of the settings, your script should be in: /WEB-INF/cgi/ and it is accessed through /yourcontext/cgi-bin/yourscript.cgi Mark Brelsfoard, Alex wrote: I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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]
Re: Trouble getting CGI script to execute
OK. Making progress. Can you try the following? (all steps included - even the ones you have already done) Once it works we can tweak it to give the configuration you want. These steps assume a default install. Create a directory $CATALINA_HOME/webapps/myapp/ Create a directory $CATALINA_HOME/webapps/myapp/WEB-INF Create a directory $CATALINA_HOME/webapps/myapp/WEB-INF/cgi Place your script called (script.cgi) in: $CATALINA_HOME/webapps/myapp/WEB-INF/cgi Uncomment the cgi stuff in $CATALINA_HOME/conf/web.xml Rename $CATALINA_HOME/server/servlets-cgi.renametojar to $CATALINA_HOME/server/servlets-cgi.jar Restart tomcat. Browse to http://host:port/myapp/cgi-bin/script.cgi Let me know what happens. Mark Brelsfoard, Alex wrote: This is one area I was not entirely sure about. I did uncomment everything and did NOT change anything. I do not really have a ROOT url. I setup a /cgi-bin directory in server.xml. I then created a WEB-INF and cgi folders and placed my script in there. So the path to the file is /path/cgi-bin/WEB-INF/cgi/script.cgi And the URL: domain.com/cgi-bin/script.cgi Did I miss something here? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:55 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Exactly where did you put your script? If you follow http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html and use the defaults it is impossible to see the text of your script. Assuming you only uncommented the global web.xml and did not edit any of the settings, your script should be in: /WEB-INF/cgi/ and it is accessed through /yourcontext/cgi-bin/yourscript.cgi Mark Brelsfoard, Alex wrote: I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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]
RE: Trouble getting CGI script to execute
I'm sorry. I really don't mean to waste your time. I'm just a bit confused here. You agreed that I do not need to use apache, but your advice was explained to me using apache configuration file format. I just figured that you were giving me examples/ideas. Tomcat does not have an httpd.conf file, it has server.xml and web.xml and the format of these files are completely different from apache. Hence my confusion. The idea made since since there were no instructions for Tomcat to know how to handle .cgi files. Again, I apologize if I'm missing something blatantly obvious, but I've been working on this for several days now and not getting anywhere. Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 4:03 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute You are heading in the wrong direction. You don't need to specify a mime-type. (Neither do you need Apache.) You have a simple configuration error. See my previous post. Mark Brelsfoard, Alex wrote: OK, now we're getting somewhere. There was no entry for mime-type for file extension cgi. I added: mime-mapping extensioncgi/extension mime-typeapplication/x-httpd-cgi/mime-type /mime-mapping Which was not there before. Do I have the correct mime-type info there? When I go to my script (via the web) now it asks me to download the file. This mean something to someone? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Warron French [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:42 PM To: Tomcat Users List Subject: RE: Trouble getting CGI script to execute I use apache to enable cgi scripts, and I had the same problem as you. So, since I don't know Tomcat so well, I can offer you this. Check in your config file to make sure that you have the line(s): AddType application/x-httpd-cgi .cgi .sh .pl AddHandler cgi-script .cgi .sh .pl (I am not actually using this line but maybe you need to) Also, in my httpd.conf file I am using some directives and options such as: Directory /home/nrccwdt/public_html/ Options +Includes +ExecCGI XbitHack On /Directory I am sure you know how the Directory directive works, but make sure that you do have the Options +ExecCGI, and XbitHack On lines also. Good luck, Warron French Sr. Network Engineer Xtria, LLC -Original Message- From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:28 PM To: tomcat-user@jakarta.apache.org Subject: Trouble getting CGI script to execute I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Trouble getting CGI script to execute
Sorry my server was a bit slow and I didn't get this message until after I had sent my last. Apologies. Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 4:15 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute OK. Making progress. Can you try the following? (all steps included - even the ones you have already done) Once it works we can tweak it to give the configuration you want. These steps assume a default install. Create a directory $CATALINA_HOME/webapps/myapp/ Create a directory $CATALINA_HOME/webapps/myapp/WEB-INF Create a directory $CATALINA_HOME/webapps/myapp/WEB-INF/cgi Place your script called (script.cgi) in: $CATALINA_HOME/webapps/myapp/WEB-INF/cgi Uncomment the cgi stuff in $CATALINA_HOME/conf/web.xml Rename $CATALINA_HOME/server/servlets-cgi.renametojar to $CATALINA_HOME/server/servlets-cgi.jar Restart tomcat. Browse to http://host:port/myapp/cgi-bin/script.cgi Let me know what happens. Mark Brelsfoard, Alex wrote: This is one area I was not entirely sure about. I did uncomment everything and did NOT change anything. I do not really have a ROOT url. I setup a /cgi-bin directory in server.xml. I then created a WEB-INF and cgi folders and placed my script in there. So the path to the file is /path/cgi-bin/WEB-INF/cgi/script.cgi And the URL: domain.com/cgi-bin/script.cgi Did I miss something here? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:55 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Exactly where did you put your script? If you follow http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html and use the defaults it is impossible to see the text of your script. Assuming you only uncommented the global web.xml and did not edit any of the settings, your script should be in: /WEB-INF/cgi/ and it is accessed through /yourcontext/cgi-bin/yourscript.cgi Mark Brelsfoard, Alex wrote: I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Trouble getting CGI script to execute
Ok. So I did everything you said. Still not working. I get a 404 error. So I took it step by step to see if I made typos or something. If I go to http://host:port I see the directory listing including myapp I click on myapp. There is nothing in the directory listing. I then add /cgi-bin/script.cgi to the end, to make http://host:port/myapp/cgi-bin/script.cgi. Same result: 404. I then tried http://host:port/myapp/script.cgi. Same result. I then tried http://host:port/myapp/WEB-INF/cgi/script.cgi. This time it asked me if I want to open or download this file. shrug Any ideas? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 4:15 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute OK. Making progress. Can you try the following? (all steps included - even the ones you have already done) Once it works we can tweak it to give the configuration you want. These steps assume a default install. Create a directory $CATALINA_HOME/webapps/myapp/ Create a directory $CATALINA_HOME/webapps/myapp/WEB-INF Create a directory $CATALINA_HOME/webapps/myapp/WEB-INF/cgi Place your script called (script.cgi) in: $CATALINA_HOME/webapps/myapp/WEB-INF/cgi Uncomment the cgi stuff in $CATALINA_HOME/conf/web.xml Rename $CATALINA_HOME/server/servlets-cgi.renametojar to $CATALINA_HOME/server/servlets-cgi.jar Restart tomcat. Browse to http://host:port/myapp/cgi-bin/script.cgi Let me know what happens. Mark Brelsfoard, Alex wrote: This is one area I was not entirely sure about. I did uncomment everything and did NOT change anything. I do not really have a ROOT url. I setup a /cgi-bin directory in server.xml. I then created a WEB-INF and cgi folders and placed my script in there. So the path to the file is /path/cgi-bin/WEB-INF/cgi/script.cgi And the URL: domain.com/cgi-bin/script.cgi Did I miss something here? Thanks. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 3:55 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Exactly where did you put your script? If you follow http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html and use the defaults it is impossible to see the text of your script. Assuming you only uncommented the global web.xml and did not edit any of the settings, your script should be in: /WEB-INF/cgi/ and it is accessed through /yourcontext/cgi-bin/yourscript.cgi Mark Brelsfoard, Alex wrote: I have been reading all the online documentation I can dig up and cannot find the solution to my problem. Quite simply, all I want to do is be able to run perl cgi script through my Tomcat server. I uncommented everything having to do with CGI in the Tomcat web.xml conf file, restarted the server and placed my scriptmin the right place. All that happens now is the script is printed up to the screenjust like a txt file. It is executable. I checked the logs and the log says that a 304 code is sent to the browser. ANY help would be much appreciated. Thanks very much. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble getting CGI script to execute
Brelsfoard, Alex wrote: Ok. So I did everything you said. Still not working. I get a 404 error. So I took it step by step to see if I made typos or something. If I go to http://host:port I see the directory listing including myapp This shouldn't happen. This means that myapp is a directory in the root context rather than a separate context. Have you edited server.xml at all? It looks like you have a context element along the lines of Context path= docBase=${CATALINA_HOME}/webapps debug=0/ in your server.xml. This is bad. The default install uses Context path= docBase=ROOT debug=0/ although it is commented out because tomcat does this automatically by default anyway. Mark I click on myapp. There is nothing in the directory listing. I then add /cgi-bin/script.cgi to the end, to make http://host:port/myapp/cgi-bin/script.cgi. Same result: 404. I then tried http://host:port/myapp/script.cgi. Same result. I then tried http://host:port/myapp/WEB-INF/cgi/script.cgi. This time it asked me if I want to open or download this file. shrug Any ideas? Thanks. --Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Trouble getting CGI script to execute
OK I changed it so that the path is myapp and the docBase is ${CATALINA_HOME}/webapps/myapp. Restarted Tomcat Still nothing. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 4:48 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Ok. So I did everything you said. Still not working. I get a 404 error. So I took it step by step to see if I made typos or something. If I go to http://host:port I see the directory listing including myapp This shouldn't happen. This means that myapp is a directory in the root context rather than a separate context. Have you edited server.xml at all? It looks like you have a context element along the lines of Context path= docBase=${CATALINA_HOME}/webapps debug=0/ in your server.xml. This is bad. The default install uses Context path= docBase=ROOT debug=0/ although it is commented out because tomcat does this automatically by default anyway. Mark I click on myapp. There is nothing in the directory listing. I then add /cgi-bin/script.cgi to the end, to make http://host:port/myapp/cgi-bin/script.cgi. Same result: 404. I then tried http://host:port/myapp/script.cgi. Same result. I then tried http://host:port/myapp/WEB-INF/cgi/script.cgi. This time it asked me if I want to open or download this file. shrug Any ideas? Thanks. --Alex - 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]
Re: Trouble getting CGI script to execute
Before I forget, what version of Tomcat? I don't think you can use ${CATALINA_HOME} directly in server.xml (I might be wrong). Can you post your server.xml? It looks like you have made some changes that might be complicating matters. *If* you host still has auto deploy configured (it is unless you explicitly set it to false) and an appbase of webapps, remove the Context element for myapp completely. Auto deploy will sort it out. Mark Brelsfoard, Alex wrote: OK I changed it so that the path is myapp and the docBase is ${CATALINA_HOME}/webapps/myapp. Restarted Tomcat Still nothing. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 4:48 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Ok. So I did everything you said. Still not working. I get a 404 error. So I took it step by step to see if I made typos or something. If I go to http://host:port I see the directory listing including myapp This shouldn't happen. This means that myapp is a directory in the root context rather than a separate context. Have you edited server.xml at all? It looks like you have a context element along the lines of Context path= docBase=${CATALINA_HOME}/webapps debug=0/ in your server.xml. This is bad. The default install uses Context path= docBase=ROOT debug=0/ although it is commented out because tomcat does this automatically by default anyway. Mark I click on myapp. There is nothing in the directory listing. I then add /cgi-bin/script.cgi to the end, to make http://host:port/myapp/cgi-bin/script.cgi. Same result: 404. I then tried http://host:port/myapp/script.cgi. Same result. I then tried http://host:port/myapp/WEB-INF/cgi/script.cgi. This time it asked me if I want to open or download this file. shrug Any ideas? Thanks. --Alex - 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]
RE: Trouble getting CGI script to execute
Subject: Re: Trouble getting CGI script to execute Before I forget, what version of Tomcat? I don't think you can use ${CATALINA_HOME} directly in server.xml (I might be wrong). Can you post your server.xml? It looks like you have made some changes that might be complicating matters. *If* you host still has auto deploy configured (it is unless you explicitly set it to false) and an appbase of webapps, remove the Context element for myapp completely. Auto deploy will sort it out. Mark Brelsfoard, Alex wrote: OK I changed it so that the path is myapp and the docBase is ${CATALINA_HOME}/webapps/myapp. Restarted Tomcat Still nothing. --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 4:48 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Ok. So I did everything you said. Still not working. I get a 404 error. So I took it step by step to see if I made typos or something. If I go to http://host:port I see the directory listing including myapp This shouldn't happen. This means that myapp is a directory in the root context rather than a separate context. Have you edited server.xml at all? It looks like you have a context element along the lines of Context path= docBase=${CATALINA_HOME}/webapps debug=0/ in your server.xml. This is bad. The default install uses Context path= docBase=ROOT debug=0/ although it is commented out because tomcat does this automatically by default anyway. Mark I click on myapp. There is nothing in the directory listing. I then add /cgi-bin/script.cgi to the end, to make http://host:port/myapp/cgi-bin/script.cgi. Same result: 404. I then tried http://host:port/myapp/script.cgi. Same result. I then tried http://host:port/myapp/WEB-INF/cgi/script.cgi. This time it asked me if I want to open or download this file. shrug Any ideas? Thanks. --Alex - 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]
Re: Trouble getting CGI script to execute
Brelsfoard, Alex wrote: Yes, well this is where things get a little messy. I am using a version of Tomcat installed by a search engine software package called Endeca. They HAVE made some default settings of their own in server.xml. Ah. That explains a few things. I have not been using ${CATALINA_HOME} in the server.xml config file; I have been manually entering the directory. OK. Good. I will paste in my server.xml here: snip OK. I should have spotted this from your last post. Your context path should be path=/myapp NOT path=myapp Script should be: /station/endeca/4.5.4/i86pc-linux/webapps/myapp/WEB-INF/cgi/script.cgi url to script should then be: http://host:/myapp/cgi-bin/script.cgi Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Trouble getting CGI script to execute
OK. I should have spotted this from your last post. Your context path should be path=/myapp NOT path=myapp Yeah, you're right. Oops. Thanks. Script should be: /station/endeca/4.5.4/i86pc-linux/webapps/myapp/WEB-INF/cgi/script.cgi Good, this is where I put it originally. OK tried it Still asking me if I want to download the script Poop. Thanks --Alex Alex Brelsfoard Web Applications Developer Web Development Office Worcester Polytechnic Institute 508-831-6147 [EMAIL PROTECTED] -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 5:51 PM To: Tomcat Users List Subject: Re: Trouble getting CGI script to execute Brelsfoard, Alex wrote: Yes, well this is where things get a little messy. I am using a version of Tomcat installed by a search engine software package called Endeca. They HAVE made some default settings of their own in server.xml. Ah. That explains a few things. I have not been using ${CATALINA_HOME} in the server.xml config file; I have been manually entering the directory. OK. Good. I will paste in my server.xml here: snip OK. I should have spotted this from your last post. Your context path should be path=/myapp NOT path=myapp Script should be: /station/endeca/4.5.4/i86pc-linux/webapps/myapp/WEB-INF/cgi/script.cgi url to script should then be: http://host:/myapp/cgi-bin/script.cgi 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]
RE: Trouble getting CGI script to execute
From: Brelsfoard, Alex [mailto:[EMAIL PROTECTED] Subject: RE: Trouble getting CGI script to execute OK tried it Still asking me if I want to download the script Poop. Would it be possible to try this with a clean install of a known Tomcat download? This would determine if the second-hand version you're trying to use might be missing some pieces. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble getting CGI script to execute
Brelsfoard, Alex wrote: OK. I should have spotted this from your last post. Your context path should be path=/myapp NOT path=myapp Yeah, you're right. Oops. Thanks. 1 problem down. n to go... Script should be: /station/endeca/4.5.4/i86pc-linux/webapps/myapp/WEB-INF/cgi/script.cgi Good, this is where I put it originally. OK tried it Still asking me if I want to download the script Poop. This really bothers me. Since the cgi script is in the WEB-INF directory you should not be able to access it. I hope this is a config error but if I were you I would have some security concerns right now. Can you post the cgi parts of your web.xml as well please. I assume that has been modified too. Can you also check that ${CATALINA_HOME}/webapps/ROOT does not contain a directory called myapp. If it does - delete it. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]