in reply to Re^3: Geo::Coder::Google running as cgi
in thread Geo::Coder::Google running as cgi

That makes sense... but what is the differences? The paths?

CGI
PATH = /sbin:/usr/sbin:/bin:/usr/bin

shell
PATH = /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
I assume it can read the perl modules ok, but it can't either resolve the DNS (where is that done??), or access out is blocked for the apache user (how do I check that?).
Thanks in advance.
  • Comment on Re^4: Geo::Coder::Google running as cgi

Replies are listed 'Best First'.
Re^5: Geo::Coder::Google running as cgi
by jethro (Monsignor) on Sep 14, 2008 at 11:15 UTC
    su -l -c 'ping www.google.com' apacheuser

    Another thing to test is whether there are some perl modules in /usr/local/lib/perl5 (even though such a problem should have been reported in the apache log files already, I think)

      No good.
      Apache is configured (as default) to run as nobody. So,
      su -l -c 'ping www.google.com' nobody
      This account is currently not available

      cat /etc/passwd
      nobody:x:99:99:Nobody:/:/sbin/nologin

      looks like loging in to test is not possible

        You might (A) change the /sbin/nologin to /bin/bash and set a password for nobody for the duration of your test or (B) set the environment (especially the PATH) of the shell you are in to the environment of the CGI and test it this way.

        A is preferable, just don't forget to change it back. B is faster if you just test the most likely culprits like PATH