Contribute to the DSpace Development Fund

The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.

This how-to is an updated version of Peter Dietz's installation guide. The purpose of this guide is to extend the ease and clarity of that instruction set to more modern installs.

This install is based on Ubuntu 14.04.1 LTS Server.

Install Prerequisites

Make sure your sources are up to date before beginning

sudo apt-get update

Install the server stack of Tomcat (web server) and PostgreSQL (database)

sudo apt-get install tasksel
sudo tasksel

Select the following packages

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

*** Don't forget to deselect any defaults!

If tasksel fails with an aptitude (100) error

You can try executing the commands which tasksel would have executed as separate statements:

sudo tasksel install lamp-server

sudo tasksel install tomcat-server

sudo tasksel install postgresql-server

 

Install the Compile / Build tools

sudo apt-get install ant maven

Configure the Prerequisite Software

Create the database user (dspace)

sudo su postgres
createuser -U postgres -d -A -P dspace
exit
  • At this point, you will be asked to enter a password. Make it secure and remember it. 
  • You will also be prompted as to whether or not this user should be able to create other users. This should be no.

Allow the database user (dspace) to connect to the database

sudo vi /etc/postgresql/9.3/main/pg_hba.conf

# Add this line to the configuration: 
	local all dspace md5
# Comment out any lines that have "peer" at the end of them
 
# When done, restart postgresql:
	sudo service postgresql restart

Create the DSpace Database

createdb -U dspace -E UNICODE dspace

Configure Tomcat to know about the DSpace webapps.

sudo vi /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"/>
<Context path="/sword" docBase="/dspace/webapps/sword"/>
<Context path="/oai"   docBase="/dspace/webapps/oai"/>
<Context path="/jspui" docBase="/dspace/webapps/jspui"/>
<Context path="/lni"   docBase="/dspace/webapps/lni"/>
<Context path="/solr"  docBase="/dspace/webapps/solr"/>

Download and Install DSpace

Create the [dspace] directory.

The [dspace] directory is where the running dspace code will reside.

sudo mkdir /dspace

cd /dspace

Download the Release

The source release allows you to customize every aspect of DSpace. This 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]. 

sudo git clone https://github.com/DSpace/DSpace.git (apt-get install git if you don't already have it)
 
# Now, actually checkout the 4.2 codebase via the 'dspace-4.2' tag. There's two options, CHOOSE ONE
 
# Option #1: Checkout the official 'dspace-4.2' tag into a new local branch (which we've named "dspace-source")
sudo git checkout -b dspace-source dspace-4.2

# Option #2: Just checkout the "dspace-4_x" maintenance branch. This will essentially include all the latest patches on 4.x
sudo git checkout dspace-4_x

Compile and Build DSpace

The source release that has been obtained is human readable source code, and must be compiled to machine code for the server to run it. "mvn package" compiles the source code, and "ant" will do all the work necessary to initialize the database with the DSpace schema, and copy all of the compiled machine code to a location where the web server can serve it. This will overwrite any existing installation of DSpace that you may have.

make sure all your dependencies are in order, and you're running maven 3.x. (Check this version with mvn -v). If not, run these commands:

 
sudo apt-get install maven
sudo apt-get remove maven2

Now run these:

sudo apt-get install openjdk-7-jdk
cd DSpace
sudo mvn package (this step takes a long time)
cd dspace/target/dspace-installer
sudo ant fresh_install

Fix Tomcat permissions, and restart the Tomcat server

This guide follows the convention where the tomcat user will own all of the files in [dspace], so we have to change the owner of the files to tomcat7. Restarting tomcat will deploy the dspace webapps that are now ready to be viewed.

cd /home/dspace (or wherever your bottom most directory for dspace is)
sudo chown tomcat7:tomcat7 /dspace -R
sudo service tomcat7 restart

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

http://localhost:8080/xmlui

http://localhost:8080/jspui

  • No labels

32 Comments

  1. Awesome, thanks for updating the guide!

  2. Unknown User (dabaker)

    Do we need the LAMP stack installed since we're using Tomcat instead of Apache, and PostgreSQL instead of MySQL?

    1. I just updated the old guide. You should be fine without it, though.

    2. Accessing via localhost:8080, tomcat is fine and you won't need apache. But for production environments, you'll want to have a web server like apache or nginx sit in front of tomcat. That can either be installed on your DSpace box, or on a separate web server.

  3. When I try fresh_install, I get a BUILD FAILED (/dspace/DSpace/dspace/target/dspace-installer/build.xml:797: Java returned: 1).

    Further up, it says "FATAL: password authentication failed for user "dspace""

    Was I supposed to set a default password?

    1. Yes, the database user should have a password. Is that the issue?

    2. I have same problem. How to solve this? Please type reply.

      1. Edita el archivo /dspace/build.properties, con el usuario y la contraseña con acceso a la base de postgresql creada.

        Saludos.

      2. As Alex said, make sure you edit your /dspace/build.properties with your username and password for postgresql.

  4. Hola, yo ya instale Dspace y todo bien pero eh tenido problemas para que Dspace funcione en el puerto 80.

    Por el momento solo me funciona en el puerto 8080

    He modificado el archivo server.xml y dspace.cfg.

    Pero el problema persiste necesito ayuda

    Gracias

  5. si solo selecciono esto 
    [*] LAMP server
    [*] PostgreSQL database
    [*] Tomcat Java server
    me aparece este error tasksel aptitude failed (100)
    1. Try 

          sudo apt-get update
      sudo tasksel 

      It can be that you are out of space, or that your internet connection isn't working. Can you tell me what you tried?

      1. trato de instalar la version DSpace 5.1

        1. Sorry, I don't have any experience with 5.1.

          But either way, what have you tried? What version OS are you using?

    2. Se instala uno por uno, no instales lo tres a la vez

  6. (smile) Listo!

    Lo que me falta ahora es poder crear el usuario admin.

     

  7. Hola compañeros en que parte de la carpeta de  instalación debo de ejecutar el comando create-administrator ?

    Gracias por su ayuda.

    Hello fellow in that part of the installation folder must Create- administrator running the command ?
    Thank you for your help
  8. Como se guarda cuando se agrega la line local  ---> local all dspace md5

    how to save ---> local all dspace md5

  9. fatal: Not a git repository (or any of the parent directories): .git

  10. Buenas Tardes.. hay alguna guia para instalar Dspace 5.x en debian? o son los mismos pasos que Ubuntu? si alguien sabe de una guia para instalar Dspace en Debia mucho sabria agradecer!

    Saludos 

    1. La diferencia entre la versión para servidor de Ubuntu y Debian yo diría que son mínimas. La única diferencia que hay que pueda afectar aquí es que creo que Debian no usa sudo por defecto. Simplemente entra como root al servidor y ejecuta los comandos sin el "sudo" del inicio.

  11. Thanks friends dspace - It works !



     

  12. createuser -U postgres -d -A -P dspace ... the -A flag doesn't exist (anymore).

    1. sudo apt-get install postgresql

      sudo su postgres
      createuser -U postgres -d -A -P dspace
      enter password:dspace
      exit

       

  13. Did this process at least ten times and can't get it to work. It installs but in the end it doesn't run. If I put the contexts onto the tomcat server file tomcat just stops responding. The same thing happens if I paste the webapps onto the Catalina Home. I have followed every single step, and others from other tutorials.

    I'm using Ubuntu Server and have tried Dspace 4 and 5. The same thing happens in the end.

    I have absolutely no idea how to make it works and the logs are not helping.

    Do you guys have any clue on what might be happening?

    1. Hi Andre Vidal, sorry you are having trouble getting DSpace running. Please check your logs to see if they contain any errors. Tomcat-log, DSpace-log, and check tomcat to ensure that you only have one instance of tomcat running at any time. Troubleshoot an error

      1. Hi Peter, I have this problem for months but now, out of nowhere, it just popped right open. But the thing is, it is taking a long time to run the first time, I'm using a virtual machine, and I think it did open this time because I changed the amount of memory available to tomcat. But it took at least 5 minutes to open, I wasn't even expecting it.

        I still think that might be some problem, because I tested it with live cds before, and they worked fine. But I got no clue on how to solve this.

        Well, thanks for the help.

  14. Hola he seguido todos los pasos pero al ejecutar la sentencia

    sudo sudo chown tomcat7:tomcat7 /dspace -R no el servidor tomcat deja de aceptar conexiones. Por favor su ayuda.
    Saludos
    1. Hola amigo Bayron, primero solo debe ir un sudo chown tomcat7:tomcat7 /dspace -R

      segundo el comando es para dar permisos a los archivos de dspace, no debe malograrlo el tomcat

      tercero mas que seguro lo has instalado mal el tomcat yo lo instale así sudo apt-get install tomcat7

      y para instalar y configurar tomcat7 utilice esta pagina https://help.ubuntu.com/lts/serverguide/tomcat.html 

      suerte. 


      1. Hola Dennis muchas gracias por tu ayuda, el problema no es el tomcat ciertamente, ya que al ingresar a localhost:8080 si esta corriendo pero al acceder a localhost:8080/xmlui o localhost:8080/jspui aparece que el recurso no se encuentra y he realizado todos los pasos como son sin ningun error pero no accede a estos recursos.

          Saludos

        1. Hola amigo entoces esta mal la instalación, yo lo instale en una computadora y desde otra computadora en la misma red se ingresa el IP del servidor, ejemplo:      

          192.168.1.200/xmlui

          192.168.1.200/jspui