ISLANDORA UNCG PRODUCTION INSTALLATION STEPS

**DRAFT***DRAFT***DRAFT***DRAFT***DRAFT***DRAFT***DRAFT***DRAFT


These are the commands that we will use to install the full islandora stack on libdigital.uncg.edu

GENERAL TODOS


# TODO: PHP TWEAKS -- check out this page:
# https://www.drupal.org/docs/7/system-#requirements/drupal-7-php-requirements
# TODO: Set root bash log to log everything and rotate

ADJUST LOGGING

# add the following to the bottom of every .bashrc for every user (including root)



# add the following to the bottom of every .bashrc for every user (including root)


# Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".
# http://stackoverflow.com/questions/9457233/unlimited-bash-history
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
# Change the file location because certain bash sessions truncate .bash_history file upon close.
# http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login
export HISTFILE=~/.bash_eternal_history
# Force prompt to write history after every command.
# http://superuser.com/questions/20900/bash-history-loss
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"

ENVIRONMENT DETAILS


Centos 7
Apache 2.4.6
Mariadb 5.5.60-1
PHP 7.1.8
Composer 1.7.2
Drush 7.4.0

colorbox                                        
islandora_solution_pack_audio-7.x-1.11
ctools                                          
islandora_solution_pack_book-7.x-1.11
entity                                          
islandora_solution_pack_collection
i18n                                            
islandora_solution_pack_compound-7.x-1.11
imagemagick                                     
islandora_solution_pack_image-7.x-1.11
islandora                                       
islandora_solution_pack_large_image-7.x-1.11
islandora_batch-7.x-1.11                        
islandora_solution_pack_ohms-master
islandora_book_batch-7.x-1.11                   
islandora_solution_pack_pdf
islandora_importer-7.x-1.11                     
islandora_videojs-7.x-1.11
islandora_internet_archive_bookreader-7.x-1.11  
islandora_xml_forms-7.x-1.11
islandora_ocr-7.x-1.11                          
islandora_youtube-master
islandora_openseadragon-7.x-1.11                
libraries
islandora_paged_content                         
objective_forms-7.x-1.11
islandora_pdfjs-7.x-1.11                        
php_lib-7.x-1.11
islandora_solr_collection_view-7.x              
islandora_solr_metadata-7.x-1.11                
rules
islandora_solr_search-7.x-1.11                  
token
islandora_solr_views-7.x-1.11                   
views

LIBRARIES

bookreader  
colorbox  
jail  
openseadragon  
pdfjs  
tuque  
video.js-master

####
#### BEGIN SETUP INSTRUCTIONS
####


# Have virtual server created with appropriate compute, storage and network settings

# Install CentOS 7 onto virtual server
   # During installation, create a non-administrative user called "services"
   # During installation, set password for root.

# Once installation has completed, reboot then verify ability to log in via ssh remotely.

# If behind proxy, ensure appropriate entries have been made to allow internet traffic through.

# install "screen"

# ssh into server, use screen, run yum -y update

# Edit /etc/ssh/sshd.conf to prevent root login via ssh.

- Setup and configure VNC for easier remote access
- Install php
- Install java

SET SELINUX TO PERMISSIVE MODE


sed -i -e's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config

SET UP SYSTEM VARIABLES


### PROBLEM.. Using this method as-is does not escape the environment variables, may have to edit /etc/profile.d/fedora-profile.sh manually instead of catting info in as shown below. ###

cat << EOF > /etc/profile.d/fedora-profile.sh

JAVA_HOME=/usr/java/jdk1.8.0_162
FEDORA_HOME=/usr/local/fedora
CLASSPATH=$JAVA_HOME/jre/lib
CATALINA_HOME=$FEDORA_HOME/tomcat
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStore=$FEDORA_HOME/server/truststore"
JAVA_OPTS="$JAVA_OPTS -Djavax.net.ssl.trustStorePassword=tomcat"
JAVA_OPTS="$JAVA_OPTS -Xmx512m"
PATH="$PATH:$FEDORA_HOME/server/bin:$FEDORA_HOME/client/bin:/opt/apache-maven-3.5.3/bin"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib
JRE_HOME=/usr/java/jdk1.8.0_162/jre
J2SDKDIR=/usr/java/jdk1.8.0_162
J2REDIR=/usr/java/jdk1.8.0_162/jre
DJATOKA_HOME="/usr/local/djatoka"
KAKADU_LIBRARY_PATH=/usr/local/djatoka/lib/Linux-x86-64
export JAVA_HOME CLASSPATH CATALINA_HOME JAVA_OPTS FEDORA_HOME LD_LIBRARY_PATH JRE_HOME J2SDKDIR J2REDIR KAKADU_LIBRARY_PATH DJATOKA_HOME PATH

EOF

source /etc/profile.d/fedora-profile.sh

INSTALL AND CONFIGURE VNC


###### Needs work due to the manual password part ######

yum -y install tigervnc-server

cat << EOF > /etc/systemd/system/vncserver-services@.service

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking

# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l services -c "/usr/bin/vncserver %i"
PIDFile=/home/services/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target
EOF

####### This will have to be done maually #######
# su - services
# vncserver
# now enter the password you want to use
#################################################


firewall-cmd --permanent --add-port=5901/tcp
systemctl reload firewalld
systemctl start vncserver-services@:1.service
systemctl enable vncserver-services@:1.service

CREATE DIRECTORY FOR THE COLLECTED INSTALLATION ITEMS


mkdir /opt/tempFilesDir
mkdir /opt/bin

# Now download and unzip the collected installation materials zip file into /opt/tempFilesDir.

INSTALLING APACHE


yum -y groupinstall web-server

# NOTE: Here are the packages that you get when installing the web-server group.


 crypto-utils
 httpd
 httpd-manual
 mod_fcgid
 mod_ssl
 apr
 apr-util
 httpd-tools
 mailcap
 perl-Newt

OPEN HTTP FIREWALL PORTS


firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent

INSTALLING AND CONFIGURING PHP

# NOTE: I had to weigh php-7.0 vs php-7.1 vs php-7.2. It appears that Red Hat and the CentOS project are still working to validate php-7.2 for inclusion into the software collections repository. 7.1 is the latest available at the time of this writing.

NOTE: As mentioned in this posts opening, the official software collections instructions specify the use of php-fpm.
In iteration 3 prime, it has been suspected that the configuration of php-fpm is responsible for negatively-impacted functionality within drupal core modules and islandora modules. For this iteration, I will be using Remi Collet’s packaged version, which seems to bypass php-fpm configuration on our part.


# install remi repository

yum -y install epel-release yum-utils
yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php71

# Install php7_1


yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql -y

# Install composer

cd /opt/tempFilesDir
php composerInstaller
mv composer.phar /usr/local/bin/composer
chown -R services:services /usr/local/bin/composer
cat << EOF > /etc/profile.d/composer_bin.sh
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
EOF

source /etc/profile.d/composer_bin.sh
# (might have to log out and back in)

#enable and start apache

systemctl enable httpd
systemctl start httpd

Question: How to ensure php isnt installed from some other repositories in the future as a dependency for an unrelated app?

I'll have to think about this.

INSTALLING AND CONFIGURING MariaDB


yum -y install mariadb-server mariadb
systemctl enable mariadb
systemctl start mariadb

yum -y install expect

MYSQL_ROOT_PASSWORD=abcd1234

SECURE_MYSQL=$(expect -c "
set timeout 10
spawn mysql_secure_installation
expect "Enter current password for root (enter for none):"
send "$MYSQL\r"
expect "Change the root password?"
send "n\r"
expect "Remove anonymous users?"
send "y\r"
expect "Disallow root login remotely?"
send "y\r"
expect "Remove test database and access to it?"
send "y\r"
expect "Reload privilege tables now?"
send "y\r"
expect eof
")

echo "$SECURE_MYSQL"

mySqlRootPass='SpartanBlueGold#1!'
mySqlDrupUserPass='SpartanBlueGold#2!'

CREATE DATABASE drupalIslandoraUncgOne CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE USER 'drupalDbUserOne'@'localhost' IDENTIFIED BY 'SpartanBlueGold#2!';

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON drupal.* TO 'drupalDbUserOne'@'localhost';

FLUSH PRIVILEGES;

DRUPAL LAYER


#Get required PHP packages (some may already be installed)

yum install php-mbstring
yum install php-gd
yum install php-xml
yum install php-fpm
yum install php-mysqlnd
yum -y install php-ldap
yum -y install php-pear
yum -y install php-gd
yum -y install php-odbc
yum -y install php-xml
yum -y install php-xmlrpc
yum -y install php-snmp
yum -y install php-soap

yum -y install php-mbstring php-gd php-xml php-fpm php-mysqlnd php-ldap php-pear php-gd php-odbc php-xml php-xmlrpc php-snmp php-soap

yum -y install curl wget postfix

#Perform edits to Php.ini config to allow larger transactions

sed -i -e's/upload_max_filesize = 2M/upload_max_filesize = 2048M/' /etc/php.ini

sed -i -e's/post_max_size = 8M/post_max_size = 2048M/' /etc/php.ini

sed -i -e's/memory_limit = 128M/memory_limit = 256M/' /etc/php.ini

INSTALL JAVA


yum -y localinstall /opt/tempFilesDir/jdk-8u162-linux-x64.rpm 

alternatives --set java /usr/java/jdk1.8.0_162/jre/bin/java
alternatives --set javaws /usr/java/jdk1.8.0_162/bin/javaws
alternatives --set javac /usr/java/jdk1.8.0_162/bin/javac

# Paths have been set in properties file in earlier step.

INSTALL JAVA BUILD TOOLS


#INSTALL ANT

yum -y install ant

#INSTALL MAVEN

cp /opt/tempFilesDir/apache-maven-3.5.4-bin.tar.gz /usr/local/src

cd /usr/local/src

tar -xf apache-maven-3.5.4-bin.tar.gz

mv apache-maven-3.5.4 apache-maven


## BROKEN, paste in the contents instead ###

cat << EOF > /etc/profile.d/maven.sh

# Apache Maven Environment Variables
# MAVEN_HOME for Maven 1 - M2_HOME for Maven 2

export M2_HOME=/usr/local/src/apache-maven
export PATH=${M2_HOME}/bin:${PATH}
EOF

chmod 2777 /etc/profile.d/maven.sh

source /etc/profile.d/maven.sh

INSTALL DRUPAL AND DRUSH


# install Drush via Composer

# drush makes heavy use of wget, so ensure that /etc/wgetrc has proper entries if you are using a proxy.

yum -y install git

git clone https://github.com/drush-ops/drush.git /usr/local/src/drush
cd /usr/local/src/drush
git checkout 7.0.0-alpha5  #or whatever version you want.
ln -s /usr/local/src/drush/drush /usr/bin/drush
composer install

# install drupal 7 via drush

cd /var/www/html/
drush dl drupal-7
#this gets us drupal 7.6
mv /var/www/html/drup* /var/www/html/islandora
chown -R apache:apache /var/www/html/islandora

cp /var/www/html/islandora/sites/default/default.settings.php /var/www/html/islandora/sites/default/settings.php 

chmod a+w /var/www/html/islandora/sites/default/settings.php
chmod a+w /var/www/html/islandora/sites/default

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/drupal(/.*)?"

restorecon -RFv /var/www/html/islandora/

# configure apache config file


cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.original

#this comments out the current documentroot

sed -i -r 's/DocumentRoot "\/var\/www\/html"/\#DocumentRoot "\/var\/www\/html"/' /etc/httpd/conf/httpd.conf

# set up the httpd.conf file

cat << EOF >> /etc/httpd/conf/httpd.conf

<Directory "/var/www/html/islandora">
  AllowOverride All
  Require all granted
  RewriteEngine on
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>

<IfModule alias_module>
  Alias /islandora/ "/var/www/html/islandora/"
  <Directory "/var/www/html/islandora/">
    Allow from all
  </Directory>
</IfModule>

<IfModule alias_module>
  Alias /islandora "/var/www/html/islandora/"
  <Directory "/var/www/html/islandora/">
    Allow from all
  </Directory>
</IfModule>

<VirtualHost *:80>
        DocumentRoot "/var/www/html/islandora"
        ServerName islandora
        ProxyRequests Off
        ProxyPreserveHost On

        <Proxy *>
        Order deny,allow
        Allow from all
        </Proxy>

        ProxyPass /adore-djatoka http://localhost:8080/adore-djatoka
        ProxyPassReverse /adore-djatoka http://localhost:8080/adore-djatoka

</VirtualHost>

EOF

# The configuration above will also take care of clean urls. Be sure to check the clean url test page as soon as you finish installing Drupal. (admin > Configuration > Search > Clean urls.)

# then go back and test on the drupal page to make sure its working.

FEDORA LAYER


#set up fedora database

echo "CREATE DATABASE fedora3" | mysql -uroot -pSpartanBlueGold#1!
echo "CREATE USER 'fedoraDbAdmin'@'localhost' IDENTIFIED BY 'redhat'" | mysql -uroot -pSpartanBlueGold#1!
echo "GRANT ALL ON fedora3.* TO 'fedoraDbAdmin'@'localhost'" | mysql -uroot -pSpartanBlueGold#1!
echo "flush privileges" | mysql -uroot -pSpartanBlueGold#1!

# PREPARE FEDORA INSTALLATION PROPERTIES

cd /opt/tempFilesDir/

cat << EOF > /opt/tempFilesDir/fedorainstall.properties

Installation type - custom
home directory - /usr/local/fedora
Password - fedoraAdmin
server host - localhost
API-A - false
ssl avail - true
ssl required for api-a - false
ssl required for api-m - false
servlet included - included
tomcat home - /usr/local/fedora/tomcat
tomcat http port - 8080
tomcat shutdown - 8005
tomcat ssl - 8443
keystore file - included
databse - mysql
database username - fedoraDbAdmin
database password - redhat
Use upstream HTTP authentication - false
Enable FESL authz - false
policy enforcement - true
low level storage - akubra-fs
Enable Resource Index - true
Enable Messaging - true
deploy local services - true

EOF

# Prepare "$FEDORA_HOME"

if [ ! -d "$FEDORA_HOME" ]; then
  mkdir "$FEDORA_HOME"
fi

# EXTRA: Here is what interactive mode yields


################################################################
############## Here is what the interactive yields #############

***********************
  Fedora Installation 
***********************

To install Fedora, please answer the following questions.
Enter CANCEL at any time to abort the installation.
Detailed installation instructions are available online:

            https://wiki.duraspace.org/display/FEDORA/All+Documentation

Installation type
-----------------
The 'quick' install is designed to get you up and running with Fedora    
as quickly and easily as possible. It will install Tomcat and an         
embedded version of the Derby database. SSL support and XACML policy     
enforcement will be disabled.                                            
For more options, including the choice of hostname, ports, security,     
and databases, select 'custom'.                                          
To install only the Fedora client software, enter 'client'.

Options : quick, custom, client

Enter a value ==> custom

Fedora home directory
---------------------
This is the base directory for Fedora scripts, configuration files, etc.  
Enter the full path where you want to install these files.

Enter a value [default is /usr/local/fedora] ==>  

WARNING: /usr/local/fedora is not empty.
WARNING: Overwrite? (yes or no) [default is no] ==> y

Fedora administrator password
-----------------------------
Enter the password to use for the Fedora administrator (fedoraAdmin) account.

Enter a value ==> fedoraAdmin


Fedora server host
------------------
The host Fedora will be running on.                                        
If a hostname (e.g. www.example.com) is supplied, a lookup will be         
performed and the IP address of the host (not the host name) will be used  
in the default Fedora XACML policies.


Enter a value [default is localhost] ==> 


Fedora application server context
---------------------------------
The application server context Fedora will be running in.                  
If 'fedora' (default) is supplied, the resulting context path              
will be http://www.example.com/fedora.                                     
It must be ensured that the configured application server context          
matches this path if explicitly configured.


Enter a value [default is fedora] ==> 


Authentication requirement for API-A
------------------------------------
Fedora's management (API-M) interface always requires user authentication. 
Require user authentication for Fedora's access (API-A) interface?

Options : true, false

Enter a value [default is false] ==> 


SSL availability
----------------
Should Fedora be available via SSL?  Note: this does not preclude   
regular HTTP access; it just indicates that it should be possible for     
Fedora to be accessed over SSL.

Options : true, false

Enter a value [default is true] ==> true


SSL required for API-A
----------------------
Should API-A be accessible exclusively via SSL?  If true, requests 
to access API-A URLs will be automatically redirected to the secure port.

Options : true, false

Enter a value [default is false] ==> 


SSL required for API-M
----------------------
Should API-M be accessible exclusively via SSL?  If true, requests 
to access API-M URLs will be automatically redirected to the secure port.

Options : true, false

Enter a value [default is true] ==> false


Servlet engine
--------------
Which servlet engine will Fedora be running in?                          
Enter 'included' to use the bundled Tomcat 6.0.35 server.                
To use your own, existing installation of Tomcat, enter 'existingTomcat'.
Enter 'other' to use a different servlet container.

Options : included, existingTomcat, other

Enter a value [default is included] ==> included


Tomcat home directory
---------------------
Please provide the full path to your existing Tomcat installation, or  
the path where you plan to install the bundled Tomcat.


Enter a value [default is /usr/local/fedora/tomcat] ==> 


Tomcat HTTP port
----------------
Which HTTP port (non-SSL) should Tomcat listen on?  This can be changed   
later in Tomcat's server.xml file.


Enter a value [default is 8080] ==> 


Tomcat shutdown port
--------------------
Which port should Tomcat use for shutting down?  Make sure this doesn't   
conflict with an existing service.  This can be changed later in Tomcat's 
server.xml file.


Enter a value [default is 8005] ==> 


Tomcat Secure HTTP port
-----------------------
Which port (SSL) should Tomcat listen on?  This can be changed            
later in Tomcat's server.xml file.


Enter a value [default is 8443] ==> 


Keystore file
-------------
For SSL support, Tomcat requires a keystore file.                         
If the keystore file is located in the default location expected by       
Tomcat (a file named .keystore in the user home directory under which     
Tomcat is running), enter 'default'.                                      
Otherwise, please enter the full path to your keystore file, or, enter    
'included' to  use the the  sample, self-signed certificate) provided by  
the installer.                                                            
For more information about the keystore file, please consult:             
http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html.

Enter a value ==> included


Database
--------
Please select the database you will be using with   
Fedora. The supported databases are Derby, MySQL, Oracle and Postgres.     
If you do not have a database ready for use by Fedora or would prefer to   
use the embedded version of Derby bundled with Fedora, enter 'included'.

Options : derby, mysql, oracle, postgresql, included

Enter a value ==> mysql


MySQL JDBC driver
-----------------
You may either use the included JDBC driver or your own copy.              
Enter 'included' to use the included JDBC driver, or, enter the location   
(full path) of the driver.


Enter a value [default is included] ==> 


Database username
-----------------
Enter the database username Fedora will use to connect to the Fedora database.

Enter a value ==> fedoraDbAdmin


Database password
-----------------
Enter the database password Fedora will use to connect to the Fedora database.

Enter a value ==> redhat


JDBC URL
--------
Please enter the JDBC URL.


Enter a value [default is jdbc:mysql://localhost/fedora3?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true] ==> 


JDBC DriverClass
----------------
Please enter the JDBC driver class.


Enter a value [default is com.mysql.jdbc.Driver] ==> 


Validating database connection...Successfully connected to MySQL
OK

Use upstream HTTP authentication (Experimental Feature)
-------------------------------------------------------
You may wish to rely on a local SSO or other external source for HTTP 
authentication and subject attributes. 
WARNING: This is an experimental feature and should be enabled only with the
understanding that integration with external authentication will require 
further configuration and that this is not yet a stable Fedora feature. 
We invite you to try it out and give us feedback.  
Use upstream authentication?

Options : true, false

Enter a value [default is false] ==> 


Enable FeSL AuthZ (Experimental Feature)
----------------------------------------
Enable FeSL Authorization? This is an experimental replacement for Fedora's 
legacy authorization module, and is still under development.                
Production repositories should NOT enable this, but we invite you to try it 
out and give us feedback.


Enter a value [default is false] ==> 


Policy enforcement enabled
--------------------------
Should XACML policy enforcement be enabled?  Note: This will put a set of 
default security policies in play for your Fedora server.

Options : true, false

Enter a value [default is true] ==> 


Low Level Storage
-----------------
Which low-level (file) storage plugin do you want to use?                  
We recommend akubra-fs for new installs.  If you are upgrading Fedora from 
version 3.3 or below, you should use legacy-fs for compatibility with your 
existing storage.  Other plugins are also available, but they must be      
configured after installation.

Options : akubra-fs, legacy-fs

Enter a value [default is akubra-fs] ==> 


Enable Resource Index
---------------------
Enable the Resource Index?

Options : true, false

Enter a value [default is false] ==> true


Enable Messaging
----------------
Enable Messaging? Messaging sends notifications of API-M events via JMS.

Options : true, false

Enter a value [default is false] ==> true


Messaging Provider URI
----------------------
Please enter the messaging provider URI. For more information about        
using ActiveMQ broker URIs, see                                            
http://activemq.apache.org/broker-uri.html


Enter a value [default is vm:(broker:(tcp://localhost:61616))] ==> 


Deploy local services and demos
-------------------------------
Several sample back-end services are included with this distribution.      
These are required if you want to use the demonstration objects.           
If you'd like these to be automatically deployed, enter 'true'.            
Otherwise, the installer will put the files in your FEDORA_HOME/install    
directory in case you want to deploy them later.

Options : true, false

Enter a value [default is true] ==> 


Preparing FEDORA_HOME...
	Configuring fedora.fcfg
	Installing beSecurity
Installing Tomcat...
Preparing fedora.war...
Deploying fedora.war...
Deploying fop.war...
Deploying imagemanip.war...
Deploying saxon.war...
Deploying fedora-demo.war...
Installation complete.

----------------------------------------------------------------------
Before starting Fedora, please ensure that any required environment
variables are correctly defined
	(e.g. FEDORA_HOME, JAVA_HOME, JAVA_OPTS, CATALINA_HOME).
For more information, please consult the Installation & Configuration
Guide in the online documentation.
----------------------------------------------------------------------

# CREATE, ENABLE, AND START fedoratomcat SYSTEMD SERVICE


cat << EOF >> /etc/systemd/system/fedoratomcat.service
[Unit]
Description= Fedora Commons Service
After=syslog.target network.target

[Service]
Type=forking

ExecStart=/usr/local/fedora/tomcat/bin/startup.sh
ExecStop=/usr/local/fedora/tomcat/bin/shutdown.sh

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable fedoratomcat.service
systemctl start fedoratomcat.service

## SETTING FEDORA XACML POLICIES


# remove deny-purge policies and anonymous policies

rm -rf /usr/local/fedora/data/fedora-xacml-policies/repository-policies/default/deny-purge-*


tar -xvf /opt/tempFilesDir/fedIslaXacml.tar.gz

mv islandora/ /usr/local/fedora/data/fedora-xacml-policies/repository-policies/


## INSTALL FLASH PLAYER (this version of fedora still needs it)


cd /opt/tempFilesDir

yum -y localinstall flash-player-npapi-31.0.0.148-release.x86_64.rpm

#### INSTALL / CONFIGURE DRUPAL FILTER


cp /opt/tempFilesDir/fcrepo-drupalauthfilter-3.8.1.jar /usr/local/fedora/tomcat/webapps/fedora/WEB-INF/lib


### Navigate to $FEDORA_HOME/server/config and open the file jaas.conf in a text editor.

#### Manually replace the fedora-auth block with this

fedora-auth
{
org.fcrepo.server.security.jaas.auth.module.XmlUsersFileModule required
debug=true;
ca.upei.roblib.fedora.servletfilter.DrupalAuthModule required
debug=true;
};

cat << EOF > /usr/local/fedora/server/config/filter-drupal.xml




SELECT DISTINCT u.uid AS userid, u.name AS Name, u.pass AS Pass,r.name AS Role FROM (users u LEFT JOIN users_roles ON u.uid=users_roles.uid) LEFT JOIN role r ON r.rid=users_roles.rid WHERE u.name=? AND u.pass=?;



EOF

chown apache:apache /usr/local/fedora/server/config/jaas.conf
chown apache:apache /usr/local/fedora/server/config/filter-drupal.xml


### At this point, download the filter validator and test

cd /opt/tempFilesdir

tar -xvf drupal_filter_validator.tar.gz

mv drupal_filter_validator ../bin

cd ../bin/drupal_filter_validator/


./test_db_connection.py $FEDORA_HOME/server/config/filter-drupal.xml

# At this point, test fedora’s basic functionality.
Log in to the fedora server via VNC as the services user.
Open firefox web browser and navigate to http://localhost:8080/fedora

You should see the fedora info page.

Also visit http://localhost:8080/fedora/admin and make sure you can access it. May need to bypass old flash plugin warning or update it.

(offical guide says to test ingestion here but Im not sure if we should ever do that in fedora. Only via the islandora front end. So we will further test later via the automated testing suite)

##### Tuque library


cd /opt/tempFilesDir

unzip tuque_1dotX.zip

mv tuque-1.x/

mv tuque-1.x/ /var/www/html/islandora/sites/all/libraries/

cd /var/www/html/islandora/sites/all/libraries/

mv tuque-1.x tuque

chown -R apache:apache /var/www/html/islandora/sites/all/libraries/tuque

#INSTALLING ISLANDORA CORE MODULE


cd /opt/tempFilesDir

unzip /opt/tempFilesDir/IslandoraCore7.x-1.11.zip 

mv islandora-7.x-1.11/ /var/www/html/islandora/sites/all/modules/

mv /var/www/html/islandora/sites/all/modules/islandora-7.x-1.11 /var/www/html/islandora/sites/all/modules/islandora

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora

### Now log in to islandora and go to admin > modules and checkbox islandora on.

cd /opt/tempFilesDir/
unzip islandora_solution_pack_collection_7.x.1.11.zip 
 mv islandora_solution_pack_collection-7.x-1.11/ /var/www/html/islandora/sites/all/modules/

mv /var/www/html/islandora/sites/all/modules/islandora_solution_pack_collection-7.x-1.11 /var/www/html/islandora/sites/all/modules/islandora_solution_pack_collection

chown -R apache:apache islandora_solution_pack_collection/

## Now go into the drupal modules menu, turn on Basic Collection Solution Pack, and save config. There should now be a "islandora repository" link on the navigation pane. 

PDF AND IMAGING BASIC PACKS, AND DRUPAL IMAGEMAGICK MODULE


yum -y install poppler-utils
yum -y install ghostscript
yum -y install ImageMagick

cd /opt/tempFilesDir/
unzip /opt/tempFilesDir/imagemagick-7.x-1.0.zip
mv imagemagick /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora

chown -R apache:apache /var/www/html/islandora/sites/all/modules/imagemagick/

unzip BasicImageSolutionPack7.x-1.11.zip
mv islandora_solution_pack_image-7.x-1.11/ /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solution_pack_image-7.x-1.11


cd /opt/tempFilesDir
unzip PDFpack7.x-1.11.zip

mv islandora_solution_pack_pdf-7.x-1.11/ /var/www/html/islandora/sites/all/modules/

mv /var/www/html/islandora/sites/all/modules/islandora_solution_pack_pdf-7.x-1.11/ /var/www/html/islandora/sites/all/modules/islandora_solution_pack_pdf/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solution_pack_pdf/

#INSTALL SOLR


$FEDORA_HOME/tomcat/bin/shutdown.sh

cd /opt/tempFilesDir
tar -xvf /opt/tempFilesDir/solr-4.2.0.tgz
cd /opt/tempFilesDir/solr-4.2.0
cp -R example/solr /usr/local/fedora/solr
mv dist/solr-4.2.0.war dist/solr.war
cp -v dist/solr.war /usr/local/fedora/tomcat/webapps/


touch /usr/local/fedora/tomcat/conf/Catalina/localhost/solr.xml

cat << EOF > /usr/local/fedora/tomcat/conf/Catalina/localhost/solr.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="/usr/local/fedora/tomcat/webapps/solr.war" debug="0" crossContext="true">
  <Environment name="solr/home" type="java.lang.String" value="/usr/local/fedora/solr" override="true"/>
</Context>
EOF

cd /opt/tempFilesDir
unzip DG_Basic_Solr_Config.zip 

cp -r /opt/tempFilesDir/basic-solr-config-4.x/conf /usr/local/fedora/solr/collection1/conf


################# This Block Prob no longer necessary #######
sed -i "s|<filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>|<filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>|g" /usr/local/fedora/solr/collection1/conf/schema.xml
###########################

# INSTALL GSEARCH


cd /opt/tempFilesdir
unzip fedoragsearch-2.7.zip
cd fedoragsearch-2.7

cp fedoragsearch.war /usr/local/fedora/tomcat/webapps/

unzip $CATALINA_HOME/webapps/fedoragsearch.war -d $CATALINA_HOME/webapps/fedoragsearch

# SET UP BUILD CONFIGURATION FILES


edit /usr/local/fedora/tomcat/webapps/fedoragsearch/FgsConfig/fgsconfig-basic-for-islandora.properties

## go to https://wiki.duraspace.org/display/ISLANDORA7111/milestone+6+-+Installing+Solr+and+GSearch 

## follow along with those instructions.

#CREATE fgsAdmin USER


#Create an fgsAdmin user by pasting the code into the users block of /usr/local/fedora/server/config/fedora-users.xml

<user name="fgsAdmin" password="SpartanBlueGold#2!">
  <attribute name="fedoraRole">
    <value>administrator</value>
  </attribute>
</user>

# ALTER THE PROPERTIES FILES

— again use instructions on page listed above, look at the ++ and —

BUILD BASIC CONFIGURATION


cd /usr/local/fedora/tomcat/webapps/fedoragsearch/FgsConfig/
ant -f fgsconfig-basic.xml

ant generateIndexingXslt

########### maybe no need? not sure yet #######
cp /usr/local/fedora/solr/collection1/conf/schema.xml /usr/local/fedora/solr/collection1/conf/schema.xml.backup19MAR2018

systemctl restart fedoratomcat

DGI SEARCH EXTENSIONS


cd /opt/tempFilesDir
unzip dgi_gsearch_extensions-master.zip
cd /opt/tempFilesDir/dgi_gsearch_extensions-master/
mvn package

cp /opt/tempFilesDir/dgi_gsearch_extensions-master/target/gsearch_extensions-0.1.3-jar-with-dependencies.jar $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/lib/

cd  $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex

cp /opt/tempFilesDir/basic-solr-config-4.x/foxmlToSolr.xslt /usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/

unzip /opt/tempFilesDir/islandora_transforms.zip
rm -rf /opt/tempFilesDir/islandora_transforms.zip
mv /opt/tempFilesDir/islandora_transform* /opt/tempFilesDir/islandora_transforms

cp -rv /opt/tempFilesDir/islandora_transforms /usr/local/fedora/tomcat/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex


colorbox
ctools
imagemagick
islandora
islandora_batch-7.x-1.11
islandora_book_batch-7.x-1.11
islandora_find_replace-master
islandora_importer-7.x-1.11
islandora_internet_archive_bookreader-7.x-1.11
islandora_ocr-7.x-1.11
islandora_openseadragon-7.x-1.10
islandora_paged_content-7.x-1.11
islandora_pdfjs-7.x-1.11
islandora_solr_collection_view-7.x
islandora_solr_metadata-7.x
islandora_solr_search-7.x-1.10
islandora_solr_search-7.x-1.5
islandora_solr_views-7.x
islandora_solution_pack_audio-7.x-1.5
islandora_solution_pack_book-7.x-1.11
islandora_solution_pack_collection
islandora_solution_pack_compound-7.x-1.11
islandora_solution_pack_image
islandora_solution_pack_large_image-7.x
islandora_solution_pack_ohms-master
islandora_solution_pack_pdf
islandora_xml_forms
islandora_youtube-master
libraries
objective_forms
php_lib
README.txt
token
token-7.x-1.7.zip
unicorns_are_awesome-7.x
views


[dchardin@libdev-f libraries]$ ls
bookreader  colorbox  openseadragon  pdfjs  README.txt  tuque


Test your GSearch installation
Go to http://localhost:8080/fedoragsearch/rest
Login using fedoraAdmin 
Click on updateindex
Click on updateIndex fromFoxmlFiles 

Drupal Solr Module
Installation Steps:

Verify that fedoraGSearch and Solr are both installed and running at http://localhost:8080/solr

Solr does not automatically load existing content upon installation. Go to Core Admin -> Reload tab

Download the Islandora Solr Search Module and install as a 
Drupal module, as you did in the Starter Kit modules

Log in to your Drupal site to enable the islandora_solr_search module. Administer > Modules and enable Islandora Solr Search
Access the [Structure]:[Blocks] tab, go to the bottom of the blocks list in the Disabled section, find the "+ Islandora simple search" block and drag it up to the Sidebar first section.

Replace the original Drupal search block with the one from Islandora on the sidebar

You should now be able to see the Islandora search box in the on the sidebar. 

To allow other users than Admin (user 1) to see the Islandora simple Search box, or search the solr index, grant them the 'Search the Solr Index' Drupal Permission at /admin/people/permissions.

Testing the Solr installation
Just entry a keyword in the Islandora search field related to some of the test objects you ingest in the Starter Kit collections. If they come up on the list everything is working as it should

# INSTALL SOLR DRUPAL MODULE


cd /opt/tempFilesDir
cp -R islandora_solr_search-7.x-1.11 /var/www/html/islandora/sites/all/modules/

mv /var/www/html/islandora/sites/all/modules/islandora_solr_search-7.x-1.11/ /var/www/html/islandora/sites/all/modules/islandora_solr_search/

chown apache:apache /var/www/html/islandora/sites/all/modules/islandora_solr_search/

#remember to log in to the site and activate the module, then move the search box and make available for those appropriate.

# CONFIGURE INTERNET ARCHIVE BOOKREADER, OPENSEADRAGON, AND DJATOKA


#paste the following into the file
#/usr/local/fedora/tomcat/bin/startup.sh above
#the line that starts with "exec "$PRGDIR...."

. /usr/local/djatoka/bin/env.sh
export JAVA_OPTS
echo $JAVA_OPTS

# Move djatoka into usr/local


cd /opt/tempFilesDir/
unzip adore-djatoka-1.1.zip 
mv adore-djatoka-1.1 djatoka
mv djatoka /usr/local

# Modify the /usr/local/djatoka/bin/env.sh file by removing the original contents and paste in the following:


#!/bin/sh
# setup environment variables for shell script

# Define DJATOKA_HOME dynamically
CURRENTDIR=$PWD
LAUNCHDIR=$DJATOKA_HOME/bin
#cd ..
LIBPATH=$DJATOKA_HOME/lib

if [ `uname` = 'Linux' ] ; then
  if [ `uname -p` = "x86_64" ] ; then
    # Assume Linux AMD 64 has 64-bit Java
    PLATFORM="Linux-x86-64"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
    KAKADU_LIBRARY_PATH="-DLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
  else
    # 32-bit Java
    PLATFORM="Linux-x86-32"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
    KAKADU_LIBRARY_PATH="-DLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
  fi
elif [ `uname` = 'Darwin' ] ; then
  # Mac OS X
  PLATFORM="Mac-x86"
  export PATH="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin:$PATH"
  export DYLD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
  KAKADU_LIBRARY_PATH="-DDYLD_LIBRARY_PATH=$LIBPATH/$PLATFORM"
elif [ `uname` = 'SunOS' ] ; then
  if [ `uname -p` = "i386" ] ; then
    # Assume Solaris x86
    PLATFORM="Solaris-x86"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
  else
    # Sparcv9
    PLATFORM="Solaris-Sparcv9"
    LD_LIBRARY_PATH="$LIBPATH/$PLATFORM"
    export LD_LIBRARY_PATH
  fi
else
  echo "djatoka env: Unsupported platform: `uname`"
  exit
fi

KAKADU_HOME=$DJATOKA_HOME/bin/$PLATFORM
export KAKADU_HOME
#cd $LAUNCHDIR
#for line in `ls -1 $LIBPATH | grep '.jar'`
#  do
#  classpath="$classpath:$LIBPATH/$line"
#done

#DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
#CLASSPATH=.:../build/:$classpath
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dkakadu.home=$KAKADU_HOME -Djava.library.path=$LIBPATH/$PLATFORM $KAKADU_LIBRARY_PATH"

# If a proxy server is used in your institution... uncomment and set the following:

#proxySet=true
#proxyPort=3128
#proxyHost=proxy.something.com
#JAVA_OPTS="$JAVA_OPTS -DproxySet=$proxySet -DproxyPort=$proxyPort -#DproxyHost=$proxyHost"

# MAKE KAKADU AVAILABLE VIA COMMAND LINE


ln -s /usr/local/djatoka/bin/Linux-x86-64/kdu_expand /usr/bin/kdu_expand
ln -s /usr/local/djatoka/bin/Linux-x86-64/kdu_compress /usr/bin/kdu_compress
echo "/usr/local/djatoka/lib/Linux-x86-64" > /etc/ld.so.conf.d/kakadu.conf
ldconfig

#Install Cantaloupe


cd /opt/tempFilesDir

wget https://github.com/medusa-project/cantaloupe/releases/download/v4.0/cantaloupe-4.0.zip
unzip cantaloupe-4.0.zip
mv cantaloupe-4.0 /usr/local/cantaloupe

mkdir -p /srv/cantaloupe/cache 
mkdir /srv/cantaloupe/log /srv/cantaloupe/home /srv/cantaloupe/tmp
useradd -d /srv/cantaloupe/home -s /bin/false cantaloupe

chown -R cantaloupe:cantaloupe /srv/cantaloupe /usr/local/cantaloupe

cat > /etc/systemd/system/cantaloupe.service <<END_CLP
[Unit]

Description=Cantaloupe Image Server

[Service]

Type=simple
User=cantaloupe
ExecStart=/usr/bin/java -Dcantaloupe.config=/usr/local/cantaloupe/cantaloupe.properties -Xmx256m -jar /usr/local/cantaloupe/cantaloupe-4.0.war
ExecStop=/usr/bin/killall -9 cantaloupe-4.0.war
Restart=on-failure

[Install]
WantedBy=multi-user.target
END_CLP

systemctl daemon-reload
systemctl enable cantaloupe.service
systemctl start cantaloupe.service

cat > /opt/bin/cantaloupe-purge.sh <<END_CLP
#!/bin/bash
cd /usr/local/cantaloupe
# - edit this for your enpoint API user and password
wget -q --server-response --user=MyEndpointApiUsername --password=MyEndpointApiSecret --post-data='{ "verb" : "PurgeCache" }' --header=Content-Type:application/json http://localhost:8182/tasks
END_CLP

###############
# IMPORTANT!! Remember to come back later and set passwords!!
###############

chmod 750 /opt/bin/cantaloupe-purge.sh

#Root's crontab should contain something like this:
```
# Cantaloupe daily purge of cache
# 00 23 * * * /opt/bin/cantaloupe-purge.sh >>/usr/local/cantaloupe/cantaloupe-purge.log 2>&1
```
#Regardless of how you install Cantaloupe, do the following configuration:


cd /usr/local/cantaloupe
cp -p cantaloupe.properties.sample cantaloupe.properties
cp /usr/local/cantaloupe/deps/Linux-x86-64/lib/libkdu_* /usr/lib/
cp -p delegates.rb.sample delegates.rb
sed -i "s|temp_pathname =.*$|temp_pathname = /srv/cantaloupe/tmp|" cantaloupe.properties
sed -i "s|http.host = 0.0.0.0|http.host = 127.0.0.1|" cantaloupe.properties
sed -i "s|FilesystemSource.BasicLookupStrategy.path_prefix = /home/myself/images/|FilesystemSource.BasicLookupStrategy.path_prefix = /tmp/|" cantaloupe.properties

# edit these following two for the username/password you will use - needed because the purge script has to use the API now.

#!#sed -i "s|endpoint.api.enabled = false|endpoint.api.enabled = true|" cantaloupe.properties

#!#sed -i "s|endpoint.api.username =.*$|endpoint.api.username = cantaloupeapiuser|" cantaloupe.properties

sed -i "s|endpoint.api.secret =.*$|endpoint.api.secret = SpartanBlueGold#2\!|" cantaloupe.properties 
sed -i "s|log.application.level = debug|log.application.level = warn|" cantaloupe.properties

sed -i "s|log.application.ConsoleAppender.enabled = true|log.application.ConsoleAppender.enabled = false|" cantaloupe.properties

sed -i "s|log.application.FileAppender.pathname = /path/to/logs/application.log|log.application.FileAppender.pathname = /srv/cantaloupe/log/application.log|" cantaloupe.properties

sed -i "s|log.application.RollingFileAppender.enabled = false|log.application.RollingFileAppender.enabled = true|" cantaloupe.properties

sed -i "s|log.application.RollingFileAppender.pathname = /path/to/logs/application.log|log.application.RollingFileAppender.pathname = /srv/cantaloupe/log/application.log|" cantaloupe.properties

sed -i "s|log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/application-%d{yyyy-MM-dd}.log|log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/cantaloupe/log/application-%d{yyyy-MM-dd}.log|" cantaloupe.properties

sed -i "s|log.error.FileAppender.enabled = false|log.error.FileAppender.enabled = true|" cantaloupe.properties

sed -i "s|log.error.FileAppender.pathname = /path/to/logs/error.log|log.error.FileAppender.pathname = /srv/cantaloupe/log/error.log|" cantaloupe.properties

sed -i "s|log.error.RollingFileAppender.pathname = /path/to/logs/error.log|log.error.RollingFileAppender.pathname = /srv/cantaloupe/log/error.log|" cantaloupe.properties

sed -i "s|log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/error-%d{yyyy-MM-dd}.log|log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/cantaloupe/log/error-%d{yyyy-MM-dd}.log|" cantaloupe.properties

sed -i "s|log.access.FileAppender.pathname = /path/to/logs/access.log|log.access.FileAppender.pathname = /srv/cantaloupe/log/access.log|" cantaloupe.properties
 
sed -i "s|log.access.RollingFileAppender.pathname = /path/to/logs/access.log|log.access.RollingFileAppender.pathname = /srv/cantaloupe/log/access.log|" cantaloupe.properties
 
sed -i "s|log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/access-%d{yyyy-MM-dd}.log|log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/cantaloupe/log/access-%d{yyyy-MM-dd}.log|" cantaloupe.properties
 
sed -i "s|processor.jp2 = KakaduNativeProcessor|processor.jp2 = OpenJpegProcessor|" cantaloupe.properties
 
sed -i "s|processor.stream_retrieval_strategy = StreamStrategy|processor.stream_retrieval_strategy = CacheStrategy|" cantaloupe.properties
 
sed -i "s|cache.server.derivative.enabled = false|cache.server.source.enabled = true|" cantaloupe.properties
 
sed -i "s|cache.server.derivative =*|cache.server.derivative = FilesystemCache|" cantaloupe.properties
 
sed -i "s|cache.server.worker.enabled = false|cache.server.worker.enabled = true|" cantaloupe.properties
 
sed -i "s|source.static = FilesystemSource|source.static = HttpSource|" cantaloupe.properties
 
sed -i "s|HttpSource.trust_all_certs = false|HttpSource.trust_all_certs = true|" cantaloupe.properties
 
##################################################################################################
# - DigiBESS and Islandora Vagrant differ on these (besides the latter not yet being at 4.0...)
##################################################################################################

#sed -i "s|endpoint.iiif.content_disposition = none|endpoint.iiif.content_disposition = inline|" cantaloupe.properties
 
#sed -i "s|cache.server.derivative.enabled = false|cache.server.derivative.enabled = true|" cantaloupe.properties
 
#sed -i "s|cache.server.ttl_seconds = 2592000|cache.server.ttl_seconds = 259200|" cantaloupe.properties
 
#sed -i "s|FilesystemCache.pathname = /var/cache/cantaloupe|FilesystemCache.pathname = /srv/cantaloupe/cache|" cantaloupe.properties
 
#sed -i "s|HttpSource.lookup_strategy = BasicLookupStrategy|HttpSource.lookup_startegy = ScriptLookupStrategy|" cantaloupe.properties
 
#sed -i "s|HttpSource.BasicLookupStrategy.url_prefix = http://localhost/images/|HttpSource.BasicLookupStrategy.url_prefix =|" cantaloupe.properties
 
#sed -i "s|HttpSource.BasicLookupStrategy.auth.basic.username =|HttpSource.BasicLookupStrategy.auth.basic.username = anonymous|" cantaloupe.properties
 
#sed -i "s|HttpSource.BasicLookupStrategy.auth.basic.secret =|HttpSource.BasicLookupStrategy.auth.basic.secret = anonymous|" cantaloupe.properties

#########################################################################################################
#Islandora Vagrant uses a Cantaloupe provided script, called `delegates-3.4.rb` that permits "obfuscation" of URLs. We leave further configuration of this service as an exercise to the reader. See the DigiBESS site.
#########################################################################################################



#########################################################################################################
############### The following are legacy config steps. Not required, but kept JIC ######################
#########################################################################################################


#Check Java Library Path with:
#java -XshowSettings:properties

@@ -11,11 +11,11 @@
@@ -98,23 +98,23 @@
 
# Minimum size that will be used in info.json `tiles` keys. The user manual
# explains how these are calculated.

-endpoint.iiif.min_tile_size = 512
+endpoint.iiif.min_tile_size = 1024
 
 # SOURCES
@@ -122,7 +122,7 @@
 
 # If true, `source.static` will be overridden, and the `source()` delegate
 # method will be used to select a source per-request.
@@ -139,7 +139,7 @@
@@ -149,8 +149,8 @@
@@ -159,15 +159,15 @@
@@ -306,7 +306,7 @@

 # Color of the background when an image is rotated or alpha-flattened, for
 # output formats that don't support transparency.
 # This may not be respected for indexed color derivative images.
-processor.background_color = white
+processor.background_color = black

@@ -373,7 +373,7 @@
 
 # !! Optional absolute path of the directory containing the ImageMagick
 # binary. Overrides the PATH.
-ImageMagickProcessor.path_to_binaries =
+ImageMagickProcessor.path_to_binaries = /usr/local/bin
 
 #----------------------------------------
 # KakaduDemoProcessor
@@ -421,18 +421,18 @@
 
 # Amount of time source cache content remains valid. Set to blank or 0
 # for forever.
-cache.server.source.ttl_seconds = 2592000
+cache.server.source.ttl_seconds = 86400
 
 # Enables the derivative (processed image) cache.
-cache.server.derivative.enabled = false
+cache.server.derivative.enabled = true
 
 # Available values are `FilesystemCache`, `JdbcCache`, `RedisCache`,
 # `HeapCache`, `S3Cache`, and `AzureStorageCache`.
-cache.server.derivative =
+cache.server.derivative = FilesystemCache
 
 # Amount of time derivative cache content remains valid. Set to blank or 0
 # for forever.
-cache.server.derivative.ttl_seconds = 2592000
+cache.server.derivative.ttl_seconds = 86400
 
 # Whether to use the Java heap as a "level 1" cache for image infos, either
 # independently or in front of a "level 2" derivative cache (if enabled).
@@ -451,18 +451,18 @@
 
 # !! Enables the cache worker, which periodically purges invalid cache
 # items in the background.
-cache.server.worker.enabled = false
+cache.server.worker.enabled = true
 
 # !! The cache worker will wait this many seconds before starting its
 # next shift.
-cache.server.worker.interval = 86400
+cache.server.worker.interval = 43200
 
 #----------------------------------------
 # FilesystemCache
 #----------------------------------------
 
 # If this directory does not exist, it will be created automatically.
-FilesystemCache.pathname = /var/cache/cantaloupe
+FilesystemCache.pathname = /srv/cache
 
 # Levels of folder hierarchy in which to store cached images. Deeper depth
 # results in fewer files per directory. Set to 0 to disable subdirectories.

@@ -643,18 +643,18 @@
 #----------------------------------------
 
 # `trace`, `debug`, `info`, `warn`, `error`, `all`, or `off`
-log.application.level = debug
-
-log.application.ConsoleAppender.enabled = true
+log.application.level = warn
+
+log.application.ConsoleAppender.enabled = false
 
 # N.B.: Don't enable FileAppender and RollingFileAppender simultaneously!
 log.application.FileAppender.enabled = false
-log.application.FileAppender.pathname = /path/to/logs/application.log
-
-log.application.RollingFileAppender.enabled = false
-log.application.RollingFileAppender.pathname = /path/to/logs/application.log
+log.application.FileAppender.pathname = /srv/log/application.log
+
+log.application.RollingFileAppender.enabled = true
+log.application.RollingFileAppender.pathname = /srv/log/application.log
 log.application.RollingFileAppender.policy = TimeBasedRollingPolicy
-log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/application-%d{yyyy-MM-dd}.log
+log.application.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/application-%d{yyyy-MM-dd}.log
 log.application.RollingFileAppender.TimeBasedRollingPolicy.max_history = 30
 
 # See the "SyslogAppender" section for a list of facilities:
@@ -672,13 +672,13 @@
 # into a dedicated error log, which may make them easier to spot.
 
 # N.B.: Don't enable FileAppender and RollingFileAppender simultaneously!
-log.error.FileAppender.enabled = false
-log.error.FileAppender.pathname = /path/to/logs/error.log
+log.error.FileAppender.enabled = true
+log.error.FileAppender.pathname = /srv/log/error.log
 
 log.error.RollingFileAppender.enabled = false
-log.error.RollingFileAppender.pathname = /path/to/logs/error.log
+log.error.RollingFileAppender.pathname = /srv/log/error.log
 log.error.RollingFileAppender.policy = TimeBasedRollingPolicy
-log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/error-%d{yyyy-MM-dd}.log
+log.error.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/error-%d{yyyy-MM-dd}.log
 log.error.RollingFileAppender.TimeBasedRollingPolicy.max_history = 30
 
 #----------------------------------------
@@ -689,14 +689,14 @@
 
 # N.B.: Don't enable FileAppender and RollingFileAppender simultaneously!
 log.access.FileAppender.enabled = false
-log.access.FileAppender.pathname = /path/to/logs/access.log
+log.access.FileAppender.pathname = /srv/log/access.log
 
 # RollingFileAppender is an alternative to using something like
 # FileAppender + logrotate.
 log.access.RollingFileAppender.enabled = false
-log.access.RollingFileAppender.pathname = /path/to/logs/access.log
+log.access.RollingFileAppender.pathname = /srv/log/access.log
 log.access.RollingFileAppender.policy = TimeBasedRollingPolicy
-log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /path/to/logs/access-%d{yyyy-MM-dd}.log
+log.access.RollingFileAppender.TimeBasedRollingPolicy.filename_pattern = /srv/log/access-%d{yyyy-MM-dd}.log
 log.access.RollingFileAppender.TimeBasedRollingPolicy.max_history = 30
 
 # See the "SyslogAppender" section for a list of facilities:

################################################################################################
################################################################################################
############################ End legacy cantaloupe configs #####################################
################################################################################################
################################################################################################

# Install Islandora Bookreader


cd /opt/tempFilesDir

mkdir /var/www/html/islandora/sites/all/
unzip /opt/tempFilesDir/bookreader.zip

mv internet_archive_bookreader-master bookreader

cp -r /opt/tempFilesDir/bookreader /var/www/html/islandora/sites/all/libraries/

chown -R apache:apache /var/www/html/islandora/sites/all/libraries/bookreader

unzip /opt/tempFilesDir/bookreaderModule.zip 

mv islandora_internet_archive_bookreader-7.x-1.11/ /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_internet_archive_bookreader-7.x-1.11/

unzip /opt/tempFilesDir/colorbox1x_library.zip

cp -r /opt/tempFilesDir/colorbox-1.x /var/www/html/islandora/sites/all/libraries/colorbox

chown -R apache:apache /var/www/html/islandora/sites/all/libraries/colorbox

unzip /opt/tempFilesDir/colorbox-7.x-2.13.zip

cp -r /opt/tempFilesDir/colorbox /var/www/html/islandora/sites/all/modules

chown -R apache:apache /var/www/html/islandora/sites/all/modules/colorbox

unzip /opt/tempFilesDir/libraries-7.x-2.4.zip

cp -r /opt/tempFilesDir/libraries /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/libraries

unzip /opt/tempFilesDir/token-7.x-1.7.zip

cp -r /opt/tempFilesDir/token /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/token

unzip /opt/tempFilesDir/islandora_paged_content.zip

mv islandora_paged_content-7.x-1.11/ islandora_paged_content

cp -r /opt/tempFilesDir/islandora_paged_content /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_paged_content


# Log in and enable the colorbox and libraries modules

# Configuration
# Set the 'djatoka image compression level', 'Solr field relating pages to book PIDs ', 
# 'Overlay Opacity', a content type to be displayed in the IAV, and select the 
# 'Default page view' in Administration » Islandora » Islandora Viewers » 
# Internet Archive BookReader (/admin/islandora/islandora_viewers/internet_archive_bookreader).
# Additional options involve behavior for mobile users, and using the JPG datastream as a 
# backup in case Djatoka cannot return a JP2.
#
# Note: to use Internet Archive Bookreader as a viewer for Book or Newspaper Solutions Pack, 
# you'll also need to set "djatoka URL" in Islandora Paged Content config page.

# Install openseadragon

cd /opt/tempFilesDir

unzip /opt/tempFilesDir/openseadragon-7.x-1.11

mv /opt/tempFilesDir/islandora_openseadragon-7.x-1.11 /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_openseadragon-7.x-1.11

unzip /opt/tempFilesDir/openseadragon-bin-2.3.1.zip

mv /opt/tempFilesDir/openseadragon-bin-2.3.1 /opt/tempFilesDir/openseadragon
mv /opt/tempFilesDir/openseadragon /var/www/html/islandora/sites/all/libraries/

chown -R apache:apache /var/www/html/islandora/sites/all/libraries/openseadragon

# activate module.

# Error as written below is OK
#Notice: Use of undefined constant ISLANDORA_OPENSEADRAGON_REQUIRED_VERSION - assumed 
#'ISLANDORA_OPENSEADRAGON_REQUIRED_VERSION' in islandora_openseadragon_requirements() 
#(line 29 of /var/www/html/islandora/sites/all/modules/islandora_openseadragon-7.x-1.11/islandora_openseadragon.install).

# Ensure libxml2 installed for XML modules:

yum -y install libxml2

#Install PDFjs


# REQUIREMENTS
#
# - Islandora (done)
# - Tuque (done)
# - Libraries (done)
# - pdf.js
#

cd /opt/tempFilesDir

unzip /opt/tempFilesDir/islandora_pdfjs-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_pdfjs-7.x-1.11 /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_pdfjs-7.x-1.11
unzip /opt/tempFilesDir/pdfjs-1_9_426_library.zip
mv /opt/tempFilesDir/pdfjs /var/www/html/islandora/sites/all/libraries/
chown -R apache:apache /var/www/html/islandora/sites/all/libraries/pdfjs

# Install XML Forms


# REQUIREMENTS

# - Islandora (installed)
# - Tuque (installed)
# - PHP Lib
# - Objective Forms  
# - libxml2 version 2.7+ (installed)

cd /opt/tempFilesDir

unzip /opt/tempFilesDir/php_lib-7.x-1.11.zip
mv /opt/tempFilesDir/php_lib-7.x-1.11 /var/www/html/islandora/sites/all/modules
chown -R apache:apache /var/www/html/islandora/sites/all/modules/php_lib-7.x-1.11

unzip /opt/tempFilesDir/objective_forms-7.x-1.11.zip
mv /opt/tempFilesDir/objective_forms-7.x-1.11 /var/www/html/islandora/sites/all/modules
chown -R apache:apache /var/www/html/islandora/sites/all/modules/objective_forms-7.x-1.11

unzip /opt/tempFilesDir/islandora_xml_forms-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_xml_forms-7.x-1.11 /var/www/html/islandora/sites/all/modules
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_xml_forms-7.x-1.11

# Install Islandora_Solr_Views


# REQUIREMENTS
#
# Isladora (installed)
# Tuque (installed)
# Solr 1.4 (installed)
# Views (3.x)
# Ctools

unzip /opt/tempFilesDir/ctools-7.x-1.15.zip
mv /opt/tempFilesDir/ctools /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/ctools

unzip /opt/tempFilesDir/views-7.x-3.20.zip
mv /opt/tempFilesDir/views /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/views

unzip /opt/tempFilesDir/islandora_solr_views-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_solr_views-7.x-1.11 /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solr_views-7.x-1.11

# Upon enabling the Drupal Views, Drupal Views UI and Islandora Solr Search modules, 
# the Views configuration screen should be available at 
# Administration > Structure > Views (admin/structure/views). 

# INSTALL ISLANDORA OCR


# REQUIREMENTS
# - Islandora (installed)
# - Tuque (installled)
# - Tesseract (3.02.02 or later)
# - ImageMagic (Optional, Required for OCR preprocessing) (installed)
# - Islandora Paged Content (Optional) (installed)

# We will need to enable the epel repo for a short time in order to obtain tessaract

# For CentOS
yum -y install epel-release

# For RHEL
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E '%{rhel}').noarch.rpm

yum -y install tesseract

mv /etc/yum.repos.d/epe* inactive/

cd /opt/tempFilesDir

unzip islandora_ocr-7.x-1.11.zip
mv islandora_ocr-7.x-1.11 /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_ocr-7.x-1.11

# INSTALL ISLANDORA SOLR COLLECTION VIEW


cd /opt/tempFilesDir/

unzip /opt/tempFilesDir/islandora_solr_collection_view-7.x.zip
mv /opt/tempFilesDir/islandora_solr_collection_view-7.x /var/www/islandora/sites/all/modules
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solr_collection_view-7.x

# INSTALL ISLANDORA SOLR METADATA


unzip /opt/tempFilesDir/islandora_solr_metadata-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_solr_metadata-7.x-1.11 /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solr_metadata-7.x-1.11

# INSTALL ISLANDORA SOLUTION PACK AUDIO


# REQUIREMENTS:
#
# Islandora (Installed)
# Tuque (Installed)
# The LAME Encoder is required for derivative creation
# Video.js and its corresponding Islandora module can be used to play audio files in the View tab (Optional)
#
#

cd /etc/yum.repos.d/
mv /etc/yum.repos.d/inactive/epel.repo /etc/yum.repos.d/
yum -y install lame lame-devel
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/inactive

cd /opt/tempFilesDir
unzip /opt/tempFilesDir/video.js-master.zip
mv /opt/tempFilesDir/video.js-master /var/www/html/islandora/sites/all/libraries/
chown -R apache:apache /var/www/html/islandora/sites/all/libraries/video.js-master/

cd /opt/tempFilesDir
unzip /opt/tempFilesDir/islandora_videojs-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_videojs-7.x-1.11 
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_videojs-7.x-1.11/

unzip /opt/tempFilesDir/islandora_solution_pack_audio-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_solution_pack_audio-7.x-1.11 /var/www/html/islandora/sites/all/modules/

# INSTALL ISLANDORA_BATCH


cd /opt/tempFilesDir

unzip /opt/tempFilesDir/islandora_batch-7.x-1.11.zip

mv /opt/tempFilesDir/islandora_batch-7.x-1.11 /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_batch-7.x-1.11/

# INSTALL ISLANDORA_IMPORTER


cd /opt/tempFilesDir

unzip /opt/tempFilesDir/islandora_importer-7.x-1.11.zip

mv /opt/tempFilesDir/islandora_importer-7.x-1.11 /var/www/html/islandora/sites/all/modules/

chown apache:apache /var/www/html/islandora/sites/all/modules/islandora_importer-7.x-1.11

# INSTALL_ISLANDORA_SOLUTION_PACK_LARGE_IMAGE


# REQUIREMENTS
#
# 

unzip /opt/tempFilesDir/islandora_solution_pack_large_image-7.x-1.11.zip

mv /opt/tempFilesDir/islandora_solution_pack_large_image-7.x-1.11 /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solution_pack_large_image-7.x-1.11/

#CONFIGURATION


Configure the image-toolkit to use ImageMagick rather than GD in Administration > Configuration > Media > Image Toolkit (admin/config/media/image-toolkit). If GD is selected, TN and JPG datastreams will not be generated.


Select configuration options and viewer in Administration > Islandora > Large Image Collection (admin/islandora/large_image).

To use Kakadu, make sure that kdu_compress is available to the Apache user. Often users will create symbolic links from /usr/local/bin/kdu_compress to their installation of Kakadu that comes bundled with Adore-Djatoka. Make sure that the required dynamic libraries that come with Kakadu are accessible to kdu_compress and kdu_expand. If they are not present, attempting to run either command from the terminal will inform you that the libraries are missing. You can also use a symbolic link from /usr/local/lib to include these libraries. Remember to restart the terminal so your changes take affect. Also, make sure the php settings allow for enough memory and upload size: upload_max_filesize, post_max_size and memory_limit.



###

# INSTALL_ISLANDORA_SOLUTION_PACK_BOOK


# REQUIREMENTS
#
#    Islandora (installed)
#    Tuque (installed)
#    Islandora Paged Content (installed)
#    Large Image Solution Pack is required for creating thumbnail and JPEG datastreams
#    Islandora OCR is required for creating OCR datastreams
#    Islandora Internet Archive Bookreader can be used to view books (optional)
#    Open Seadragon can be used to view pages (optional)
#    ImageMagick is required for creating PDF datastreams (optional)

unzip /opt/tempFilesDir/islandora_solution_pack_book-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_solution_pack_book-7.x-1.11/ /var/www/html/islandora/sites/all/modules

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solution_pack_book-7.x-1.11

# INSTALL ISLANDORA_BOOK_BATCH



# REQUIREMENTS
#
# Book solutionn pack (installed)
#

cd /opt/tempFilesDir
unzip islandora_book_batch-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_book_batch-7.x-1.11 /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_book_batch-7.x-1.11

#####

# INSTALL RULES AND ENTITY API AND i18n MODULE


cd /opt/tempFilesDir
unzip /opt/tempFilesDir/rules-7.x-2.12.zip
mv /opt/tempFilesDir/rules /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/rules

cd /opt/tempFilesDir
unzip /opt/tempFilesDir/entity-7.x-1.9.zip
mv /opt/tempFilesDir/entity /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/entity

cd /opt/tempFilesDir
unzip /opt/tempFilesDir/i18n-7.x-1.11.zip
mv /opt/tempFilesDir/i18n /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/i18n

# Activate batch_report and rules modules

#INSTALL ISLANDORA_SOLUTION_PACK_COMPOUND


# REQUIREMENTS
#
# ISLANDORA (Installed)
# JAIL library

cd /opt/tempFilesDir
unzip /opt/tempFilesDir/JAIL-master.zip

mv /opt/tempFilesDir/JAIL-master /opt/tempFilesDir/jail
mv /opt tempFilesDir/jail /var/www/html/islandora/sites/all/libraries
chown -R apache:apache /var/www/html/islandora/sites/all/libraries/jail

unzip /opt/tempFilesDir/islandora_solution_pack_compound-7.x-1.11.zip
mv /opt/tempFilesDir/islandora_solution_pack_compound-7.x-1.11 /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solution_pack_compound-7.x-1.11

#####################################

# INSTALL ISLANDORA_SOLUTION_PACK_OHMS


# REQUIREMENTS
#
# Islandora (installed)

unzip /opt/tempFilesDir/islandora_solution_pack_ohms-master.zip
mv /opt/tempFilesDir/islandora_solution_pack_ohms-master /var/www/html/islandora/sites/all/modules/

chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_solution_pack_ohms-master/

# INSTALL ISLANDORA_YOUTUBE


cd /opt/tempFilesDir

unzip /opt/tempFilesDir/islandora_youtube-master.zip
mv islandora_youtube-master /var/www/html/islandora/sites/all/modules/
chown -R apache:apache /var/www/html/islandora/sites/all/modules/islandora_youtube-master

####

# CONFIGURE SSL

# Enable epel repo first

yum -y install python-certbot-apache

cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf

certbot --apache -d ninedivines.club -d www.ninedivines.club

##########

# Reinstall solr/gsearch

cd /opt/tempFilesDir

git clone https://github.com/discoverygarden/gsearch.git

cd /opt/tempFilesDir/gsearch/FedoraGenericSearch

ant buildfromsource

cd /opt/tempFilesDir/

cp -v /opt/tempFilesDir/gsearch/FgsBuild/fromsource/fedoragsearch.war $CATALINA_HOME/webapps

chown apache:apache $CATALINA_HOME/webapps/fedoragsearch.war

wget http://archive.apache.org/dist/lucene/solr/4.2.0/solr-4.2.0.tgz

tar -xf solr-4.2.0.tgz

If you wish to install Solr under the same Tomcat as Fedora, do the following:
```
cp -r solr-4.2.0/example/solr $FEDORA_HOME/solr
cp solr-4.2.0/example/webapps/solr.war $CATALINA_HOME/webapps/ && unzip -o solr-4.2.0/example/webapps/solr.war -d $CATALINA_HOME/webapps/solr
mkdir $FEDORA_HOME/solr/collection1/data
chown -R apache:apache $FEDORA_HOME

systemctl start fedoratomcat

Prepare `fedoragsearch`:
```

cd $CATALINA_HOME/webapps/fedoragsearch/FgsConfig

#may take time to deploy from last step. keep trying

ant generateIndexingXslt

systemctl stop fedoratomcat

ant -f fgsconfig-basic.xml -Dlocal.FEDORA_HOME=/usr/local/fedora -DgsearchUser=fgsAdmin -DgsearchPass=SpartanBlueGold#2! -DfinalConfigPath=$CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes -DlogFilePath=$FEDORA_HOME/server/logs -DfedoraUser=fedoraAdmin -DfedoraPass=fedoraAdmin -DobjectStoreBase=$FEDORA_HOME/data/objectStore -DindexDir=$FEDORA_HOME/solr/collection1/data/index -DindexingDocXslt=foxmlToSolr -propertyfile fgsconfig-basic-for-islandora.properties

### backup some default files which will be clobbered in the next section.
cd /usr/local/fedora/solr/collection1/conf
mv schema.xml schema.xml.bak
mv solrconfig.xml solrconfig.xml.bak
cd $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/
mv foxmlToSolr.xslt foxmlToSolr.xslt.bak

##### Solr Configuration
```

cd /opt/tempFilesDir
git clone --recursive git://github.com/discoverygarden/basic-solr-config.git
cd basic-solr-config
git checkout 4.x
cp -r /opt/tempFilesDir/basic-solr-config/conf/* /usr/loca/fedora/solr/collection1/conf
cp -r /opt/tempFilesDir/basic-solr-config/islandora_transforms $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex
cp -r /opt/tempFilesDir/basic-solr-config/foxmlToSolr.xslt $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/foxmlToSolr.xslt
cp -r /opt/tempFilesDir/basic-solr-config/index.properties $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/index.properties

```
Similarly, because of the location of the OS based Tomcat and the separation of Solr, we need to edit a few files in the `fedoragsearch` configuration:
```
cd $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/
sed -i "s|/usr/local/fedora/tomcat|$CATALINA_HOME|" foxmlToSolr.xslt
sed -i "s|/usr/local/fedora/tomcat|$CATALINA_HOME|" islandora_transforms/slurp_all_MODS_to_solr.xslt
sed -i "s|/usr/local/fedora/tomcat|$CATALINA_HOME|" islandora_transforms/WORKFLOW_to_solr.xslt

Discovery Garden gsearch extensions. Do one of the following:
```
#cd $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/lib
# wget #https://github.com/discoverygarden/dgi_gsearch_extensions/releases/download/v0.1.1/gsearch_extensions-0.1.1-#jar-with-dependencies.jar -O gsearch_extensions-0.1.1-#jar-with-dependencies.jar
```
```
cd /opt/tempFilesDir
git clone https://github.com/discoverygarden/dgi_gsearch_extensions.git
cd dgi_gsearch_extensions/
mvn package
cp target/gsearch_extensions-0.1.3-jar-with-dependencies.jar $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/lib/

Leave a Reply

Your email address will not be published. Required fields are marked *