11#! /bin/bash
22echo " Installing dependencies for Dataverse"
33
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?)
58echo " 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
710chmod +x jq
811# this is where EPEL puts it
912sudo mv jq /usr/bin/jq
1013
1114echo " Adding Shibboleth yum repo"
1215cp /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
1416# Uncomment this (and other shib stuff below) if you want
1517# to use Vagrant (and maybe PageKite) to test Shibboleth.
1618# yum install -y shibboleth shibboleth-embedded-ds
1719
1820# 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
2226java -version
23- javac -version
27+ # javac -version
2428
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
3438
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 || :
3842SOLR_USER=solr
3943echo " Ensuring Unix user '$SOLR_USER ' exists"
4044useradd $SOLR_USER || :
4145DOWNLOAD_DIR=' /dataverse/downloads'
42- GLASSFISH_ZIP =" $DOWNLOAD_DIR /payara-5.201 .zip"
46+ PAYARA_ZIP =" $DOWNLOAD_DIR /payara-5.2020.2 .zip"
4347SOLR_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...."
4650 cd $DOWNLOAD_DIR && ./download.sh && cd
4751 echo " Done running download script."
4852fi
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 /
5561else
56- echo " $GLASSFISH_ROOT already exists"
62+ echo " $PAYARA_ROOT already exists"
5763fi
64+
5865# service shibd start
59- service httpd stop
66+ /usr/bin/systemctl stop httpd
6067cp /dataverse/conf/httpd/conf.d/dataverse.conf /etc/httpd/conf.d/dataverse.conf
6168mkdir -p /var/www/dataverse/error-documents
6269cp /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
6471# curl -k --sslv3 https://pdurbin.pagekite.me/Shibboleth.sso/Metadata > /tmp/pdurbin.pagekite.me
6572# cp -a /etc/shibboleth/shibboleth2.xml /etc/shibboleth/shibboleth2.xml.orig
6673# cp -a /etc/shibboleth/attribute-map.xml /etc/shibboleth/attribute-map.xml.orig
@@ -72,6 +79,7 @@ service httpd start
7279# service shibd restart
7380# curl -k --sslv3 https://pdurbin.pagekite.me/Shibboleth.sso/Metadata > /downloads/pdurbin.pagekite.me
7481# service httpd restart
82+
7583echo " #########################################################################################"
7684echo " # This is a Vagrant test box, so we're disabling firewalld. #
7785echo " # Re-enable it with $ sudo systemctl enable firewalld && sudo systemctl start firewalld #"
0 commit comments