Installing Dspace 3.x on Ubuntu 12.04

Installation of prerequisite applications

Open  Applications > Accessories > Terminal and execute following commands. Text in italics are commands to be executed.

sudo apt-get install openjdk-7-jdk
sudo apt-get install tasksel 
sudo tasksel

Select the following packages.
Use space bar for select applications from list.

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

 use tab to select OK button and enter. Packages will start to install.
On the way you have to give MySQL root password. MySQL not necessary for Dspace installation.

sudo apt-get install ant maven
 
Create the database user (dspace)

sudo su postgres 
createuser -U postgres -d -A -P dspace

enter password for new role (select a password like dspace) Shall the new role be allowed to create more new roles? (y/n) n

Exit from the promp, 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 gedit /etc/postgresql/9.1/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      enter,

then paste the following line and enter

/etc/init.d/postgresql restart

Create the Unix 'dspace' user, update the passwd, create the directory in which you will install dspace, and ensure that the Unix 'dspace' user has write privileges on that directory:

sudo useradd -m dspace

sudo passwd dspace (enter any password like dspace 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  

Configure Tomcat to know about the DSpace webapps.
[If the following command not open, check the tomcat version number and apply in the command]

sudo gedit /etc/tomcat7/server.xml

Insert the following chunk of text just above the closing </Host> 

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

This following  step downloads the compressed archive from SourceForge, and unpacks it in your current directory. The dspace-1.x.x-src-release directory is typically referred to as [dspace-src]. You can also download direct from Sourceforge website.

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-src-release.tar.bz2

cd /build/dspace-3.1-src-release
mvn -U package  
cd dspace/target/dspace-3.1-build
sudo ant fresh_install 
 
Fix Tomcat permissions, and restart the Tomcat server

sudo chown tomcat7:tomcat7 /dspace -R

Restart Tomcat

/etc/init.d/tomcat7 restart

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

/dspace/bin/dspace create-administrator

Test it out in your browser
That is all that is required to install DSpace on Ubuntu. There are two main webapps that provide a similar turn-key repository interface


33 comments:

  1. sudo su postgres createuser -U postgres -d -A -P dspace

    When i execute this command in Ubuntu 12.04 terminal it show U as invalid option.. \

    Any Suggestions

    ReplyDelete
    Replies
    1. Both are two commands and apply one by one;

      sudo su postgres
      createuser -U postgres -d -A -P dspace

      Delete
    2. amigo trato de seguir en el tuto pero no me crea el usario en postgres coloco lo que dice y me sale este error createuser: could not connect to database postgres: could not translate host name "postgres" to address: Nombre o servicio desconocido

      Delete
  2. are you sure is this secure method ? instead of tomcat running as dspace user

    sudo chmod -R 777 /build
    sudo chown tomcat7:tomcat7 /dspace -R

    ReplyDelete
    Replies
    1. I followed steps mentioned in official Dspace installation manual.
      https://wiki.duraspace.org/display/DSDOC3x/Installation
      I am not sure about the more deep technical side.
      What you think about it?

      Delete
    2. well on wiki i found below in both version 3 and 4 docs

      Note that DSpace will need to run as the same user as Tomcat, so you might want to install and run Tomcat as a user called 'dspace'. Set the environment variable TOMCAT_USER appropriately.

      i think 777 /build is not a secure, as its allow all users to do any thing including delete files from build directory. so i think best is only /build directory should only rights for tomcat user or tomcat running as dspace user to secure , so only require user rights on /build directory, instead of all users.

      Delete
    3. Thank you for give me insight about that command.
      Can you suggest suitable command instead of sudo chmod -R 777 /build ?
      It will be very helpful for readers of this blog.

      Delete
  3. Hi,

    After installation dspace 4.0, I'm having "HTTP Status 404 - /xmlui" error message. Any suggestion?

    ReplyDelete
    Replies
    1. I have not tried Dspace 4.0.
      Here is the documentation for 4.0
      https://wiki.duraspace.org/display/DSDOC4x/Installing+DSpace

      Delete
  4. Thankyu Dear Kumar,

    I hope you will install DSpace 4.x and prepare installation guide in wery soon. Your guides useful for basic users same as me.

    Thank you.

    ReplyDelete
    Replies
    1. Dear Friend,
      I will try 4.0 soon and prepare a documentation.
      Initial version may be buggy. So I do not try.
      I will try to install new version soon.
      For production purpose use stable version like 3.x.

      Delete
    2. Dea Kumar,

      I installed DSpace 4.0 on Ubuntu 12.04. I used your 3.x installation guide and dspace documetation. It is working well. I have prepared an installation guide but it is only Turkish. I am planning to prepare Englis version. The gude is accessible via http://sonmezcelik.blogspot.com.tr/2014/02/ubuntu-1204-isletim-sistemine-dspace-40.html

      Delete
  5. I enjoyed your post and responses to queries. I want to install soon. I'll come up this blog again to make some inquiries as need arises. Thank you for good job.

    ReplyDelete
  6. dspace backup and resotration is very important please guide me further on this topic. it is also required to give details on two points-1. email configuration for gmail in dspace and basic page customisation.

    ReplyDelete
  7. good day sir. i have a question is dspace and koha can be installed in one server?? is there will be no conflict if i do this kind of environment? thanks and more power to you sir..

    ReplyDelete
    Replies
    1. You can install two software in one server. Remember to change Koha default port number (8080) to another one. Dspace default port number is 8080.
      See the link
      http://kohageek.blogspot.in/2014/02/how-to-change-default-port-number-of.html

      Delete
  8. I installed dspace and connected to webmin server but when I add items in dspace am not able to search them.What settings does webmin need to allow querying the database

    ReplyDelete
  9. I installed it in the server which has KOHA which is using webmin.For the installation to complete I had to have Dspace in webmin too.Now am not able to view anything that I upload

    ReplyDelete
    Replies
    1. Dspace and Webmin has no relation.
      You can find items in Dspace interface.

      Delete
  10. How to check dspace version in ubuntu and fedora

    ReplyDelete
    Replies
    1. https://www.mail-archive.com/dspace-tech@lists.sourceforge.net/msg09530.html

      Delete
  11. During the command i got a problem
    cd dspace/target/dspace-3.1-build
    bash: cd: dspace/target/dspace-4.1-build: No such file or directory

    ReplyDelete
    Replies
    1. Change the directory location based on Dspace version number, e.g. ../dspace-4.2-build

      Delete
  12. When I try to unpack the DSpace into the installation it give an error message ~/pom/

    ReplyDelete
  13. When I try to unpack dspace into the system it gives me this error'
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
    [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

    I tried to uninstall and install maven but it's still giving me the error.

    Please help, I want to use dspace for my Institution

    ReplyDelete
    Replies
    1. I think you have not downloaded the package properly, it might broken.

      Delete
  14. Not success complete process > # mvn -U Package
    Error as A.R. Sibson Library
    Tries two times from scratch

    [ERROR]
    [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
    [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

    ReplyDelete
  15. Hi, Im successfully install my dspace with this tutorial. Thanks man.
    Can u post for the email config coz im using gmail server. thanks..

    ReplyDelete
  16. I had an installation of Dspace on Debian. The same got corrupted. However, the data is intact. Now I have installed Dspace on Ubuntu with Postgres. I want to use the data from Debian installation. What all precautions I need to take and also, what all folders I need to copy.

    dspaceknow@gmail.com

    ReplyDelete
  17. why error on:
    createdb -U dspace -E UNICODE dspace
    createdb: could not connect to database template1: FATAL: Peer authentication failed for user "dspace"

    ReplyDelete