Thursday, June 5, 2014

Setup Digital Repository For Your Institution Using Dspace On Ubuntu 14.04 Server

http://www.unixmen.com/setup-digital-repository-institution-using-dspace-ubuntu-14-04-server

Introduction

If you’re working in an Educational institution, probably you’ve heard about Dspace which is used to setup Digital Repository System. Digital Repository is nothing but a Centralized storage place which can be used to store and distribute any digital contents to the client systems, whether it may be a video, audio, document files etc. So, the students of the Institution can be able to browse the contents or download and store them on their local drive for later reference. We can store online lectures, course materials, syllabus, Q&A documents and all kind of contents used for students in the Digital Repository. By this way, the students can access the digital contents either from his/her Laptop, Desktop, or any mobile devices via LAN or WAN.
Dspace is an open source and free application used by 1000+ educational institutions around the world. The MIT Libraries and Hewlett-Packard (HP) originally developed DSpace, but the software is now supported by DuraSpace. Using Dspace, we can setup Digital Repository for any institutions and store thousands of video lectures, books etc. As you may know, many popular Universities like IIT, IIMK, Harverd, MIT etc, has their own digital repository and have stored tons of course materials for their students. You can see the complete list of institutions that are using Dspace here.

Supported Digital contents

DSpace accepts all manner of digital formats.
  • Documents, such as articles, preprints, working papers, technical reports, conference papers
  • Books
  • Theses
  • Data sets
  • Computer programs
  • Visualizations, simulations, and other models
  • Multimedia publications
  • Administrative records
  • Published books
  • Overlay journals
  • Bibliographic datasets
  • Images
  • Audio files
  • Video files
  • e-formatted digital library collections
  • Learning objects
  • Web pages

Minimum Hardware Requirements

  • Any modern workstation or server(Preferably Quad core server).
  • 4GB or more RAM
  • 200GB or more Hdd
The storage may vary depending upon the size of the contents that you want to store.
In this brief tutorial, let me teach you how to setup our own Digital Repository using Dspace on Ubuntu 14.04 32bit server. However, the steps provided in this document are same for all Ubuntu based systems.

Scenario

As I said before, for the purpose of this tutorial, I have a test server running with Ubuntu 14.04 LTS 32bit edition. My test box details are given below.
  • OS: Ubuntu 14.04 LTS 32bit Server
  • IP Address: 192.168.1.250/24
  • Hostname: server.unixmen.local

Prerequisites

Before installing Dsapce, we have to install the following important softwares.
  1. Java (JDK)
  2. Apache Ant, Maven, Tomcat
  3. PostgreSQL
Before installing the above prerequisites, update your server.
 
sudo apt-get update && sudo apt-get upgrade

Run the following command to install the above prerequisites all at once.
 
sudo apt-get install openjdk-7-jdk ant maven tomcat7 postgresql

Now, check the packages are properly installed as shown below.

Check Java:
java -version

Sample output:
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1)
OpenJDK Client VM (build 24.51-b03, mixed mode, sharing)

Check Ant:
ant -version

Sample output:
Apache Ant(TM) version 1.9.3 compiled on April 8 2014

Check Postgresql:
/etc/init.d/postgresql status

Sample output:
9.3/main (port 5432): online

Check Tomcat:
sudo /etc/init.d/tomcat7 status

Sample output:
* Tomcat servlet engine is running with pid 11402

Check Maven:
mvn -version

Sample output:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-24-generic", arch: "i386", family: "unix"

Open up the /etc/postgresql/9.3/main/pg_hba.conf file:
 
sudo vi /etc/postgresql/9.3/main/pg_hba.conf

Add the following line shown in red color.
[...]
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             dspace                                  md5
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
[...]

Make sure the above line is added on the top of the local section. Save and close the file. Restart postgresql service.
 
sudo /etc/init.d/postgresql restart

Create Dspace user

First, create a system user (normal operating system user) called dspace.
 
sudo useradd -m dspace

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

Create database:
createdb -U dspace -E UNICODE dspace
Password: ## Enter dspace user password.

After creating the database and user, type “exit” from the postgresql prompt and return back to normal user.
 
exit

Download Dspace

Create one new directory called dspace. This is the main directory that will hold the actual dspace application files after compilation. You can choose different directory as your liking.
 
cd /
sudo mkdir dspace

Download the latest version from the official download link. At the time writing this document, the latest stable version is 4.1.
 
sudo wget http://sourceforge.net/projects/dspace/files/DSpace%20Stable/4.1/dspace-4.1-release.zip

Extract the downloaded zip file.
 
sudo unzip dspace-4.1-release.zip

The above command will extract the dspace source zip file in the current directory. Change the ownership to the above directories to user “dspace”.
 
sudo chown dspace.dspace dspace/ -R
sudo chown dspace.dspace dspace-4.1-release/ -R

Now, switch to dspace user:
 
sudo su dspace

Go the the dspace directory:
 
cd /dspace-4.1-release/

Then, Edit file build.properties,
 
vi build.properties

And, change the following values to fit into your organization details.
[...]
# SERVER CONFIGURATION #
##########################

# DSpace installation directory. This is the location where you want
 # to install DSpace. NOTE: this value will be copied over to the
 # "dspace.dir" setting in the final "dspace.cfg" file. It can be
 # modified later on in your "dspace.cfg", if needed.
 dspace.install.dir=/dspace

# DSpace host name - should match base URL.  Do not include port number
 dspace.hostname = localhost

# DSpace base host URL.  Include port number etc.
 dspace.baseUrl = http://localhost:8080
 dspace.url = ${dspace.baseUrl}/jspui

# Name of the site
 dspace.name = Unixmen Digital Repository

# Solr server
 solr.server=http://localhost:8080/solr

# Default language for metadata values
 default.language = en_US

##########################
 # DATABASE CONFIGURATION #
##########################

# Database name ("oracle", or "postgres")
 db.name=postgres

# Uncomment the appropriate block below for your database.
 # postgres
 db.driver=org.postgresql.Driver
 db.url=jdbc:postgresql://localhost:5432/dspace
 db.username=dspace
 db.password=dspace

Save and close the file.

Now, start compiling the dspace. Make sure your server is connected to Internet. It is must to download all the necessary files during compilation.
Run the following command to start compiling from the dspace source directory (dspace-4.1-src-release):
 
mvn package

This command will download all necessary files from the Internet. Be patient, It will take a while depending upon the Internet speed.

After completing the build process successfully, you should see the following BUILD SUCCESS message.
dspace@server: -dspace-4.1-release_001

Then, go to the build directory,
 
cd /dspace-4.1-release/dspace/target/dspace-4.1-build/

and enter the following command:
 
ant fresh_install

Wait for few minutes to complete. After a successful installation, you should see the “BUILD SUCCESSFUL” message.
dspace@server:-dspace-4.1-src-release-dspace-target-dspace-4.1-build_004

The DSpace has been installed. To complete installation, you should do the following:

Get back as normal system user:
 
exit

Setup your Web servlet container (e.g. Tomcat) to look for your DSpace web applications in: /dspace/webapps/ directory.

OR, copy any web applications from /dspace/webapps/ to the appropriate place for your servlet container. For example, ‘$CATALINA_HOME/webapps’ for Tomcat.

First set the environment variables to Tomcat server.

Edit file /etc/profile,
 
sudo vi /etc/profile

Add the following lines at the end:
 
[...]
export  CATALINA_BASE=/var/lib/tomcat7
export  CATALINA_HOME=/usr/share/tomcat7

Save and close the file. Then, run the following command to take effect the environment variables settings.
 
source /etc/profile

Now, copy the dspace/webapps directory contents to the tomcat webapps directory.
 
sudo cp -r /dspace/webapps/* $CATALINA_BASE/webapps/

Create Administrator Account

Now, make an initial administrator account (an e-person) in DSpace:
 
sudo /dspace/bin/dspace create-administrator

Enter the email address and password to log in to dspace administrative panel.
 
Creating an initial administrator account
E-mail address: sk@unixmen.com
First name: Senthilkumar
Last name: Palani
WARNING: Password will appear on-screen.
Password: dspace
Again to confirm: dspace
Is the above data correct? (y or n): y
Administrator account created

Restart Tomcat service.
 
sudo /etc/init.d/tomcat7 restart

Access Dspace Home page

Now, You should then be able to access your DSpace home page.

XMLUI interface:

http://ip-address:8080/xmlui

Or,

JSPUI Interface:
http://ip-address:8080/jspui
DSpace Home - Mozilla Firefox_003
Congratulations! Dspace is ready now. Start using Dspace. In my next tutorial, I will show you how to upload contents to the Dspace repository. Stay tuned.

Cheers!

No comments:

Post a Comment