Horizontal Navigation

Monday, 18 December 2017

Installation of Dspace 6.3 on Ubuntu 16.04

Step 0: Prerequisite Softwares for Creating Institutional Repository Using DSapce 
Must know, what is to be required for creating IR using DSpace:
1. Java Development Kit (JDK)
2. PostgreSQL Database
3. DSpace Software
4. Apache Ant (Pure Java Build Tool)
5. Apache Maven (Apache Build Automation Tool for Java Projects)
6. Apache Tomcat (Web Server for hosting Dspace) 
Open Terminal and execute following commands.  Use [Ctrl+Alt+T] to open Terminal.

Step 1: First update and upgrade your Ubuntu server and then Install All Prerequisite Softwares for creating Institutional Repository at your Institute. Use the following command.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openjdk-8-jdk postgresql ant maven

Step 2: Create the database user. Please use the following command and follow the instructions.


(i) sudo su postgres
(ii)createuser -U postgres -d -A -P dspace


Enter password for new role: [Enter a password e.g. dspace]

Shall the new role be allowed to create more new roles? (y/n) n
[Enter n and press enter button]

Type exit


Step 3: Allow the database user (dspace) to connect to the database

Open the file "pg_hba.conf" by using the following command.
[If the following command not open, check the postgresql version number and apply in the command]

(i) sudo nano /etc/postgresql/9.5/main/pg_hba.conf

Add this line to the configuration file at the end:  

local all dspace md5

save and close the file


(ii) Restart PostgreSQL :


/etc/init.d/postgresql restart


Step 4: Create Dspace user and Dspace Installation Directory:
Execute the following commands one by one. 

(i) sudo useradd -m dspace
(ii)sudo passwd dspace
[enter a password for the new user dspace]
(iii)sudo mkdir /dspace
(iv) sudo chown dspace /dspace


Step 5:
Create the PostgreSQL 'dspace' database and extension pgcrypto:

sudo su dspace 
createdb -U dspace -E UNICODE dspace  

Then type exit and come to root user
 
sudo su postgres


Now type the following command to create extension pgcrypto (simply copy & paste the following command in your command line interface)
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
 

Type the following to restart postgres:
/etc/init.d/postgresql restart


Step 6: Create Dspace Source directory and give permission to it:


sudo mkdir /dspace_build
sudo chmod -R 777 /dspace_build


Step 7: Download Dsapce to /dspace_build directory:
Execute the following command to proceed.

(i) cd /dspace_build

(ii) Then simply Copy and paste (use mouse only) following line in the terminal.


wget https://github.com/DSpace/DSpace/releases/download/dspace-6.3/dspace-6.3-src-release.tar.gz


(iii) Extract Dspace package by using the following command:


tar -zxf dspace-6.3-src-release.tar.gz

Step 8: Use the following command to run maven for the installation of Dspace in Installation Directory (/dspace):


(i) cd /dspace_build/dspace-6.3-src-release
(ii)mvn -U package 


Step 9: Enter into Dspace package folder to download packages by issuing following commands.


(i) cd dspace/target/dspace-installer
(ii)sudo ant fresh_install


Step 10: Installation of Tomcat (one more prerequisite software for Dsapce):

Download the and extract the Tomcat package. First change the current directory to /opt Directory.

(i) cd /opt

(ii) wget http://mirrors.estointernet.in/apache/tomcat/tomcat-9/v9.0.14/bin/apache-tomcat-9.0.14.tar.gz

(iii) tar -xvzf apache-tomcat-9.0.14.tar.gz

(iv) Rename folder "apache-tomcat-9.0.14" to "tomcat". Issue following command to do so.

mv apache-tomcat-9.0.14 tomcat


(v) Delete the package file from /opt folder. Issue following command to do so.


rm apache-tomcat-9.0.14.tar.gz


Step 11: Open following file "/etc/profile" and edit:

(i)gedit /etc/profile

Setup environment variables
Environment variables to find JAVA.
Add following lines at the bottom of the file

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export CATALINA_HOME=/opt/tomcat

Then Save and close file.
Step 12: Copy Dspace webapps files (web deployment directory) to Tomcat folder 

sudo cp -r /dspace/webapps/* /opt/tomcat/webapps


Step 13:
Give permission to tomcat owner, so that tomcat can be executed by dspace user by applying following command:
(i) cd /opt
(ii)chown dspace.dspace tomcat/ -R


Step 14: Start Tomcat server:

Use following command to start tomcat server.

/opt/tomcat/bin/startup.sh

 If you want to stop Tomcat server, then use following command:


/opt/tomcat/bin/shutdown.sh

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


Apply following command in a terminal,

 
/dspace/bin/dspace create-administrator

It will ask to enter email address for user login.

Enter an email address (e.g. dspace@localhost).
Enter First name and surename (e.g. dspace)
Enter a password.

Step 16: Open Dspace in your browser

You can load either one Dspace interface in a browser.

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


References: 

1. https://wiki.duraspace.org/display/DSDOC6x/Installing+DSpace
2. https://listechsavvy.blogspot.in/2016/12/dspace-55-installation-on-ubuntu-1404.html

25 comments:

  1. sir we r using dspace 4.2 on ubuntu 12.4 and we plan to upgrade to dspace 5.x on ubuntu 16.4 restore backup to new one i m unable to restore that so please help me in that

    ReplyDelete
    Replies
    1. Backup of database
      Open a Terminal and apply following commands,

      su -l dspace
      pg_dump dspace > dspace.backup
      exit


      Enter the password of Linux user for dspace.

      Backup of Asset store and log folders.
      Execute thress commands one bye one;
      sudo zip -r assetstore.zip /dspace/assetstore
      sudo zip -r log.zip /dspace/log

      Backup up files will be deposit in your home folder.

      Delete
  2. Problem occurred on the sudo ant fresh_install. org.apache.commons.configuration.ConfigurationException: Cannot locate configuration source local.cfg

    ReplyDelete
  3. Hello Sir,

    I am really grateful for your wonderful service in library profession.

    I also tried to install but while installing "mvn -U package" some errors are occuring sir, could please help me to solve this problem my mobile no. 9008687613 just for 2 minutes

    ReplyDelete
    Replies
    1. If you are using sever version Ubuntu or Debian 9, then you will not face this kind of problem. If you are using Desktop version of Ubuntu, then you will find error while running "mven -U package". If you face this kind of problem in Ubuntu, then uncomment some portion of code of pom.xml file in dspace source directory like dspace-6.3-src-release/dspace-api/pom.xml. Again you try, you find Build Success message.

      Delete
    2. sudo update-alternatives --config java

      Altere o Java

      Delete
  4. if you give your number i will call you sir.

    ReplyDelete
  5. If any problem persist with 6.3 version skipped error (apply apt-get install git-all) in ubuntu 16.04

    ReplyDelete
    Replies
    1. I think I have this problem, what do ypu mean by: (apply apt-get install git-all)

      Delete
  6. Thanks a lot for share.. it works perfect!.. just I had to install git as an aditional step berofe mvn -U package

    ReplyDelete
  7. Make sure default java version is 1.8. otherwise maven -U command getting errors.

    ReplyDelete
  8. I could install DSpace on my machine thanks to your manual, I would like you to publish one where the template mirage2 is activated since I have tried one way and another even with the instructions of the official website and I could not.

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. Hello Friends, thanks for this post. I was really helpful. However, I followed all the instructions the mvn -U package was successful but the ant fresh install command was unsuccessful. It gave me this error message

    BUILD FAILED
    /build/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1.

    kindly assist me on this

    ReplyDelete
  11. Como eu posso trocar o idioma?

    ReplyDelete
  12. Hello Friends,
    I'm also getting the same error. "mvn -U package" was successful but the "ant fresh_install" command was unsuccessful. It gave me following error messages. Kindly help me please.
    ==================================================================
    test_database:
    [java] 2019-07-25 13:13:56,741 WARN org.dspace.services.email.EmailServiceImpl @ Couldn't get an email session from environment: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    [java] 2019-07-25 13:13:57,003 ERROR org.dspace.storage.rdbms.DatabaseUtils @ Unable to setup Flyway against DSpace database
    [java] java.sql.SQLException: Cannot create PoolableConnectionFactory (FATAL: Ident authentication failed for user "dspace")


    BUILD FAILED
    /home/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1
    ==================================================================

    Regards,
    s k deka,

    ReplyDelete
  13. Go to the folder

    /dspace_build/dspace-6.3-src-release/dspace/target/dspace-installer/config

    Open the local.cfg file and change the value you defined for "Database username and password"

    Now run the command.

    ReplyDelete
  14. Want to install DSpace 6.3 on Ubuntu 18.04 LTS I had succeeded many step even maven -U package but fresh install command was unsuccessful what do next ...

    ReplyDelete
    Replies
    1. u can use this command
      update-alternatives --config java
      This command u can use sir

      Delete
  15. hi good afternoon sir
    I have one dout pls help me sir
    i m using ubunutu 18.04 have some error like mvn -U package is error like that help me sir

    ReplyDelete
  16. gzip: stdin: unexpected end of file
    tar: Unexpected EOF in archive
    tar: Unexpected EOF in archive
    tar: Error is not recoverable: exiting now

    ReplyDelete
  17. Sir when I have all setting of dspace.cfg mail smtp and save it then refresh page and register new user they show internal system error why

    ReplyDelete
  18. Before some years it was working but now a days they show error if you have solution kindly tell me Thanks

    ReplyDelete