How to automatically start postmastrer with TCP/IP support (-i option) ???

From: "Paulo Parola" <pgsql(at)brazilinfo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: How to automatically start postmastrer with TCP/IP support (-i option) ???
Date: 2001-03-04 21:38:04
Message-ID: 001601c0a4f3$68fa0d80$170aa8c0@gst.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am trying to configure PostgreSQL 7.1 over RedHat 7.0 (according to Lamar Owen the RPM's for 7.1 were built on RedHat 6.2 and not 7.0 - does that implies any possible problems?).

I have PostgreSQL already starting automatically but with no support to TCP/IP connections. I can see this by the following:

[root(at)atlas pparola]# ps -auxw | grep postgres
postgres 836 0.0 2.0 5092 1284 ? S 17:14 0:00 /usr/bin/postmaster -D /var/lib/pgsql/data
root 982 0.0 0.9 1488 584 pts/0 S 17:19 0:00 grep postgres

And when trying to connect to PostgreSQL from PHP I get the following message:

Warning: Unable to connect to PostgresSQL server: PQconnectPoll() -- connect() failed: Connection refused Is the postmaster running (with -i) at 'localhost' and accepting connections on TCP/IP port 5432? in /var/www/html/pgsql.php on line 3
Could not connect

--

So I started it by hand with the following commands:

su - postgres
cd /var/lib/pgsql/data
nohup /usr/bin/postmaster -i -D /var/lib/pgsql/data </dev/null >>server.log 2>>1 &

When accessing the same PHP script I got the following output:

Warning: Unable to connect to PostgresSQL server: FATAL 1: user "apache" does not exist in /var/www/html/pgsql.php on line 3
Could not connect

-----

So my questions are:

1) How should I make so that PostgreSQL is automatically started accepting TCP/IP connections like I did by hand with the command above (
nohup /usr/bin/postmaster -i -D /var/lib/pgsql/data </dev/null >>server.log 2>>1 &) ???

Which file should I edit to add option '-i' for accepting TCP/IP connections? Apparently, in shell script '/etc/rc.d/init.d/postgresql' the line that starts the postmaster reads 'su -l postgres -c "/usr/bin/pg_ctl -D $PGDATA -p /usr/bin/postmaster start >/dev/null 2>&1" < /dev/null', is that right?

2) With which user shall I connect to the database? User "apache" or maybe user "nobody" ? Should I create a user 'apache' in PostgreSQL?

TIA,
Paulo

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ansley 2001-03-04 22:22:03 RE: INSERT ... RETURNING as Oracle
Previous Message Louis-David Mitterrand 2001-03-04 20:08:55 Re: Trigger sending an eMail