1
1
#! /bin/bash
2
2
echo " Installing dependencies for Dataverse"
3
3
4
- # Add JQ
4
+ # python3 and psycopg2 for the Dataverse installer
5
+ dnf install -qy python3 python3-psycopg2
6
+
7
+ # Add JQ (TODO: just install this from EPEL?)
5
8
echo " Installing jq for the setup scripts"
6
- wget http://stedolan.github.io/jq/download/linux64/jq
9
+ wget -q http://stedolan.github.io/jq/download/linux64/jq
7
10
chmod +x jq
8
11
# this is where EPEL puts it
9
12
sudo mv jq /usr/bin/jq
10
13
11
14
echo " Adding Shibboleth yum repo"
12
15
cp /dataverse/conf/vagrant/etc/yum.repos.d/shibboleth.repo /etc/yum.repos.d
13
- cp /dataverse/conf/vagrant/etc/yum.repos.d/epel-apache-maven.repo /etc/yum.repos.d
14
16
# Uncomment this (and other shib stuff below) if you want
15
17
# to use Vagrant (and maybe PageKite) to test Shibboleth.
16
18
# yum install -y shibboleth shibboleth-embedded-ds
17
19
18
20
# java configuration et al
19
- yum install -y java-1.8.0-openjdk-devel apache-maven httpd mod_ssl unzip
20
- alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
21
- alternatives --set javac /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/javac
21
+ dnf install -qy java-1.8.0-openjdk-headless maven httpd mod_ssl unzip
22
+ alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk/bin/java
23
+ # do we need javac? the symlink is tied to package version...
24
+ # /etc/alternatives/javac -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el8_2.x86_64/bin/javac
25
+ # alternatives --set javac /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/javac
22
26
java -version
23
- javac -version
27
+ # javac -version
24
28
25
- # switching to postgresql-9.6 per #4709
26
- yum install -y https://download. postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
27
- yum makecache fast
28
- yum install -y postgresql96 -server
29
- /usr/pgsql-9.6 /bin/postgresql96 -setup initdb
30
- /usr/bin/systemctl stop postgresql-9.6
31
- cp /dataverse/conf/vagrant/var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/9.6 /data/pg_hba.conf
32
- /usr/bin/systemctl start postgresql-9.6
33
- /usr/bin/systemctl enable postgresql-9.6
29
+ # disable centos8 postgresql module and install postgresql10-server
30
+ dnf -qy module disable postgresql
31
+ dnf install -qy https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
32
+ dnf install -qy postgresql10 -server
33
+ /usr/pgsql-10 /bin/postgresql-10 -setup initdb
34
+ /usr/bin/systemctl stop postgresql-10
35
+ cp /dataverse/conf/vagrant/var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/10 /data/pg_hba.conf
36
+ /usr/bin/systemctl start postgresql-10
37
+ /usr/bin/systemctl enable postgresql-10
34
38
35
- GLASSFISH_USER =dataverse
36
- echo " Ensuring Unix user '$GLASSFISH_USER ' exists"
37
- useradd $GLASSFISH_USER || :
39
+ PAYARA_USER =dataverse
40
+ echo " Ensuring Unix user '$PAYARA_USER ' exists"
41
+ useradd $PAYARA_USER || :
38
42
SOLR_USER=solr
39
43
echo " Ensuring Unix user '$SOLR_USER ' exists"
40
44
useradd $SOLR_USER || :
41
45
DOWNLOAD_DIR=' /dataverse/downloads'
42
- GLASSFISH_ZIP =" $DOWNLOAD_DIR /payara-5.201 .zip"
46
+ PAYARA_ZIP =" $DOWNLOAD_DIR /payara-5.2020.2 .zip"
43
47
SOLR_TGZ=" $DOWNLOAD_DIR /solr-7.7.2.tgz"
44
- if [ ! -f $GLASSFISH_ZIP ] || [ ! -f $SOLR_TGZ ]; then
45
- echo " Couldn't find $GLASSFISH_ZIP or $SOLR_TGZ ! Running download script...."
48
+ if [ ! -f $PAYARA_ZIP ] || [ ! -f $SOLR_TGZ ]; then
49
+ echo " Couldn't find $PAYARA_ZIP or $SOLR_TGZ ! Running download script...."
46
50
cd $DOWNLOAD_DIR && ./download.sh && cd
47
51
echo " Done running download script."
48
52
fi
49
- GLASSFISH_USER_HOME=~ dataverse
50
- GLASSFISH_ROOT=$GLASSFISH_USER_HOME /payara5
51
- if [ ! -d $GLASSFISH_ROOT ]; then
52
- echo " Copying $GLASSFISH_ZIP to $GLASSFISH_USER_HOME and unzipping"
53
- su $GLASSFISH_USER -s /bin/sh -c " cp $GLASSFISH_ZIP $GLASSFISH_USER_HOME "
54
- su $GLASSFISH_USER -s /bin/sh -c " cd $GLASSFISH_USER_HOME && unzip -q $GLASSFISH_ZIP "
53
+ PAYARA_USER_HOME=~ dataverse
54
+ PAYARA_ROOT=/usr/local/payara5
55
+ if [ ! -d $PAYARA_ROOT ]; then
56
+ echo " Copying $PAYARA_ZIP to $PAYARA_USER_HOME and unzipping"
57
+ su $PAYARA_USER -s /bin/sh -c " cp $PAYARA_ZIP $PAYARA_USER_HOME "
58
+ su $PAYARA_USER -s /bin/sh -c " cd $PAYARA_USER_HOME && unzip -q $PAYARA_ZIP "
59
+ # default.config defaults to /usr/local/payara5 so let's go with that
60
+ rsync -a $PAYARA_USER_HOME /payara5/ $PAYARA_ROOT /
55
61
else
56
- echo " $GLASSFISH_ROOT already exists"
62
+ echo " $PAYARA_ROOT already exists"
57
63
fi
64
+
58
65
# service shibd start
59
- service httpd stop
66
+ /usr/bin/systemctl stop httpd
60
67
cp /dataverse/conf/httpd/conf.d/dataverse.conf /etc/httpd/conf.d/dataverse.conf
61
68
mkdir -p /var/www/dataverse/error-documents
62
69
cp /dataverse/conf/vagrant/var/www/dataverse/error-documents/503.html /var/www/dataverse/error-documents
63
- service httpd start
70
+ /usr/bin/systemctl start httpd
64
71
# curl -k --sslv3 https://pdurbin.pagekite.me/Shibboleth.sso/Metadata > /tmp/pdurbin.pagekite.me
65
72
# cp -a /etc/shibboleth/shibboleth2.xml /etc/shibboleth/shibboleth2.xml.orig
66
73
# cp -a /etc/shibboleth/attribute-map.xml /etc/shibboleth/attribute-map.xml.orig
@@ -72,6 +79,7 @@ service httpd start
72
79
# service shibd restart
73
80
# curl -k --sslv3 https://pdurbin.pagekite.me/Shibboleth.sso/Metadata > /downloads/pdurbin.pagekite.me
74
81
# service httpd restart
82
+
75
83
echo " #########################################################################################"
76
84
echo " # This is a Vagrant test box, so we're disabling firewalld. #
77
85
echo " # Re-enable it with $ sudo systemctl enable firewalld && sudo systemctl start firewalld #"
0 commit comments