Installation of DSpace 6.3 on Ubuntu 18.04.1 LTS


Hi, friends, I could install  Dspace 6.3 (latest) on Ubuntu 18.04.1 LTS successfully after fixing bugs which occurred in the installation process. Here I provide a note for the installation by which you can try. (NB: I highly recommend you to install Ubuntu 18.04.1 minimal or Ubuntu 16.04  or any other lite weight Ubuntu flavors for the fast performance) 

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.

sudo apt update && sudo apt upgrade -y

sudo apt-get install openjdk-8-jdk postgresql ant maven


Choose OpenJDK-8 as default for that run this command

sudo update-alternatives --config java 

Create the database user

sudo -i -u postgres

createuser -U postgres -d -A -P dspace


Enter the password for new role: [Enter a password e.g. dspace]

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

[Enter n and press enter button]

Type exit

Allow the database user (dspace) to connect to the database

[If the following command not open, check the postgresql version number and apply in the command]

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

Add this line to the configuration file at the end:

local all dspace md5

save and close the file

Restart PostgreSQL :

sudo su
/etc/init.d/postgresql restart


Create Dspace user

sudo useradd -m dspace
sudo passwd dspace [enter a password for the new user dspace]
sudo mkdir /dspace
sudo chown dspace /dspace


Create the PostgreSQL 'dspace' database

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

save and close  the file.

Login to the database as a superuser, and enable the pgcrypto

extension on this database

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


exit

sudo /etc/init.d/postgresql restart

Create a directory to build, give all permissions and Download DSpace into /build directory

sudo mkdir /build && sudo chmod -R 777 /build && cd /build && sudo wget https://github.com/DSpace/DSpace/releases/download/dspace-6.3/dspace-6.3-src-release.tar.gz

You can find the latest updated of Dspace 6.x version from this page and copy the link to download the latest version.

Extracting Dspace package

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

Open the following file and remove a piece of lines.

sudo nano /build/dspace-6.3-src-release/dspace-api/pom.xml

Remove the following group of codes. Carefully check the lines in the file.

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


Save and close the file.

Installation of DSpace

Enter into the Dspace package folder and apply the following commands one by one.

cd /build/dspace-6.3-src-release
sudo mvn -U package
cd dspace/target/dspace-installer && sudo ant fresh_install


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

Extract Tomcat package

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

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,

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

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.

Delete the build folder

sudo rm -rf /build

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:
https://github.com/DSpace/DSpace/releases/tag/dspace-6.3
https://tomcat.apache.org/download-80.cgi
https://libtechnophile.blogspot.com/2019/01/installing-dspace-63-in-ubuntu-18041-lts.html
http://dspacegeek.blogspot.com/2019/10/install-dspace-6x-on-ubuntu-16.04.html
https://www.wissenschaft.com.ng/blog/installing-dspace-6-x-on-ubuntu-14-04-16-04-18-04-lts/

0 Komentar