View previous topic :: View next topic |
Author |
Message |
robertcInT -
Joined: 04 Apr 2012 Posts: 2
|
Posted: Wed Apr 04, 2012 10:56 pm Post subject: Script works from command line, but not as CGI |
|
|
Hi,
I am writing a Perl tool which interfaces with Gnu Privacy Guard (GPG). As part of this application, GPG has to access a public key server. I have written the script as a stand-alone Perl/Tk app and it works perfectly. I have been requested to port this to a CGI so that the UI is a web browser. I can communicate fine with GPG; I cannot ping the key server from my script, nor can GPG access it under the CGI. I am running Windows XP as admin, so I didn't think that permissions would be an issue; However, I tested trying to ping Google instead of the key server. This works, so I am suspicious. Abyss is running on localhost, listening on a non-standard port. We plan to migrate this to a Linux server once the UI is finalized.
My question to the support gurus is 1) Is there any special processing I have to do to enable the CGI to access additional IP addresses, and 2) Does Abyss run under a fake user (like Apache) who does not have sufficient permissions? Is running as localhost:xxxx causing issues? There must be something like this or GPG would be able to access the server (as it can from the command line)
Thanks
P.S. I am very experienced in Perl, getting my feet wet with CGI
P.P.S This script is for work, so if people want samples I will have to sanitize; let me know |
|
Back to top |
|
|
admin Site Admin
Joined: 03 Mar 2002 Posts: 1296
|
Posted: Wed Apr 04, 2012 11:33 pm Post subject: Re: Script works from command line, but not as CGI |
|
|
robertcInT,
Does your script fail with Error 500? If so, have you checked the cgi.log file for a detailed error report? What was it? _________________ Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com |
|
Back to top |
|
|
robertcInT -
Joined: 04 Apr 2012 Posts: 2
|
Posted: Thu Apr 05, 2012 12:23 am Post subject: |
|
|
Hi,
No. Currently I have the script die and exit when the ping fails, since the next call to GPG will return an error if I bypass the ping operation. The script runs to completion in either case, so no 500 error.
One additional data point: I tried pinging keyserver.pgp.com as a test and I am getting a response from it, but when I try to manually ping it from the command line I am getting an 'unreachable' response with TCP protocol (not a timeout). The other keyserver can be pinged successfully from the command line, or from my Perl/Tk script using ICMP. It cannot be pinged with any protocol from the CGI. My Perl/Tk script spawns GPG using IPC::Cmd and it works correctly. The same code run from the CGI results in GPG not being able to access the keyserver. |
|
Back to top |
|
|
aprelium-support -
Joined: 20 Feb 2009 Posts: 356
|
Posted: Mon May 07, 2012 3:05 pm Post subject: |
|
|
robertcInT,
Abyss Web Server runs under the privileges of the user who launched it on Windows. So there should be no permissions issues.
Are you sure your CGI script does not need or invoke any GUI tool/application? When running as CGI you are in "command line" only environment with no access to the GUI. This may make some tools fail mysteriously. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|