DBD:Pg unable to connect as CGI process -- could not create socket
All of the cgi scripts I create to access postgres databases work from
the command line but do not work as CGI scripts. When accessed from a
browser the following line:
my $dbh =
DBI->connect( dbi:Pg:dbname=$DatabaseName;host=localhost;port=5432;",
"postgres","mydog")
Produces the following error:
[Thu Jul 28 23:14:45 2005] [error] [client 207.161.60.253] DBI
connect('dbname=myRunningData;host=localhost;port=5432;' ,
'postgres',...) failed: could not create socket: Permission denied
I have tried to establish different identity rules for apache and have
ensured that the password for postgres is correct.
I am currently running Fedora Core 3 with
Postgresql 7.4.8-1.FC3.1
Apache 2.0.52-3.1
perl 5.8.5-14.FC3
DBD::Pg 1.43
The lines below show my postgres config files.
Thanks in advance.
Jason
pg_hba.conf:
host all all 127.0.0.1 255.255.255.255
trust
local all all ident sameuser
postgresql.conf (relavant portions)
tcpip_socket = true
max_connections = 100
# note: increasing max_connections costs about 500 bytes of
shared
# memory per connection slot, in addition to costs from
shared_buffers
# and max_locks_per_transaction.
#superuser_reserved_connections = 2
port = 5432
#unix_socket_directory = ''
#unix_socket_group = ''
unix_socket_permissions = 0777 # octal
.
Relevant Pages
- Re: [SLE] Staring programs at boot - first time at doing this
... we'll call the script postgres. ... The only tricky part is creating the stop/start script if you don't know how to write/edit shell scripts. ... actual command which starts postgres ... ... I don't think I'm looking for the complexity of adapting the /etc/init.d/skeleton file but I'm willing to be proven wrong here since this is the first time I've looked seriously at a boot script. ... (SuSE) - [SLE] SPAM: SOLVED: Re: [SLE] Staring programs at boot - first time at doing this
... in /etc/init.d (adhering to the init instructions) and containing ... but you can also put the command in the existing postgres startup script. ... My course of action will be, although I generally do not like modifying files which could be overwritten by an upgrade, is to modify the existing postgres in /etc/init.d and to keep a backup copy elsewhere. ... I understand that one instance of PostgreSQL can contain many databases; I do not wish to mix work and home databases in the same grouping. ... (SuSE) - [SLE] ps command output regarding swapped processes
... the Postgres processes are swapped to disk. ... PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP Command ... shows that only part of those 3 processes's memory is swapped to disk. ... line info about the postmaster processes. ... (SuSE) - Re: challenging problem for changing to a dedicated non-privileged user within a script.
... So I would like to know if python can change the user to some other ... K> su into the Popen command but it throws me into the terminal ... K> with postgres as the user. ... change the user for a particular script to the postgres user. ... (comp.lang.python) - Re: [SLE] Staring programs at boot - first time at doing this
... we'll call the script postgres. ... The only tricky part is creating the stop/start script if you don't know how to write/edit shell scripts. ... actual command which starts postgres ... ... I don't think I'm looking for the complexity of adapting the /etc/init.d/skeleton file but I'm willing to be proven wrong here since this is the first time I've looked seriously at a boot script. ... (SuSE) |
|