Set up DSpace 6.3 on Ubuntu 20.04 LTS

This blog post is an updated guide for installing DSpace on Ubuntu 20.04 LTS, expanding on the previous post about installation on Ubuntu 18.04 LTS.

Hardware Recommendations

The following are recommended hardware specifications for a DSpace server.

Minimum DSpace Production:

  • 3-4GB RAM
  • 20GB Storage

Mid-range DSpace Production:

  • 5-6GB RAM
  • 200GB Storage

High-end DSpace Production:

  • 9-10GB RAM
  • 1TB Storage

Software Requirements

These software components are necessary to run DSpace.

  • Java JDK 8
  • Apache Maven
  • Apache Ant
  • PostgreSQL
  • Apache Tomcat

Create User

Begin by creating a user account named “dspace.”

1
2
sudo useradd -m dspace
sudo passwd dspace

Install PostgreSQL

Install the PostgreSQL database software.

1
sudo apt install postgresql postgresql-client -y

Create a PostgreSQL user named “dspace” with the password “dspace.”

1
2
3
sudo su postgres
createuser -U postgres -d -A -P dspace
exit

Create a database named “dspace.”

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

Activate the “pgcrypto” extension.

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

Modify the PostgreSQL configuration file.

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

Add the following line at the end of the file.

1
local  all  dspace  md5

Restart PostgreSQL.

1
2
sudo systemctl restart postgresql
sudo systemctl status postgresql

Building DSpace

Install OpenJDK 8.

1
sudo apt install openjdk-8-jdk -y

If you have other OpenJDK versions, switch the default to OpenJDK 8.

1
sudo update-alternatives --config java

Install “ant” and “maven.”

1
sudo apt install ant maven -y

Create a directory named “dspace.”

1
2
sudo mkdir /dspace
sudo chown dspace /dspace

Create a build directory for DSpace.

1
2
3
sudo mkdir /build
sudo chmod -R 777 /build
cd /build

Download DSpace 6.3.

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

Extract the downloaded archive.

1
sudo tar xzvf dspace*.tar.gz

Navigate to the extracted directory.

1
cd dspace-6.3-src-release

Copy the configuration file.

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

Compile the DSpace package.

1
sudo mvn -U package

Install DSpace.

1
2
cd dspace/target/dspace-installer
sudo ant fresh_install

Install Apache Tomcat

Download and extract Apache Tomcat 9.

1
2
3
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 the Tomcat directory.

1
sudo mv apache-tomcat-9.0.41 tomcat

Open the environment variables file.

1
sudo nano /etc/profile

Add the following Java environment variables at the end of the file.

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

Copy the DSpace web application files to Tomcat.

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

Create a bash script to enable Tomcat to run automatically.

1
sudo nano /etc/init.d/tomcat

Paste the following script into the file.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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 "; exit 1;;
esac

Set the script as executable and register it as a service.

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

Start the Tomcat server and check its status.

1
2
sudo service tomcat start
sudo service tomcat status

DSpace Administrator

Create an administrator account for DSpace.

1
sudo /dspace/bin/dspace create-administrator

Remove the “builds” directory.

1
sudo rm -rf /build

DSpace Access Test

Access DSpace using the following URLs.

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

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

Licensed under CC BY-NC-SA 4.0
Last updated on May 29, 2024 15:59 +0100