My Tech-Notes

Install DSpace 6.3 on Ubuntu 20.04 LTS

This is an updated blog post over the installation of DSpace 6.3 on Ubuntu 20.04 LTS.
In that guide, we learned how to install DSpace on Ubuntu 20.04 LTS.


Hardware Recommendations

Minimum DSpace Production

Mid-range DSpace Production

High-end DSpace Production


Software Requirements


Create DSpace User

sudo useradd -m dspace
sudo passwd dspace

Install PostgreSQL

sudo apt install postgresql postgresql-client -y

Create a PostgreSQL user:

sudo su postgres
createuser -U postgres -d -A -P dspace
exit

Create a DSpace database:

sudo -u dspace createdb -U dspace -E UNICODE dspace

Activate the pgcrypto extension:

sudo su postgres
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
exit

Edit PostgreSQL configuration:

sudo nano /etc/postgresql/12/main/pg_hba.conf

Add this line at the bottom:

local  all  dspace  md5

Restart PostgreSQL:

sudo systemctl restart postgresql
sudo systemctl status postgresql

Building DSpace

Install OpenJDK 8:

sudo apt install openjdk-8-jdk -y

If you have another JDK installed, set Java 8 as default:

sudo update-alternatives --config java

Install Ant and Maven:

sudo apt install ant maven -y

Create required folders:

sudo mkdir /dspace

sudo chown dspace /dspace

sudo mkdir /build

sudo chmod -R 777 /build

cd /build

Download DSpace 6.3:

wget https://github.com/DSpace/DSpace/releases/download/dspace-6.3/dspace-6.3-src-release.tar.gz

Extract:

sudo tar xzvf dspace*.tar.gz

Move to source folder:

cd dspace-6.3-src-release

Copy local.cfg file:

sudo cp dspace/config/local.cfg.EXAMPLE dspace/config/local.cfg

Build DSpace:

sudo mvn -U package

Install DSpace:

cd dspace/target/dspace-installer
sudo ant fresh_install

Apache Tomcat Installation

Download and extract Apache Tomcat 9:

cd /opt
sudo wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.41/bin/apache-tomcat-9.0.41.tar.gz
sudo tar xzvf apache-tomcat-9.0.41.tar.gz

Rename folder:

sudo mv apache-tomcat-9.0.41 tomcat

Edit /etc/profile:

sudo nano /etc/profile

Add these lines:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export CATALINA_HOME=/opt/tomcat

Copy DSpace webapps:

sudo cp -r /dspace/webapps/* /opt/tomcat/webapps

Tomcat Service Script

Create init script:

sudo nano /etc/init.d/tomcat

Paste:

#!/bin/bash
### BEGIN INIT INFO
# Provides:        tomcat8
# Required-Start:  $network
# Required-Stop:   $network
# Default-Start:   2 3 4 5
# Default-Stop:    0 1 6
# Short-Description: Start/Stop Tomcat server
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

start() {
 sh /opt/tomcat/bin/startup.sh
}

stop() {
 sh /opt/tomcat/bin/shutdown.sh
}

case $1 in
  start|stop) $1;;
  restart) stop; start;;
  *) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac

Make executable and enable service:

sudo chmod +x /etc/init.d/tomcat
sudo update-rc.d tomcat defaults

Start Tomcat:

sudo service tomcat start
sudo service tomcat status

Create DSpace Administrator

sudo /dspace/bin/dspace create-administrator

Example:

graphql

Email: nipul@iiti.ac.in Password: dsapcearch@1980

Cleanup

Delete build folder:

sudo rm -rf /build

Access DSpace

XMLUI: http://localhost:8080/xmlui or http://serverIP:8080/xmlui

JSPUI: http://localhost:8080/jspui or http://serverIP:8080/jspui