LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux webserver & PostgreSQL (https://www.linuxquestions.org/questions/linux-newbie-8/linux-webserver-and-postgresql-712225/)

anon005 03-17-2009 06:31 AM

Linux webserver & PostgreSQL
 
Hi,

I have a scenario for linux webserver having PostgreSQL database and hosting one website on https://192.168.1.75.

The website is a type of employee time database management system. The credentials for authorized access are stored in PostgreSQL database.

The website is running and accepting requests on the login page only but the time I try to submit login information, it says fatal error.

I used ISQL for PostgreSQL query analyzer and couple of other query analyzers as well for PostgreSQL database, but the message that returns while connecting on default port i.e. 5432 is as follows:

Message:
could not connect to server:_Connection refused (0x0000274D/10061)
Is the server running on host "192.168.1.75" and accepting
TCP/IP connections on port 5432?.

The admin page for this website is showing the following error:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

What I believe that the website part is running healthy as it is accepting connections and sending pages back to the requesters but the socks part which connects the website to PostgreSQL is turned off accidentally or somewhat.

Is there any way to know whether server is accepting socks connections on 5432 and in working state or in other words can we know that PostgreSQL service is running on it or not?

The kernel for this system is customized, locked and renamed DEBIANA LILO 2.6.8.1-tt.

I don't have the root password as well. But in the worst scenario, we can break it for temporarily.

Kindly support on this issue as I don't have much knowledge on linux commands as well as it's kernel.

Thank you very much,

Regards.

TB0ne 03-17-2009 09:33 AM

Quote:

Originally Posted by anon005 (Post 3478135)
Hi,

I have a scenario for linux webserver having PostgreSQL database and hosting one website on https://192.168.1.75.

The website is a type of employee time database management system. The credentials for authorized access are stored in PostgreSQL database.

The website is running and accepting requests on the login page only but the time I try to submit login information, it says fatal error.

I used ISQL for PostgreSQL query analyzer and couple of other query analyzers as well for PostgreSQL database, but the message that returns while connecting on default port i.e. 5432 is as follows:

Message:
could not connect to server:_Connection refused (0x0000274D/10061)
Is the server running on host "192.168.1.75" and accepting
TCP/IP connections on port 5432?.

The admin page for this website is showing the following error:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

What I believe that the website part is running healthy as it is accepting connections and sending pages back to the requesters but the socks part which connects the website to PostgreSQL is turned off accidentally or somewhat.

Is there any way to know whether server is accepting socks connections on 5432 and in working state or in other words can we know that PostgreSQL service is running on it or not?

The kernel for this system is customized, locked and renamed DEBIANA LILO 2.6.8.1-tt.

I don't have the root password as well. But in the worst scenario, we can break it for temporarily.

Kindly support on this issue as I don't have much knowledge on linux commands as well as it's kernel.

Thank you very much,

Regards.

The only way you can test it is to fire up the postgres console on your web server from the command-line, and see if you can log in to the database server. Use the user ID/password, and database name as you have them in your connection script on the web server.

If you can't connect, the DBA is going to have to allow connections, in order for your program/server to connect. If it DOES connect from the command line, your web code is broken, and needs to be fixed.

Since you don't give any code examples, or tell us what version of postgres you're using, or what version/distro of Linux, it's hard to give more specific details, other than very basic troubleshooting.

anon005 03-21-2009 02:47 AM

Linux webserver & PostgreSQL
 
I have managed to log into the root and used the following command:

#/etc/init.d/postgresql restart

this command returns the following error message:
==========================================================
pg_ctl: cannot find /var/lib/postgres/data/postmaster.pid
Is postmaster running?
Starting PostgreSQL postmaster
Postmaster successfully started
==========================================================

The version which I am using for PostgreAQL is: PostgreSQL 7.3.4

I want to ask one thing more that like MS Access stores its database in a .mdb file and sql stores in a .mdf file, what is the extension of a postgresql database file? is it .pdd? and where is it located?

Please help...

TB0ne 03-21-2009 03:34 PM

Quote:

Originally Posted by anon005 (Post 3482859)
I have managed to log into the root and used the following command:

#/etc/init.d/postgresql restart

this command returns the following error message:
==========================================================
pg_ctl: cannot find /var/lib/postgres/data/postmaster.pid
Is postmaster running?
Starting PostgreSQL postmaster
Postmaster successfully started
==========================================================

The version which I am using for PostgreAQL is: PostgreSQL 7.3.4

I want to ask one thing more that like MS Access stores its database in a .mdb file and sql stores in a .mdf file, what is the extension of a postgresql database file? is it .pdd? and where is it located?

Please help...

The restart message tells you why it wouldn't connect. The restart does two things: it shuts down the service, and then starts it again. Step 1 (the shutdown), failed, because either postgres wasn't started correctly, or wasn't running at all. Step 2 (the startup) completed.

Check your Postgres configuration, to see where you're saving the files. Check the Postgres documentation for information about the files.

Tinkster 03-22-2009 12:23 PM

Quote:

Originally Posted by anon005 (Post 3482859)
The version which I am using for PostgreAQL is: PostgreSQL 7.3.4

Good grief ... that branch has been unsupported for a good
while, and you're 5 versions behind on that! 7.3.9 (the last
of the 7.3 series) was released on 31/01/2005 ...


Quote:

Originally Posted by anon005 (Post 3482859)
I want to ask one thing more that like MS Access stores its database in a .mdb file and sql stores in a .mdf file, what is the extension of a postgresql database file? is it .pdd? and where is it located?

Please help...

Postgresql is *sane*. It doesn't use just two files to
store its information. You can determine their location
by looking at your startup-script. They usually don't
have an extension, Postgres comes from a Unix background,
extensions mean diddly-squat.


Cheers,
Tink


All times are GMT -5. The time now is 11:06 PM.