OSDR iteration 3-C

INTRODUCTION:

This is a post for the buildout of OSDR iteration 3-C. Our testing of the last buildout (see OSDR iteration 3-B) showed unexpected behavior. I concluded that the cascading and systemic errors may have been resultant of some “butterfly-effect” fluke during installation or perhaps deep misconfiguration that I overlooked.

In the interest of time, I am thinking that it may be more expediant for me to manually set up yet another stack: paying extremely close attention to each configuration item. David and I can then break up the end-to-end testing into a more unit-like fashion. Should unexpected behavior violate our assertions, we should be able to catch the root cause early-on.

GOALS:

The goal for this iteration is to verify that an islandora installation will function when set up with all desired features, and that the configuration instructions I developed are valid.

We are deviating from the only known “official” setup instructions in the following ways:

– usage of rhel-based OS (Centos 7 / RHEL 7) instead of Ubuntu 14.04 (since ubuntu 14.04 is nearing End-Of-Life, plus many other advantages of rhel / centos)

– PHP 7.1 instead of PHP 5.6
— also had to jump through some hoops to get php 7.1 on rhel/centos for some strange OSC-political reasons

– MariaDB instead of MySql

– Cantaloupe instead of Djatoka (though djatoka will be kept around for support)

– SSL (the main reason why we switched over to cantaloupe)

– Latest 7.x-1.12 islandora packages

Goal breakdown:

– all modules and services pass manual unit tests during the installation process (that means I test each component as I set them up)

– all modules and services pass automated tests after full stack installed (SSL Off)

– all modules and services pass automated tests after full stack installed (SSL On)

– all modules and services pass manual tests after full stack installed (SSL Off)

– all modules and services pass manual tests after full stack installed (SSL On)

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

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.12
ctools                                          
islandora_solution_pack_book-7.x-1.12
entity                                          
islandora_solution_pack_collection
i18n                                            
islandora_solution_pack_compound-7.x-1.12
imagemagick                                     
islandora_solution_pack_image-7.x-1.12
islandora                                       
islandora_solution_pack_large_image-7.x-1.12
islandora_batch-7.x-1.12                        
islandora_solution_pack_ohms-master
islandora_book_batch-7.x-1.12                   
islandora_solution_pack_pdf
islandora_importer-7.x-1.12                   
islandora_videojs-7.x-1.12
islandora_internet_archive_bookreader-7.x-1.12  
islandora_xml_forms-7.x-1.12
islandora_ocr-7.x-1.12                          
islandora_youtube-master
islandora_openseadragon-7.x-1.12                
libraries
islandora_paged_content                         
objective_forms-7.x-1.12
islandora_pdfjs-7.x-1.12                        
php_lib-7.x-1.12
islandora_solr_collection_view-7.x              
islandora_solr_metadata-7.x-1.12                
rules
islandora_solr_search-7.x-1.12                  
token
islandora_solr_views-7.x-1.12                   
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="/opt/adore-djatoka-1.1"
KAKADU_LIBRARY_PATH=/opt/adore-djatoka-1.1/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.67
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

Open /etc/httpd/conf/httpd.conf



ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost

<Directory />
    AllowOverride none
    Require all denied
</Directory>

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error_log"
LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
    LogFormat "%h %l %u %t "%r" %>s %b" common

    <IfModule logio_module>
      LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
    </IfModule>
    
    CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>

AddDefaultCharset UTF-8

<IfModule mime_magic_module>
    MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
IncludeOptional conf.d/*.conf

<VirtualHost *:80>
        
	ServerAdmin webmaster@localhost
	DocumentRoot "/var/www/html/islandora"
        ServerName www.sectorsevengee.club
        ServerAlias sectorsevengee.club
        ProxyRequests Off
        ProxyPreserveHost On

	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>

	<Directory "/var/www/html/islandora">
		Options FollowSymLinks MultiViews
		AllowOverride All
		Require all granted
		RewriteEngine on
		RewriteBase /
		RewriteCond %{REQUEST_FILENAME} !-f
		RewriteCond %{REQUEST_FILENAME} !-d
		RewriteRule ^(.*)$ index.php?q=local256=0COLORTERM0XTERM_VERSION0ROXTERM_ID0KONSOLE_DBUS_SESSION [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>

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

        AllowEncodedSlashes NoDecode

	RequestHeader set X-Forwarded-Path /	
        RequestHeader set X-Forwarded-Port 80


        ProxyPassReverseCookiePath / /
        ProxyPassReverseCookieDomain localhost:8182 www.sectorsevengee.club

	ProxyPass /iiif/2 http://localhost:8182/iiif/2 nocanon
	ProxyPassReverse /iiif/2 http://localhost:8182/iiif/2

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

</VirtualHost>

#Include /etc/httpd/conf/httpd-le-ssl.conf


# 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/OTHER

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
Enter a value ==> custom

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

WARNING: Overwrite? (yes or no) [default is no] ==> y

Fedora administrator password
Enter a value ==> fedoraAdmin


Fedora server host
Enter a value [default is localhost] ==> 


Fedora application server context
Enter a value [default is fedora] ==> 

Authentication requirement for API-A
Enter a value [default is false] ==> 

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

SSL required for API-A
Enter a value [default is false] ==> 

SSL required for API-M
Enter a value [default is true] ==> false

Servlet engine
ter a value [default is included] ==>

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

Tomcat HTTP port
Enter a value [default is 8080] ==> 

Tomcat shutdown port
Enter a value [default is 8005] ==> 

Tomcat Secure HTTP port
Enter a value [default is 8443] ==> 

Keystore file
Enter a value ==> included

Database
Enter a value ==> mysql

MySQL JDBC driver
Enter a value [default is included] ==> 

Database username
Enter a value ==> fedoraDbAdmin

Database password
Enter a value ==> redhat

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

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

Use upstream HTTP authentication (Experimental Feature)
Enter a value [default is false] ==> 

Enable FeSL AuthZ (Experimental Feature)
Enter a value [default is false] ==> 

Policy enforcement enabled
Enter a value [default is true] ==> 

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

Enable Resource Index
Enter a value [default is false] ==> true

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

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

Deploy local services and demos
Enter a value [default is true] ==> 


Preparing FEDORA_HOME...
	Configuring fedora.fcfg
	Installing Security
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 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-*

cd /opt/tempFilesDir/OTHER/

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

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

chown -R apache:apache /usr/local/fedora

## 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

If you are following the usual practice of installing everything under Fedora home, do this, which is needed to be compatible with `basic-solr-configs`.

 `ln -s $CATALINA_HOME $FEDORA_HOME/tomcat`

systemctl start fedoratomcat

#### INSTALL / CONFIGURE DRUPAL FILTER


cp /opt/tempFilesDir/OTHER/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


( You will test after installing Islandora Module. The test is the green check mark in /admin/islandora/configure. It is as simple as that.

#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 and gsearch


systemctl stop fedoratomcat

cd /opt/tempFilesDir/OTHER/

tar -xf solr-4.2.0.tgz

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

# create and fill in file /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>

cd /opt/tempFilesDir/OTHER/discoverygarden_basic-solr-config/basic-solr-config

(looks ike it wants me to confirm to overwrite solrconfig.xml and a few others. maybe thats what that clobberproofing step was for?)

git checkout 4.x

cp -r conf/* /usr/local/fedora/solr/collection1/conf 

#Install gsearch

cd /opt/tempFilesDir/OTHER/discoverygarden_gsearch/gsearch/FedoraGenericSearch

CURRENT_DIR=$PWD  
ant buildfromsource

cp -v /opt/tempFilesDir/OTHER/discoverygarden_gsearch/gsearch/FgsBuild/fromsource/fedoragsearch.war $CATALINA_HOME/webapps
 
chown apache:apache $CATALINA_HOME/webapps/fedoragsearch.war

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

cd $CATALINA_HOME/webapps/fedoragsearch/FgsConfig

# Edit $FEDORA_HOME/server/config/fedora-users.xml to add the fgsAdmin user.

vim $FEDORA_HOME/server/config/fedora-users.xml

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

Modify the fgsconfig-basic.properties file as needed be sure that the following properties are set correctly: <path to fedora home> should be the absolute path to your $FEDORA_HOME directory:

configDisplayName=configDemoOnSolr
local.FEDORA_HOME=<path to fedora home> 
indexEngine=Solr
indexDir=${local.FEDORA_HOME}/solr/collection1/data/index
indexBase=http://localhost:8080/solr 
indexingDocXslt=foxmlToSolr    

ant -f fgsconfig-basic.xml


#### OR #######

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

ant generateIndexingXslt

Discovery Garden gsearch extensions:

cd /opt/tempFilesDir/OTHER/discoverygarden_gsearch_extensions/dgi_gsearch_extensions

mvn package

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

chown -R apache:apache /usr/local/fedora


 ### 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

cd /opt/tempFilesDir/OTHER/discoverygarden_basic-solr-config/basic-solr-config/

cp -r islandora_transforms $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex

cp -r foxmlToSolr.xslt $CATALINA_HOME/webapps/fedoragsearch/WEB-INF/classes/fgsconfigFinal/index/FgsIndex/foxmlToSolr.xslt  

cp -r 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

#######
NOW, it is time to ensure everything we've added has Apache as the owner. Lets chown everything under /usr/local/fedora

#######

#TEST
--- ensure full startup without error via Catalina.out

-- VNC in to server (as these pages are localhost only) and open firefox. 

ensure you can visit 
http://localhost:8080/fedoragsearch
and
http://localhost:8080/fedoragsearch/rest
---no big deal if you get error on log in, we'll fix that in a few.

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

# INSTALL SOLR DRUPAL MODULE


cd /opt/tempFilesDir/OTHER/MODULES
cp -R islandora_solr_search/ /var/www/html/islandora/sites/all/modules/

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

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

# 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 SOLR COLLECTION VIEW

######### DONT TURN THIS MODULE ON YET!! David and I will research it more. ###########


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 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

- Activate the module.

- In Administration » Islandora » Islandora Utility Modules » OCR Tool (admin/islandora/tools/ocr), configure the following:

- Set the path for Tesseract
- Select languages available for OCR
- Enable/disable Solr Fast Vector Highlighting
- Set Solr field containing OCR text and the maximum number of results to return in a Solr query
- ensure  "english" is checked
- set Maximum number....  ...solr query to "32"

# 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_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 INTERNET ARCHIVE BOOKREADER, OPENSEADRAGON, AND DJATOKA


--Follow instructions at https://wiki.duraspace.org/display/ISLANDORA/Djatoka

ln -s /opt/adore-djatoka-1.1/bin/Linux-x86-64/kdu_compress /usr/bin/kdu_compress

ln -s /opt/adore-djatoka-1.1/bin/Linux-x86-64/kdu_expand /usr/bin/kdu_expand

-- For prod,  pay especially close attention to the proxy section in env.sh

-- ensure /etc/ld.so.conf.d/kakadu.conf exists and contains the following line:

/opt/adore-djatoka-1.1/lib/Linux-x86-64

###########

### Remember to set the URL in islandora > solution pack configuration  > Paged Content Module or IAB will not work!!

###########

#Install Cantaloupe


cd /opt/tempFilesDir

wget https://github.com/medusa-project/cantaloupe/releases/download/v4.0.3/cantaloupe-4.0.3.zip
unzip cantaloupe-4.0.3.zip
sudo mv cantaloupe-4.0.3 /opt/

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

sudo chown -R cantaloupe:cantaloupe /opt/cantaloupe-4.0.3

sudo cp /opt/cantaloupe-4.0.3/deps/Linux-x86-64/lib/libkdu_* /usr/lib/

cd /opt/cantaloupe-4.0.3
sudo cp cantaloupe.properties.sample cantaloupe.properties

sed -i "s|temp_pathname =.*$|temp_pathname = /srv/tmp|" cantaloupe.properties

sed -i "s|http.host = 0.0.0.0|http.host = 127.0.0.1|" cantaloupe.properties

sed -i "s|endpoint.admin.enabled = false|endpoint.admin.enabled = true|" cantaloupe.properties

sed -i "s|endpoint.admin.username =.*$|endpoint.admin.username = cantaloupeadminuser|" cantaloupe.properties

sed -i "s|endpoint.admin.secret =.*$|endpoint.admin.secret = SpartanBlueGold#2\!|" cantaloupe.properties 

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|source.static = FilesystemSource|source.static = HttpSource|" cantaloupe.properties

sed -i "s|FilesystemSource.BasicLookupStrategy.path_prefix = /home/myself/images/|FilesystemSource.BasicLookupStrategy.path_prefix = /tmp/|" cantaloupe.properties

sed -i "s|HttpSource.trust_all_certs = false|HttpSource.trust_all_certs = true|" cantaloupe.properties

sed -i "s|HttpSource.request_timeout =|HttpSource.request_timeout = 20|" 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

sed -i "s|processor.stream_retrieval_strategy = StreamStrategy|processor.stream_retrieval_strategy = CacheStrategy|" cantaloupe.properties

sed -i "s|processor.background_color = white|processor.background_color = black|" cantaloupe.properties

sed -i "s|cache.server.source.ttl_seconds = 2592000|cache.server.source.ttl_seconds = 172800|" cantaloupe.properties

sed -i "s|cache.server.derivative.enabled = false|cache.server.derivative.enabled = true|" cantaloupe.properties

sed -i "s|cache.server.derivative =|cache.server.derivative = FilesystemCache|" cantaloupe.properties

sed -i "s|cache.server.derivative.ttl_seconds = 2592000|cache.server.derivative.ttl_seconds = 172800|" cantaloupe.properties

sed -i "s|cache.server.worker.enabled = false|cache.server.worker.enabled = true|" cantaloupe.properties

sed -i "s|FilesystemCache.pathname = /var/cache/cantaloupe|FilesystemCache.pathname = /srv/cache|" cantaloupe.properties

sed -i "s|log.application.level = debug|log.application.level = info|" 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/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/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/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/log/error.log|" cantaloupe.properties

sed -i "s|log.error.RollingFileAppender.pathname = /path/to/logs/error.log|log.error.RollingFileAppender.pathname = /srv/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/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/log/access.log|" cantaloupe.properties
 
sed -i "s|log.access.RollingFileAppender.pathname = /path/to/logs/access.log|log.access.RollingFileAppender.pathname = /srv/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/log/access-%d{yyyy-MM-dd}.log|" cantaloupe.properties

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

Description=Cantaloupe Image Server

[Service]

Type=simple
User=cantaloupe
ExecStart=/usr/bin/java -Dcantaloupe.config=/opt/cantaloupe-4.0.3/cantaloupe.properties -Xmx12g -jar /opt/cantaloupe-4.0.3/cantaloupe-4.0.3.war
ExecStop=/usr/bin/killall -9 cantaloupe-4.0.3.war
Restart=on-failure

[Install]
WantedBy=multi-user.target
END_CLP

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

(QUESTION: do i need to assign the /srv directories to the cantaloupe user??? I will just in case.)

# 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.

for book module onfit, also ensure IAB is selected as book viewer and openseadragon as page viewer.

# 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).


# INSTALL_ISLANDORA_SOLUTION_PACK_LARGE_IMAGE

<pre style="white-space: pre; word-wrap: normal; max-height: 200px;"><code>

# 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/

-- configure book solution pack to use image datastreams

#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.



###

# 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

##########

Leave a Reply

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