• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem running cgi script

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've installed and configured tomcat to run cgi scripts according to the steps provided by jakarta/tomcat's website, and can successfully run simple scripts.

My problem is when I run a script that makes a call to execute a file on my local machine within the script:
@exist=`ldapsearch.exe -1 -p $port -h $ho...`

I also am unable to write to a file within my script.

I've searched for days trying to find a solution to no avail. The files I'm working with all have the correct read/write priveleges on the windows OS, and I've even tried with no luck to edit the catalina.policy file in tomcat in order to grant priveleges to the cgi servlet and the files i'm working with.

anyone have any clue how I can resolve this?

[ July 12, 2005: Message edited by: Michael Eddie ]
[ July 12, 2005: Message edited by: Michael Eddie ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your script making invalid assumptions about what the current directory is? It will likely be the directory from where you launched Tomcat.
 
Michael Eddie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the actual code in the example above when i make the call to execute the ldapsearch.exe file contains the full path to that file:
@exist=`c:\\pathtofile\\ldapsearch.exe`;

when i try to write to a file I also supply the full path in the call.

I should also add that the script I am using works correctly from the command line.

[ July 12, 2005: Message edited by: Michael Eddie ]
[ July 12, 2005: Message edited by: Michael Eddie ]
 
Michael Eddie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I finally found the fix by adding this line to the script:

$ENV{"SYSTEMROOT"} = "C:\\windows";
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic