Horizontal Navigation

Monday 18 December 2017

Installation of Dspace 6.3 on Ubuntu 16.04

Step 0: Prerequisite Softwares for Creating Institutional Repository Using DSapce 
Must know, what is to be required for creating IR using DSpace:
1. Java Development Kit (JDK)
2. PostgreSQL Database
3. DSpace Software
4. Apache Ant (Pure Java Build Tool)
5. Apache Maven (Apache Build Automation Tool for Java Projects)
6. Apache Tomcat (Web Server for hosting Dspace) 
Open Terminal and execute following commands.  Use [Ctrl+Alt+T] to open Terminal.

Step 1: First update and upgrade your Ubuntu server and then Install All Prerequisite Softwares for creating Institutional Repository at your Institute. Use the following command.

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

Step 2: Create the database user. Please use the following command and follow the instructions.


(i) sudo su postgres
(ii)createuser -U postgres -d -A -P dspace


Enter 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


Step 3: Allow the database user (dspace) to connect to the database

Open the file "pg_hba.conf" by using the following command.
[If the following command not open, check the postgresql version number and apply in the command]

(i) sudo nano /etc/postgresql/9.5/main/pg_hba.conf

Add this line to the configuration file at the end:  

local all dspace md5

save and close the file


(ii) Restart PostgreSQL :


/etc/init.d/postgresql restart


Step 4: Create Dspace user and Dspace Installation Directory:
Execute the following commands one by one. 

(i) sudo useradd -m dspace
(ii)sudo passwd dspace
[enter a password for the new user dspace]
(iii)sudo mkdir /dspace
(iv) sudo chown dspace /dspace


Step 5:
Create the PostgreSQL 'dspace' database and extension pgcrypto:

sudo su dspace 
createdb -U dspace -E UNICODE dspace  

Then type exit and come to root user
 
sudo su postgres


Now type the following command to create extension pgcrypto (simply copy & paste the following command in your command line interface)
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
 

Type the following to restart postgres:
/etc/init.d/postgresql restart


Step 6: Create Dspace Source directory and give permission to it:


sudo mkdir /dspace_build
sudo chmod -R 777 /dspace_build


Step 7: Download Dsapce to /dspace_build directory:
Execute the following command to proceed.

(i) cd /dspace_build

(ii) Then simply Copy and paste (use mouse only) following line in the terminal.


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


(iii) Extract Dspace package by using the following command:


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

Step 8: Use the following command to run maven for the installation of Dspace in Installation Directory (/dspace):


(i) cd /dspace_build/dspace-6.3-src-release
(ii)mvn -U package 


Step 9: Enter into Dspace package folder to download packages by issuing following commands.


(i) cd dspace/target/dspace-installer
(ii)sudo ant fresh_install


Step 10: Installation of Tomcat (one more prerequisite software for Dsapce):

Download the and extract the Tomcat package. First change the current directory to /opt Directory.

(i) cd /opt

(ii) wget http://mirrors.estointernet.in/apache/tomcat/tomcat-9/v9.0.14/bin/apache-tomcat-9.0.14.tar.gz

(iii) tar -xvzf apache-tomcat-9.0.14.tar.gz

(iv) Rename folder "apache-tomcat-9.0.14" to "tomcat". Issue following command to do so.

mv apache-tomcat-9.0.14 tomcat


(v) Delete the package file from /opt folder. Issue following command to do so.


rm apache-tomcat-9.0.14.tar.gz


Step 11: Open following file "/etc/profile" and edit:

(i)gedit /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

Then Save and close file.
Step 12: Copy Dspace webapps files (web deployment directory) to Tomcat folder 

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


Step 13:
Give permission to tomcat owner, so that tomcat can be executed by dspace user by applying following command:
(i) cd /opt
(ii)chown dspace.dspace tomcat/ -R


Step 14: Start Tomcat server:

Use following command to start tomcat server.

/opt/tomcat/bin/startup.sh

 If you want to stop Tomcat server, then use following command:


/opt/tomcat/bin/shutdown.sh

Step 15: Make an initial administrator account (an e-person) in DSpace:


Apply following command in a terminal,

 
/dspace/bin/dspace create-administrator

It will ask to enter email address for user login.

Enter an email address (e.g. dspace@localhost).
Enter First name and surename (e.g. dspace)
Enter a password.

Step 16: Open Dspace in your browser

You can load either one Dspace interface in a browser.

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


References: 

1. https://wiki.duraspace.org/display/DSDOC6x/Installing+DSpace
2. https://listechsavvy.blogspot.in/2016/12/dspace-55-installation-on-ubuntu-1404.html