domingo, 12 de janeiro de 2014

How to Install DSpace 3.1 on Ubuntu 12.04 LTS

Once upon a time (just kidding), i needed to install DSpace (an webapp that manage academic content - books, papers and other things) on a server running Ubuntu 12.04. Since the documentation don't have a straight-forward explanation about the installation, after some research on internet and some experimentation, I've compiled a guide to make DSpace work. This is a little modificated version of the tutorial on http://linuxhalwa.blogspot.com.br/2013/06/installing-dspace-3x-on-ubuntu-1204.html.

1) Installing Dependencies

Open a Terminal and execute the following commands (Those will install some dependencies):

$ sudo apt-get install openjdk-6-jdk -y
$ sudo apt-get install tasksel -y

Wait for the end of setup and execute:

$ sudo tasksel

A menu will appear with a list of packages. Select the following packages using spacebar and the directionals:

[*] LAMP server [*] PostgreSQL database [*] Tomcat Java server

Press tab to select OK, and enter. Packages will start to install.

If MySQL ask for a password, define a standard password (i.e. dspace).

Now, install Ant and Maven.

$ sudo apt-get install ant maven -y

2) Creating a database and users for DSpace

Log as postgresql standard user:

$ sudo su postgres

And execute

$ createuser -U postgres -d -A -P dspace

Enter the password for the new role (define it as dspace) and respond the question with 'n'.

Exit from the postgres user prompt:

$ exit

You will need to allow the dspace database user to connect to the database. Type in the command line:

$ sudo vi /etc/postgresql/9.1/main/pg_hba.conf

Go to the end of the file and insert:

local all dspace md5 

Save and exit (on vi, :wq!).

Now, restart the PostgreSQL database service:

$ /etc/init.d/postgresql restart

DSpace requires an UNIX user. Create this executing:

$ sudo useradd -m dspace
$ sudo passwd dspace

Define a password for dspace user (i.e. dspace)

Create a directory for dspace user:

$ sudo mkdir /dspace
$ sudo chown dspace /dspace

Create the dspace database:

$ sudo su dspace
$ createdb -U dspace -E UNICODE dspace

Configure Tomcat to know about the dspace webapp location:

$ sudo vi /etc/tomcat6/server.xml

Insert the following text above the </Host> tag:

<!-- Define a new context path for all DSpace web apps -->
<Context path="/xmlui" docBase="/dspace/webapps/xmlui" allowLinking="true"/>
<Context path="/sword" docBase="/dspace/webapps/sword" allowLinking="true"/>
<Context path="/oai" docBase="/dspace/webapps/oai" allowLinking="true"/>
<Context path="/jspui" docBase="/dspace/webapps/jspui" allowLinking="true"/>
<Context path="/lni" docBase="/dspace/webapps/lni" allowLinking="true"/>
<Context path="/solr" docBase="/dspace/webapps/solr" allowLinking="true"/>

Save and close the file.

3) Downloading and Installing DSpace

Open a Terminal and execute the following commands:

$ sudo mkdir /build
$ sudo chmod -R 777 /build
$ cd /build
$ wget http://downloads.sourceforge.net/project/dspace/DSpace%20Stable/3.1/dspace-3.1-release.tar.bz2 
$ tar -xvjf dspace-3.1-release.tar.bz2
$ cd /build/dspace-3.1-release
$ mvn -U package  

Wait for Maven bring the dependencies. After that execute:

$ cd dspace/target/dspace-3.1-build
$ sudo ant fresh_install 

Ant will build all the directory structure and prepare DSpace installation.

After Ant exits, fix Tomcat permissions and restart Tomcat Server, executing the following commands:

$ sudo chown tomcat6:tomcat6 /dspace -R

Creating an Administrator for DSpace:

Type the following commands and fill the required fields:

$ /dspace/bin/dspace create-administrator

4) Testing Dspace

Open a browser and type one of the following addresses (from the Host machine – where DSpace is installed):


Tomcat runs on 8080 port. The localhost refers to the local machine where DSpace is installed. XMLUI and JSPUI are two interfaces from DSpace application.


If you want to access DSpace from a remote computer (from internet, as an example), change 'localhost' to the IP Address that forward to the DSpace host machine. You will need to check your firewall rules about the 8080 port to make Tomcat webapps visible from network.

Nenhum comentário:

Postar um comentário