-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
245 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# konfiguroidaan postgre repo | ||
rpm -i http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm | ||
|
||
# nyt yum osaa installoida postgren | ||
yum -y install postgresql92-server postgresql92-contrib | ||
# asennetaan postgre | ||
apt-get install -y postgresql-9.6 | ||
|
||
# alustetaan postgre | ||
service postgresql-9.2 initdb | ||
service postgresql initdb | ||
|
||
# postgre kuuntelemaan ja ottamaan vastaan yhteyksia muualta kuin localhostista | ||
PG_HBA=/var/lib/pgsql/9.2/data/pg_hba.conf | ||
PG_HBA=/etc/postgresql/9.6/main/pg_hba.conf | ||
|
||
echo 'local all all peer' > "$PG_HBA" | ||
echo 'host all all all md5' >> "$PG_HBA" | ||
|
||
chown postgres:postgres "$PG_HBA" | ||
|
||
echo "listen_addresses = '*'" >> /var/lib/pgsql/9.2/data/postgresql.conf | ||
|
||
# poistetaan palomuuri | ||
iptables -F | ||
service iptables save | ||
echo "listen_addresses = '*'" >> /etc/postgresql/9.6/main/postgresql.conf | ||
|
||
# kayntiin | ||
service postgresql-9.2 start | ||
chkconfig postgresql-9.2 on | ||
service postgresql start | ||
update-rc.d postgresql defaults | ||
|
||
sudo -u postgres psql --file=db.sql |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.