What's Latest and Fresh in?
KOHA & DSPACE

Wednesday, 6 September 2017

Install dSpace on Ubuntu easy tutorial for librarians

In this article I am going to show a very basic tutorial step by step guide to install "Dspace" on Ubuntu Operating System.


how to install dspace step by step guide


Prerequisites

1. You should know How to Install Ubuntu if you don't know follow LEARN HERE

2. Basic understanding of Command Line Interface or (How to run commands in Terminal-Linux based command prompt)

3. A good internet connection Recommended: 4mbps

After the installation of Ubuntu (any version) follow the tutorial steps carefully!

Steps

1. Open Terminal  & apply following command

sudo su
It will ask you to enter Password of that user, that you have created during the installation and used to log into UBUNTU.

2. Update Ubuntu OS by applying following commands
apt-get update
It will check what things need to update in Ubuntu Operating System when this command completes it process apply following command
apt-get upgrade
It will check if required things are available to install if not it will ask you to download files from Internet. You should press   "Y"  it means you agree to download files from internet that is very necessary to install dSpace. It will take some time to download and install depending upon the condition of your Hardware & Internet speed.

3.  After completing 2nd step install following packages either 1 by 1 or in a single command


  • Leafpad (Editor)
  • openjdk-8-jdk (Envriontment)
  • ant maven
  • Postgre SQL (Database)
you can install these tools by a single command that is
apt-get install leafpad openjdk-8-jdk postgresql ant maven
 It will take some time to download and install these tools depending upon your Interent & Hardware condition.

4. After installing these tools and PostgreSQL "Create a DB User" by applying following commands
sudo su postgres
This command will take you Postgres Database now apply following command
createuser -U postgres -d -A -P dspace
It will ask you to enter password Enter "dspace" twice

NOTE: dspace is necessary you can change later
After doing this apply command
exit

5.  Now open pg_hba.conf file to make some changes you can open it by following command
leafpad /etc/postgresql/9.5/main/pg_hba.conf
 NOTE: If it doesn't open any file there must be wrong in POSTGRESQL version check and apply command accordingly

i.e:   leafpad /etc/postgresql/10.0/main/pg_hba.conf

After opening file copy and paste following line at the end of the "ph.hba.conf" file
local all dspace md5
After pasting save this file and close. Go back to Terminal & Restart the POSTGRESQL by applying following command
/etc/init.d/postgresql restart
 After restarting POSTGRESQL we now have to create user  by using following commands. Apply these commands 1 by 1 in terminal
sudo useradd -m dspace
This command will create a user named dspace 
sudo passwd dspace 
NOTE: This command will ask you to enter password enter "dspace"  you can change it later
sudo mkdir /dspace
This command will create a folder named dspace 
sudo chown dspace /dspace
 This command will give special read/write permission to that folder

6. After complete 5th Step now we have to create a DATABASE in POSTGRESQL by using following command
sudo -u dspace createdb -U dspace -E UNICODE dspace
7. Now it is time to download DSPACE  to complete this we have to create a folder and give it special permission. Use following commands
mkdir /build
This command will create a folder named build 
]chmod -R 777 /build
This command will give special access permission to this folder.
Now apply following command, this command will take you to build folder
cd /build 
 Now add the repositary URL to download dSpace
wget https://github.com/DSpace/DSpace/releases/download/dspace-5.8/dspace-5.8-src-release.tar.gz

This will download DSPACE verision 5.8. After downloading this we have to extract it and install. use following commands to achieve this.
tar -zxf dspace-5.8-src-release.tar.gz
This command will extract the download zipped file of dSpace.
cd /build/dspace-5.8-src-release
This command will take you to the extract folder of dSpace. After reaching to that directory apply following command to update & download dSpace files.
mvn -U package
It will take a while depending upon the Internet Speed.

8. After completing above process apply following commands
cd dspace/target/dspace-installer
this will take you to "dspace installer" directory now we can run installation process of dSpace
use following command to start installation
sudo ant fresh_install
9. After the installation of dSpace we must have a WebServer in order to access dSpace via Web, to do this we are going to install Apache Tomcat Web Server
move to the OPT folder to install Apache Tomcat by applying following command
cd /opt
Apply following command to download Apache Tomcat
wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
 Now extract download folder
tar xvzf apache-tomcat-8.0.37.tar.gz
 This command will extract file to a folder  apache-tomcat-8.0.37 as it is too long & difficult to remember so we have to rename this to something easy i.e: Tomcat
mv apache-tomcat-8.0.37 tomcat
This will rename that long name folder to tomcat 

10. Now we have to create Environment Variables for JAVA just like we do in Windows for PHP while installing XAMPP + Laravel. to do this we have to open PROFILE
leafpad /etc/profile
This will open profile file in leafpad editor, Now copy following lines and paste in the file at the end.
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export CATALINA_HOME=/opt/tomcat
In order to access dSpace we have to copy dSpace's Web App files to Tomcat Folder to do this apply following command
sudo cp -r /dspace/webapps/* /opt/tomcat/webapps
Thats it! we can now access our dSpace using Tomcat Web Services. But we have to run tomcat web server manually every time when ever our PC/Server will boot. To get rid of this we have to make Tomcat run automatically at the time of successful boot. To do this we have to create a file with name "tomcat" in etc/init.d path. Apply following command to create file
leafpad /etc/init.d/tomcat
 It will open a empty file in leafpad editor, Now copy and past following script in it and save.

#!/bin/bash
### BEGIN INIT INFO
# Provides: tomcat7
# 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 file and  close.

11. Now you have to run following two commands that will
chmod +x /etc/init.d/tomcat
update-rc.d tomcat defaults
 This will give tomcat file special rights.

Now you can start TOMCAT service by following command
service tomcat start
Now you can access Web Interface of dSpace in two ways that are

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

Moreover, To Login or to use dSpace properly you must have a USER to create one use following command in terminal.
/dspace/bin/dspace create-administrator
It will ask you to enter your Email Address you can enter anyemail such as (i.e: dspace@localhost)
Enter your First & Last name
Enter your desired password.

Thats it! you have successfully installed dSpace.

Maintained By: SOC © KOHA & DSPACE. All rights resevered