Steps to install POSTGRESQL:
open terminal and type sudo apt-get install postgresql
To enable TCP/IP connections, edit the file /etc/postgresql/9.1/main/postgresql.conf
Locate the line #listen_addresses = ‘localhost’ and change it to:
listen_addresses = ’0.0.0.0′
Now that we can connect to our PostgreSQL server, the next step is to set a password for the postgres user. Run the following command at a terminal prompt to connect to the default PostgreSQL template database:
sudo -u postgres psql template1
The above command connects to PostgreSQL database template1 as user postgres. Once you connect to the PostgreSQL server, you will be at a SQL prompt. You can run the following SQL command at the psql prompt to configure the password for the user postgres.
ALTER USER postgres with encrypted password ‘your_password’;
After configuring the password, edit the file /etc/postgresql/9.1/main/pg_hba.conf to use MD5 authentication with the postgres user:
local all postgres md5
PostgreSQL by default refuses all connections it receives from any remote address, you have to relax these rules by adding this line:
host all all 0.0.0.0/0 md5
Finally, you should restart the PostgreSQL service to initialize the new configuration. From a terminal prompt enter the following to restart PostgreSQL:
sudo service postgresql restart
To create new user in postgres:
Switch into the default superuser
sudo su postgres
createuser -P
Enter name of role to add: newuser
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y
Password: enter the superuser’s password here
Steps to install PHPPgAdmin:
sudo apt-get install phppgadmin
In order to make this page accessible from other systems:
Edit phppgadmin file, i used nano editor to edit it
sudo nano /etc/apache2/conf.d/phppgadmin
Within the file find the following section and uncomment the line, “allow from all”
order deny,allow
deny from all
allow from 127.0.0.0/255.0.0.0 ::1/128
allow from all
make Apache aware of PhpPgAdmin, include the following line in /etc/apache2/apache2.conf
Include /etc/phppgadmin/apache.conf
restart apache service:
sudo service apache2 restart
open browser and browse "http://localhost/phppgadmin/"
open terminal and type sudo apt-get install postgresql
To enable TCP/IP connections, edit the file /etc/postgresql/9.1/main/postgresql.conf
Locate the line #listen_addresses = ‘localhost’ and change it to:
listen_addresses = ’0.0.0.0′
Now that we can connect to our PostgreSQL server, the next step is to set a password for the postgres user. Run the following command at a terminal prompt to connect to the default PostgreSQL template database:
sudo -u postgres psql template1
The above command connects to PostgreSQL database template1 as user postgres. Once you connect to the PostgreSQL server, you will be at a SQL prompt. You can run the following SQL command at the psql prompt to configure the password for the user postgres.
ALTER USER postgres with encrypted password ‘your_password’;
After configuring the password, edit the file /etc/postgresql/9.1/main/pg_hba.conf to use MD5 authentication with the postgres user:
local all postgres md5
PostgreSQL by default refuses all connections it receives from any remote address, you have to relax these rules by adding this line:
host all all 0.0.0.0/0 md5
Finally, you should restart the PostgreSQL service to initialize the new configuration. From a terminal prompt enter the following to restart PostgreSQL:
sudo service postgresql restart
To create new user in postgres:
Switch into the default superuser
sudo su postgres
createuser -P
Enter name of role to add: newuser
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y
Password: enter the superuser’s password here
Steps to install PHPPgAdmin:
sudo apt-get install phppgadmin
In order to make this page accessible from other systems:
Edit phppgadmin file, i used nano editor to edit it
sudo nano /etc/apache2/conf.d/phppgadmin
Within the file find the following section and uncomment the line, “allow from all”
order deny,allow
deny from all
allow from 127.0.0.0/255.0.0.0 ::1/128
allow from all
make Apache aware of PhpPgAdmin, include the following line in /etc/apache2/apache2.conf
Include /etc/phppgadmin/apache.conf
restart apache service:
sudo service apache2 restart
open browser and browse "http://localhost/phppgadmin/"
No comments:
Post a Comment