Created
September 27, 2010 16:50
-
-
Save carlosjac/599350 to your computer and use it in GitHub Desktop.
InstallPostgresql9FromSourceOnUbuntu1004
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Install Postgresql9 From Source On Ubuntu 10.04 (Slicehost) | |
# Execute as root | |
# | |
# Author : Carlos Jacobs | |
# Date : 27 Sep 2010 | |
sudo aptitude install libreadline6 libreadline6-dev | |
sudo aptitude install zlib1g zlib1g-dev | |
sudo wget http://wwwmaster.postgresql.org/redir/198/h/source/v9.0.0/postgresql-9.0.0.tar.gz | |
sudo tar -xvzf postgresql-9.0.0.tar.gz | |
sudo cd postgresql-9.0.0 | |
sudo ./configure | |
sudo make | |
sudo make install | |
sudo adduser postgres | |
sudo mkdir /usr/local/pgsql/data | |
sudo chown postgres /usr/local/pgsql/data | |
su - postgres | |
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data | |
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 & | |
/usr/local/pgsql/bin/createdb test | |
/usr/local/pgsql/bin/psql test | |
exit | |
sudo cp ./contrib/start-scripts/linux /etc/init.d/postgresqld | |
sudo chmod u+x /etc/init.d/postgresqld | |
sudo update-rc.d postgresqld defaults | |
cd ~ | |
sudo echo "export PGSQL=/usr/local/pgsql" >> .profile | |
sudo echo "export PGLIB=$PGQL/lib" >> .profile | |
sudo echo "PATH=$PGSQL/bin:$PATH" >> .profile | |
sudo echo "ALTER USER postgres WITH PASSWORD 'lujuma1405';" | psql -U postgres | |
su - postgres | |
echo "# Allow any user on the local system to connect to any database under | |
# any database user name using Unix-domain sockets (the default for local | |
# connections). | |
# | |
# TYPE DATABASE USER CIDR-ADDRESS METHOD | |
local all all md5 | |
# The same using local loopback TCP/IP connections. | |
# | |
# TYPE DATABASE USER CIDR-ADDRESS METHOD | |
host all all 127.0.0.1/32 md5 | |
# The same as the last line but using a separate netmask column | |
# | |
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD | |
host all all 127.0.0.1 255.255.255.255 md5" > /usr/local/pgsql/data/pg_hba.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment