Skip to content

Commit 058ce00

Browse files
committed
postgresql9.6 will be installed
1 parent 332e02d commit 058ce00

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

install-confluence.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,27 @@ keystore_pwd=changeit
4545
#general prep
4646
echo -e "\033[32m Install some generic packages\033[0m"
4747
yum update -y
48-
yum install -y vim wget centos-release-scl
48+
yum install -y vim wget centos-release-scl\
49+
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
4950

5051
#install required packages
5152
echo -e "\033[32mInstall packages you need for confluence\033[0m"
52-
yum install -y postgresql-server\
53+
yum install -y postgresql96-server\
5354
httpd24-httpd httpd24-mod_ssl httpd24-mod_proxy_html
5455

5556
#setup database server
56-
postgresql-setup initdb
57-
export PGDATA=/var/lib/pgsql/data
58-
systemctl enable postgresql
57+
/usr/pgsql-9.6/bin/postgresql96-setup initdb
58+
59+
5960

6061
#set postgresql to accept connections
61-
sed -i "s|host all all 127.0.0.1/32.*|host all all 127.0.0.1/32 md5|" /var/lib/pgsql/data/pg_hba.conf && echo "pg_hba.conf file updated successfully" || echo "failed to update pg_hba.conf"
62+
sed -i "s|host all all 127.0.0.1/32.*|host all all 127.0.0.1/32 md5|" /var/lib/pgsql/9.6/data/pg_hba.conf && echo "pg_hba.conf file updated successfully" || echo "failed to update pg_hba.conf"
6263

63-
systemctl start postgresql
64+
systemctl enable postgresql-9.6
65+
systemctl start postgresql-9.6
6466

6567
#prepare database: create database, user and grant permissions to the user
66-
printf "CREATE USER $confluence_user WITH PASSWORD '$confluence_usr_pwd';\nCREATE DATABASE $confluence_db WITH ENCODING='UTF8' OWNER=$confluence_user CONNECTION LIMIT=-1;\nGRANT ALL ON ALL TABLES IN SCHEMA public TO $confluence_user;\nGRANT ALL ON SCHEMA public TO $confluence_user;" > myconf/confluence-db.sql
68+
printf "CREATE USER $confluence_user WITH PASSWORD '$confluence_usr_pwd';\nCREATE DATABASE $confluence_db WITH ENCODING='UNICODE' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;\nGRANT ALL PRIVILEGES ON DATABASE $confluence_db TO $confluence_user;" > myconf/confluence-db.sql
6769

6870
sudo -u postgres psql -f myconf/confluence-db.sql
6971

0 commit comments

Comments
 (0)