From: Mark Dalphin <mdalphin@amgen.com>
To: carlajb@juno.com
To: pgsql-admin@postgresql.org
Subject: Re: Perl Script and Postgres DB running via Apache Web Server
Date: Tue, 29 Feb 2000 09:23:17 -0800
Message-ID: <38BC0084.8B854CB3@amgen.com> (raw)
Hi Carla and Chris,
> I have the following Perl Script (with Postgres code):
>
> [ stuff deleted]
> This Script will run from the command line, and inserts values into the
> existing DB and table. When it is run via the web browser, nothing happens
> (browser hangs). The script is in the /usr/local/httpd/cgi-bin directory,
> owned by a user (not root), and has 755 permissions. We have exhaustively
> searched perl, cgi, postgres, and apache documentation both printed and
> web-based, and cannot determine how to correct this problem. We suspect that
> it may be a permissions / execution rights for the httpd, but we are stumped.
> Any help will be greatly appreciated. Thanks, -Carla and Chris :)
I suspect the problem is not "who owns the script", but rather "who runs the
script". Usually your httpd runs as user "nobody", who also happens to have
very few permissions for anything on your system. Meanwhile, your Postgres
database table was create by you and probably doesn't include permissions for
user "nobody" to even "SELECT" the table, much less modify it.
Guessing here, but you probably don't have a Postgres user named "nobody" (see
"createuser") nor have you granted permissions on any tables to user "nobody"
(see the SQL command "grant"). As user "nobody" usually has no login account
for security reasons, you may wish to experiment with permissions by using two
standard login accounts to see who can read what and when.
For what it is worth, I often find with this kind of problem (CGI scripts that
mis-behave especially when interacting with a database) that changing my httpd
logging "up" from a level of "warn" to "debug" and then reading both the httpd
log and the postgresql log file helps greatly in tracking down the problem.
Hope this helps,
Mark
--
Mark Dalphin email: mdalphin@amgen.com
Mail Stop: 29-2-A phone: +1-805-447-4951 (work)
One Amgen Center Drive +1-805-375-0680 (home)
Thousand Oaks, CA 91320 fax: +1-805-499-9955 (work)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mdalphin@amgen.com, carlajb@juno.com
Subject: Re: Perl Script and Postgres DB running via Apache Web Server
In-Reply-To: <38BC0084.8B854CB3@amgen.com>
References: <38BC0084.8B854CB3@amgen.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox