Installation of DSpace 6.3 on Ubuntu 20.04 LTS

 Installation of prerequisite applications


·                     Java Development Kit (JDK)

·                     PostgreSQL Database

·                     DSpace Software

·                     Apache Ant (Pure Java Build Tool)

·                     Apache Maven (Apache Build Automation Tool for Java Projects)

·                     Apache Tomcat (Web Server for hosting Dspace)

 

Open Applications > Accessories > Terminal and execute the following commands.

 

 

1.      Log in as Root

 sudo su 

Enter password…..

·                     Update the Ubuntu : apt-get update

·                     Upgrade the Ubuntu : apt-get upgrade

·                     Install OpenJDK 8 : apt-get install openjdk-8-jdk

·           Apache Maven 3.x (Java build tool) and Apache ant : apt-get install ant maven

·                     Relational Database (PostgreSQL) : apt-get install postgresql

2.    Create Dspace user

      useradd -m dspace

      passwd dspace [enter a password for the new user dspace]

      mkdir /dspace

      chown dspace /dspace

  3. Configure Postgresql and create database

- Create the PostgreSQL "dspace" user

Log in to postgresql:

sudo su postgres

Next, we will create a database called “dspace” and database user called “dspace” with password “dspace”. Don’t confuse database user with normal user. Both are different.

createuser -U postgres -d -A -P dspace

Enter password for new role: ## Enter password for the user dsapce

Enter it again: ## Re-enter password

If asked the following:

Shall the new role be allowed to create more new roles? (y/n) y

Answer "y" for yes.

Than type exit and come to root

Open up the /etc/postgresql/12/main/pg_hba.conf file:

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

Add the following line shown in red color at last of the file.

local all dspace md5

Type the following to restart:

/ETC/INIT.D/POSTGRESQL RESTAR

4.Create the postgreSQl “dspace” database

 Login as:

sudo su dspace

createdb -U dspace -E UNICODE dspace

Than type exit and come to root

sudo su postgres

Now type the following command to create extension pgcrypto

PSQL --USERNAME=POSTGRES DSPACE -C "CREATE EXTENSION PGCRYPTO;"

Type the following to restart postgres:

/ETC/INIT.D/POSTGRESQL RESTART  

NOTE: while deleting or creating the database log in to the concern user, like for dspace user (sudo su dspace) than apply the commands 

exit    

 GO TO ROOT

 

5.Create dspace directory

mkdir /build

chmod -R 777 /build

cd /build

6. Download Dspace to/build directory

You can check latest version of Dspace from here.

Run the command mentioned below at command prompt. (Ensure that Internet is working).

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

tar -zxf dspace-6.3-src-release.tar.gz

cd /build/dspace-6.3-src-release

mvn -fn package

(Please note in case of build failure delete the following lines from /build/dspace-6.0-src-release/dspace-api/pom.xml its due to some known Bug)

<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>buildnumber-maven-plugin</artifactId>

<version>1.4</version>

<executions>

<execution>

<phase>validate</phase>

<goals>

<goal>create</goal>

</goals>

</execution>

</executions>

</plugin>

cd dspace/target/dspace-installer

ant fresh_install

7.Inastallation of Tomcat 

Download the and extract the Tomcat package,

cd /opt

sudo wget http://apachemirror.wuchna.com/tomcat/tomcat-9/v9.0.37/bin/apache-tomcat-9.0.37.tar.gz

Or you can visit the Tomcat website and download the latest package.

8. Extract Tomcat package


sudo tar xvzf apache-tomcat-9.0.37.tar.gz

9. Rename folder "apache-tomcat-9.0.37" to "tomcat" and Delete the Tomcat archive file from /opt folder

sudo mv apache-tomcat-9.0.37 tomcat

sudo rm apache-tomcat-9.0.37.tar.gz

Open the following file,

10. Configure Tomcat

sudo nano /etc/profile
Setup environment variables

Environment variables to find JAVA.

Add following lines at the bottom of the file,

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

Copy Dspace web apps files to Tomcat folder

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

Running Tomcat automatically

You can set up to start the Tomcat server start automatically at the time of system turn on.

Open the following file in a Terminal,

sudo nano  /etc/init.d/tomcat

Add following lines in the file,

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


save and close the file.

Apply the following commands too;

sudo chmod +x /etc/init.d/tomcat

      sudo update-rc.d tomcat defaults

Restart Tomcat server and PostgreSQL database

sudo service tomcat start

sudo service tomcat stop

sudo service tomcat restart

sudo /etc/init.d/postgresql restart

sudo /etc/init.d/tomcat restart

11. Make an initial administrator account (an e-person) in DSpace:

Apply following command in a terminal,

sudo /dspace/bin/dspace create-administrator

It will ask to enter the email address for the user login.
Enter an email address (e.g. dspace@localhost).
Enter First name and surname (e.g. dspace)
Enter a password.

Open DSpace in your browser
DSpace has two interfaces; xmlui and jspui. You can load either one Dspace interface in a browser.

http://localhost:8080/xmlui
http://localhost:8080/jspui

Reference:- http://kohageek.blogspot.com/

                      http://libtechnophile.blogspot.com/