Re: Unable to use Python/CGI from Tomcat....
Is it worth writing a quick ksh script to validate your hypothesis that the environment (and specifically LD_LIBRARY_PATH) isn't being passed through? additionally (as a crap workaround) you could create a quick script which would set the LD_LIBRARY_PATH path and then invoke python, and use that in your shebang line... also, might it not be an idea to a have a specific instance of CGIServlet that has executable=python, rather than piping to ksh and then to python? (ie why bother with the shebang line, if you don't really need it...) just a few ideas, FWIW... Tim Ed Hillmann wrote: I'm attempting to set up our Tomcat server to run ViewCVS, which is a Python application. I've set up Python on my Solaris 8 box. I've noticed that to start python, I need to include a library (libgdbm.so.3) in my LD_LIBRARY_PATH. Which I do, and Python starts up fine. I've copied the cgi script into the appropriate directory in my Tomcat server. CGI is enabled, because we have other scripts being executed from within Tomcat. But whenever I attempt to call the new Python script, I get the error... 2005-07-19 14:14:32 cgi: runCGI (stderr):ld.so.1: /ct/ctapp/python241/bin/python: fatal: libgdbm.so.3: open failed: No such file or directory Which looks a lot like the error I get if that library is not in my LD_LIBRARY_PATH. I've mucked around with startup.sh to displayed that the processes starting the Tomcat JVM does have this library in it's environment. But whatever is executing the CGI script from within the JVM is not passing along the environment variables. The servlet definition in my web.xml looks like... 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-valuecgi-bin/param-value /init-param init-param param-nameexecutable/param-name param-value/usr/bin/ksh/param-value /init-param init-param param-namepassShellEnvironment/param-name param-valuetrue/param-value /init-param load-on-startup5/load-on-startup /servlet So, because passShellEnvironment is true, I expected the shell environment to be passed along to the cgi script. It doesn't seem to be. Am I missing something else? Surely I can't be the first one to come up against this? Thanks for any help, Ed Do you Yahoo!? Messenger 7.0 beta: Free worldwide PC to PC calls http://au.beta.messenger.yahoo.com - 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: Unable to use Python/CGI from Tomcat....
Well, my first attempt was to get Python built so that it doesn't need the LD_LIBRARY_PATH set. I'm still working on that. As far as the CGIServlet definition, I was under the impression that Tomcat only allowed one CGIServlet? I got this from the doco... Tomcat's CGI support is largely compatible with Apache httpd's, but there are some limitations (e.g., only one cgi-bin directory). Now, have I misinterpreted only one cgi-bin directory? Yu can only have one directory, but multiple servlets configured differently to execute different files in the single directory? If I havem then I'm quite happy to try to set up a servlet for my Python script which knows it's Python. --- Tim Diggins [EMAIL PROTECTED] wrote: Is it worth writing a quick ksh script to validate your hypothesis that the environment (and specifically LD_LIBRARY_PATH) isn't being passed through? additionally (as a crap workaround) you could create a quick script which would set the LD_LIBRARY_PATH path and then invoke python, and use that in your shebang line... also, might it not be an idea to a have a specific instance of CGIServlet that has executable=python, rather than piping to ksh and then to python? (ie why bother with the shebang line, if you don't really need it...) just a few ideas, FWIW... Tim Ed Hillmann wrote: I'm attempting to set up our Tomcat server to run ViewCVS, which is a Python application. I've set up Python on my Solaris 8 box. I've noticed that to start python, I need to include a library (libgdbm.so.3) in my LD_LIBRARY_PATH. Which I do, and Python starts up fine. I've copied the cgi script into the appropriate directory in my Tomcat server. CGI is enabled, because we have other scripts being executed from within Tomcat. But whenever I attempt to call the new Python script, I get the error... 2005-07-19 14:14:32 cgi: runCGI (stderr):ld.so.1: /ct/ctapp/python241/bin/python: fatal: libgdbm.so.3: open failed: No such file or directory Which looks a lot like the error I get if that library is not in my LD_LIBRARY_PATH. I've mucked around with startup.sh to displayed that the processes starting the Tomcat JVM does have this library in it's environment. But whatever is executing the CGI script from within the JVM is not passing along the environment variables. The servlet definition in my web.xml looks like... 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-valuecgi-bin/param-value /init-param init-param param-nameexecutable/param-name param-value/usr/bin/ksh/param-value /init-param init-param param-namepassShellEnvironment/param-name param-valuetrue/param-value /init-param load-on-startup5/load-on-startup /servlet So, because passShellEnvironment is true, I expected the shell environment to be passed along to the cgi script. It doesn't seem to be. Am I missing something else? Surely I can't be the first one to come up against this? Thanks for any help, Ed Do you Yahoo!? Messenger 7.0 beta: Free worldwide PC to PC calls http://au.beta.messenger.yahoo.com - 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] Send instant messages to your online friends http://au.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to use Python/CGI from Tomcat....
In a message dated 7/19/2005 2:56:49 PM Pacific Standard Time, [EMAIL PROTECTED] writes: [EMAIL PROTECTED]
Unable to use Python/CGI from Tomcat....
I'm attempting to set up our Tomcat server to run ViewCVS, which is a Python application. I've set up Python on my Solaris 8 box. I've noticed that to start python, I need to include a library (libgdbm.so.3) in my LD_LIBRARY_PATH. Which I do, and Python starts up fine. I've copied the cgi script into the appropriate directory in my Tomcat server. CGI is enabled, because we have other scripts being executed from within Tomcat. But whenever I attempt to call the new Python script, I get the error... 2005-07-19 14:14:32 cgi: runCGI (stderr):ld.so.1: /ct/ctapp/python241/bin/python: fatal: libgdbm.so.3: open failed: No such file or directory Which looks a lot like the error I get if that library is not in my LD_LIBRARY_PATH. I've mucked around with startup.sh to displayed that the processes starting the Tomcat JVM does have this library in it's environment. But whatever is executing the CGI script from within the JVM is not passing along the environment variables. The servlet definition in my web.xml looks like... 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-valuecgi-bin/param-value /init-param init-param param-nameexecutable/param-name param-value/usr/bin/ksh/param-value /init-param init-param param-namepassShellEnvironment/param-name param-valuetrue/param-value /init-param load-on-startup5/load-on-startup /servlet So, because passShellEnvironment is true, I expected the shell environment to be passed along to the cgi script. It doesn't seem to be. Am I missing something else? Surely I can't be the first one to come up against this? Thanks for any help, Ed Do you Yahoo!? Messenger 7.0 beta: Free worldwide PC to PC calls http://au.beta.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]