Hi, friends, I could install Dspace 6.3 (latest) on Ubuntu 18.04.1 LTS successfully after fixing bugs which occurred in the installation process. Here I provide a note for the installation by which you can try. (NB: I highly recommend you to install Ubuntu 18.04.1 minimal or Ubuntu 16.04 or any other lite weight Ubuntu flavors for the fast performance)
Installation of prerequisite applications
- Java Development Kit (JDK)
- PostgreSQL Database
- DSpace Software
- Apache Ant (Pure Java Build Tool)
- Apache Maven (Apache Build Automation Tool for Java Projects)
- Apache Tomcat (Web Server for hosting Dspace)
sudo apt update && sudo apt upgrade -y
sudo apt-get install openjdk-8-jdk postgresql ant maven
Choose OpenJDK-8 as default for that run this command
sudo update-alternatives --config java
Create the database user
sudo -i -u postgres
createuser -U postgres -d -A -P dspace
Enter the 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
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 nano /etc/postgresql/10/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
/etc/init.d/postgresql restart
Create Dspace user
sudo useradd -m dspace
sudo passwd dspace [enter a password 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
save and close the file.
Login to the database as a superuser, and enable the pgcrypto
extension on this database
sudo su postgres
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
exit
sudo /etc/init.d/postgresql restart
Create a directory to build, give all permissions and Download DSpace into /build directory
sudo mkdir /build && sudo chmod -R 777 /build && cd /build && sudo wget https://github.com/DSpace/DSpace/releases/download/dspace-6.3/dspace-6.3-src-release.tar.gz
You can find the latest updated of Dspace 6.x version from this page and copy the link to download the latest version.
Extracting Dspace package
sudo tar -zxf dspace-6.3-src-release.tar.gz
Open the following file and remove a piece of lines.
sudo nano /build/dspace-6.3-src-release/dspace-api/pom.xml
Remove the following group of codes. Carefully check the lines in the file.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions><execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
Save and close the file.
Installation of DSpace
Enter into the Dspace package folder and apply the following commands one by one.
cd /build/dspace-6.3-src-release
sudo mvn -U package
cd dspace/target/dspace-installer && sudo ant fresh_install
Installation of Tomcat
Download the and extract the Tomcat package,
cd /opt && sudo wget http://apachemirror.wuchna.com/tomcat/tomcat-9/v9.0.37/bin/apache-tomcat-9.0.37.tar.gz
Or you can visit the Tomcat website and download the latest package.
Extract Tomcat package
sudo tar xvzf apache-tomcat-9.0.37.tar.gz
Rename folder "apache-tomcat-9.0.37" to "tomcat" and Delete the Tomcat archive file from /opt folder
sudo mv apache-tomcat-9.0.37 tomcat && sudo rm apache-tomcat-9.0.37.tar.gz
Open the following file,
sudo nano /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
Copy Dspace web apps files to Tomcat folder
sudo cp -r /dspace/webapps/* /opt/tomcat/webapps
Running Tomcat automatically
You can set up to start the Tomcat server start automatically at the time of system turn on.
Open the following file in a Terminal,
sudo nano /etc/init.d/tomcat
Add following lines in the file,
#!/bin/bash
### BEGIN INIT INFO
# Provides: tomcat8
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop Tomcat server
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
start() {
sh /opt/tomcat/bin/startup.sh
}
stop() {
sh /opt/tomcat/bin/shutdown.sh
}
case $1 in
start|stop) $1;;
restart) stop; start;;
*) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac
save and close the file.
Apply the following commands too;
sudo chmod +x /etc/init.d/tomcat && sudo update-rc.d tomcat defaults
Restart Tomcat server and Postgresql database
sudo service tomcat start && sudo service tomcat stop && sudo service tomcat restart && sudo /etc/init.d/postgresql restart && sudo /etc/init.d/tomcat restart
Make an initial administrator account (an e-person) in DSpace:
Apply following command in a terminal,
sudo /dspace/bin/dspace create-administrator
It will ask to enter the email address for the user login.
Enter an email address (e.g. dspace@localhost).
Enter First name and surname (e.g. dspace)
Enter a password.
Delete the build folder
sudo rm -rf /build
Open DSpace in your browser
DSpace has two interfaces; xmlui and jspui. You can load either one Dspace interface in a browser.
http://localhost:8080/xmlui
http://localhost:8080/jspui
Reference:
https://github.com/DSpace/DSpace/releases/tag/dspace-6.3
https://tomcat.apache.org/download-80.cgi
https://libtechnophile.blogspot.com/2019/01/installing-dspace-63-in-ubuntu-18041-lts.html
http://dspacegeek.blogspot.com/2019/10/install-dspace-6x-on-ubuntu-16.04.html
https://www.wissenschaft.com.ng/blog/installing-dspace-6-x-on-ubuntu-14-04-16-04-18-04-lts/
i recive error when i excute this comand
ReplyDeletesudo su postgrespsql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
Pls try with this
Deletesudo postgres psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
thanks...do you know how to install mirage2 on ubuntu 18.04
Deletehi ineed to install mirage2 with dspace6.3 on ubuntu 18.04 but i face too many error any clear steps
ReplyDeletethanks a lot. you made my job easier :-)
ReplyDeleteThank You..
Deletehii sir I follow your guide 6.3 install on Ubuntu 18.04 but error This step build failed mvn -U package
ReplyDeleteplease guide me sir
Did you remove the codes?
DeleteYes sir
DeletePlease, re-run maven. if anything gets wrong again connect me on my whatsapp 9567664972
DeleteThanks for the tutorial. How can I change the port from 8080 to port 80. Also Can I use lets-encrypt ssl. Thanks again
ReplyDeleteFor changing port visit
Deletehttp://dspacegeek.blogspot.com/2016/07/change-dspace-port-number-8080-to-8081.html
and if your dspace is installed locally. there is no need of assigning Let's Encrypt. Let’s Encrypt identifies the server administrator by public key.
Thanks.Will try
DeleteI got the problem of BUILD FAILED
ReplyDelete/build/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1 when doing ant fresh_install, where is the problem ...?
may be the version of java will be openjdk-11.. you may pls change it. by executing following command.
Deleteupdate-alternatives --config java
and select openjdk-8 as default.probably 2nd one will be openjdk-8 then re-run maven. will be successful.
@ Mahesh Palamuttath, thanks so much for your input. Running the command update-alternatives --config java solves the problem. Thanks so much Sir
DeleteYou are welcome
DeleteThanks a lot for your help to install dspace in our library.
ReplyDeleteyour blog is very helpful to learn new updates..
Thank you...
DeleteGood day Sir, I followed your DSpace 6.3 installation on Ubuntu 18.04 but encountered errors during the mvn -U package command. Your help is highly needed please
ReplyDeleteRemove the codes.. and re-run maven
DeleteThanks Gems Library, I removed the codes and try to re-run maven, it still gives the same error.
DeletePls look the version of openjdk executing following command.
Deleteupdate-alternatives --config java
pls see above reply
i have dout sir what code i removed sir
Deleteand have some problem in my mvn -U package
How do I access ip from dspace directly the xmlui or jspui page opens without the need to define / xmlui or / jspui ...?
ReplyDeleteexample: ip_addrees opens the main page from xmlui or jspui not like ip_address / xmlui or ip_address / jspui
Dear. Akbar. Xmlui and Jspui are the two interfaces of dspace for accessing dspace you have to choose either of them followed by ip adress. Otherwise It will only show the tomcat page showing which is working. So one of the interface must be used.
DeleteHow can I enable the mirage 2 interface? or how can I install mirage 2 with dspace 6.3?
ReplyDeleteHola, gracias por tu tiempo, me sale este error, luego de usar mvn -U package, no se que ocurre
ReplyDelete[INFO]
[INFO] DSpace Parent Project .............................. SUCCESS [01:22 min]
[INFO] DSpace Services Framework :: API and Implementation SUCCESS [03:27 min]
[INFO] DSpace Kernel :: API and Implementation ............ FAILURE [14:11 min]
[INFO] DSpace Addon Modules ............................... SKIPPED
[INFO] DSpace Kernel :: Additions and Local Customizations SKIPPED
[INFO] DSpace XML-UI (Manakin) ............................ SKIPPED
[INFO] DSpace XML-UI (Manakin) :: Local Customizations .... SKIPPED
[INFO] DSpace JSP-UI ...................................... SKIPPED
[INFO] DSpace JSP-UI :: Local Customizations .............. SKIPPED
[INFO] DSpace RDF ......................................... SKIPPED
[INFO] DSpace RDF :: Local Customizations ................. SKIPPED
[INFO] DSpace REST :: API and Implementation .............. SKIPPED
[INFO] DSpace REST :: Local Customizations ................ SKIPPED
[INFO] DSpace SWORD ....................................... SKIPPED
[INFO] DSpace SWORD :: Local Customizations ............... SKIPPED
[INFO] DSpace SWORD v2 .................................... SKIPPED
[INFO] DSpace SWORD v2 :: Local Customizations ............ SKIPPED
[INFO] Apache Solr Webapp ................................. SKIPPED
[INFO] DSpace SOLR :: Local Customizations ................ SKIPPED
[INFO] DSpace OAI-PMH ..................................... SKIPPED
[INFO] DSpace OAI-PMH :: Local Customizations ............. SKIPPED
[INFO] DSpace Assembly and Configuration .................. SKIPPED
[INFO] DSpace XML-UI Mirage2 Theme ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19:03 min
[INFO] Finished at: 2019-06-10T21:19:47-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project dspace-api: Compilation failure: Compilation failure:
[ERROR] /build/dspace-6.3-src-release/dspace-api/src/main/java/org/dspace/authority/orcid/xml/Converter.java:[13,22] package javax.xml.bind does not exist
[ERROR] /build/dspace-6.3-src-release/dspace-api/src/main/java/org/dspace/authority/orcid/xml/Converter.java:[14,22] package javax.xml.bind does not exist
[
I think you having error while running maven?. have you removed the code mentioned in the post? reply me in english pls
DeleteLuis, just relax. I initially encountered the same error while I installed DSpace too. But a big thanks to Mahesh Palamuttath who bailed me out.
DeleteTo solve this problem you just need to follow this step.
STEP 1.
Execute the command below
update-alternatives --config java
STEP 2.
Kindly select openjdk-8 as default
The second one will be openjdk-8
STEP 3.
Then re-run maven using
mvn -U package
Your Build will become successful.
Best regards.
This comment has been removed by the author.
DeleteHola, cuando intento acceder a dspace con http://localhost:8080/jspui no me deja y me muestra el siguiente mensaje Firefox can't establish a connection to the server at localhost:8080.
ReplyDeleteHe seguido todos los pasos y solucionado los errores que me ha dado. PodrĆa ayudarme??
Gracias
Hello! Thanks for the tutorial! I still have a problem, when I try to copy dspaces to tomcat this error appear:
ReplyDelete“cp: cannot stat 'dpace/webapps/*': No such file or directory”
However when I move the asterisk everything seems to work fine (sudo cp -r /dspace/webapps/ /opt/tomcat/webapps), the only problem is that when I create the administrator this appear:
"sudo: /dspace/bin/dspace: command not found"
Do you know how can I fix this?
Thankss!!
Hello! I'm facing a problem when I try this command : "mvn -U package"
ReplyDeleteits show below error:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.540 s
[INFO] Finished at: 2019-07-14T22:00:35+05:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/taimoor). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
any one can help regarding this issue.
Did you select the java version openjdk 8 as default? Did you remove the codes mentioned above.? If no. do it and run maven again
DeleteSir,
DeleteI am trying to install dspace 6.3 on CentOS 7. "mvn -U package" was successful but "ant fresh_install" was unsuccessful. It gave me following error messages. Could you kindly help me please. Regards, sk deka,
=======================================
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
[java] Attempting to connect to database
ReplyDelete[java] 2019-07-22 11:11:19,022 WARN org.dspace.services.sessions.SessionRequestServiceImpl @ Request interceptor (org.dspace.services.events.SystemEventService$EventRequestInterceptor@157321c8) failed to execute on end (request-869-1563793878944): null
BUILD FAILED
/build/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1
Total time: 5 seconds
I get this error.
Can you help me please ?
I got similar error if you get solution please inform me dear,thanks.
Deletehello dear I have solved the problem if you havent got the solution contact me at samsonramato@gmail.com
Deletesince it is too long to describe here
This comment has been removed by the author.
ReplyDelete
ReplyDeleteBest regards, I already installed dspace 6.3 but when installing the mirage2 theme I have the following error:
"Error: The file to import is missing or cannot be read: ../ vendor / bootstrap-sass-official / asset / stylesheets / bootstrap. \ A upload path: \ A Compas ...."
Do you have a guide to install the mirage2 theme in dspace ?.
ReplyDeleteI have a question, what kind of permissions and owner should the build folder have?
[java] 2019-10-01 13:12:26,048 WARN org.dspace.services.sessions.SessionRequestServiceImpl @ Request interceptor (org.dspace.services.events.SystemEventService$EventRequestInterceptor@21d9765) failed to execute on end (request-968-1569935545869): null
ReplyDeleteBUILD FAILED
/build/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1
Total time: 9 seconds
hi Mahesh Palamuttath first of all thank you for sharing that installation of dspace. I've applied all the steps one by one and completed the installation succesfully. But I can't customise the home page. (for example: change the color) I've changed the head title in the file of messages_tr.xml in dspace/webapps/xmlui/i18n but not changed the home page it was the same. do I work in wrong place. or did I skip any step. thank you for all.
ReplyDeleteCan i install by this way in debian 9 ?
ReplyDeleteis this process same for debian 9 ?
yes..
Deletehello good afternoon I'm doing the Dspace project I have the following error please if you can help me
ReplyDeleteroot@server-repo-suda:/opt# sudo cp -r /dspace/webapps/* /opt/tomcat/webapps
cp: cannot stat '/dspace/webapps/*': No such file or directory
root@server-repo-suda:/opt# sudo cp -r /dspace/webapps/* /opt/tomcat/webapps
cp: cannot stat '/dspace/webapps/*': No such file or directory
root@server-repo-suda:/opt# root@server-repo-suda:/opt# nano /etc/profile
bash: root@server-repo-suda:/opt#: No such file or directory
root@server-repo-suda:/opt# root@server-repo-suda:/opt# sudo cp -r /dspace/webapps/* /opt/tomcat/webapps
bash: root@server-repo-suda:/opt#: No such file or directory
root@server-repo-suda:/opt# cp: cannot stat '/dspace/webapps/*': No such file or directory
How can we install the dspace in arabic bydefault?
ReplyDeletePlease mention the perquisites with exact versions for all packages that will smoothly runs on 18.04 ubuntu OS while installing the Dspace 6.3
ReplyDeleteCan you guide for installation of Mirage2 on Ubuntu 18.04?
ReplyDeletehii sir I follow your guide 6.3 install on Ubuntu 18.04 but error This step build failed mvn -U package
ReplyDeleteplease guide me sir
help me sir
Deletevery nice post
ReplyDeletefirsttechtricks
The code you suggest removing is not in my pom.xml, so I assume that has been slipstream fixed. I have assured java is pointing to versioin 8. Mvn fails with "failed to execute goal org.apache.magen.plugins:maven-resources-plugin:2.7:resources(default-resources)on project despace-services:Cannot create resource output directory: /build/dspace-6.3-src-release/dspace-services/target/classes
ReplyDeletelooks like I have to run mvn as root or use sudo
Deletethis is part of the error that i have faced when I follow the instruction and when the command "sudo ant fresh_install" excute.
ReplyDelete[java] Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "dspace"
[java] at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:475)
[java] at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:207)
[java] at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
[java] at org.postgresql.jdbc.PgConnection.(PgConnection.java:195)
[java] at org.postgresql.Driver.makeConnection(Driver.java:452)
[java] at org.postgresql.Driver.connect(Driver.java:254)
[java] at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:39)
[java] at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:256)
[java] at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2304)
[java] at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2290)
[java] ... 9 more
[java] 2020-03-06 20:22:19,792 WARN org.dspace.services.sessions.SessionRequestServiceImpl @ Request interceptor (org.dspace.services.events.SystemEventService$EventRequestInterceptor@293ce4cb) failed to execute on end (request-576-1583515339652): null
BUILD FAILED
/build/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1
Total time: 5 seconds
sudo ant fresh_install
ReplyDeleteAfte this command, its showing BUILD FAILED
what should I do?
This comment has been removed by the author.
ReplyDeletethanks a lot
ReplyDeleteI build every think right
but when I open http://localhost:8080/xmlui and
http://localhost:8080/jspui
it is return
Unable to connect
Firefox can’t establish a connection to the server at localhost:8080.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
how can fix this problem
Thank you! Everything worked perfectly. Your instructions were incredibly helpful!
ReplyDeleteThank you sir. your blog is very helpful. I installed Dspace on cloud and it is working fine
ReplyDeleteI have installed DSpace successfully but not running in the browser why? I have normal IP but not public IP may the reason for that please reply...
ReplyDeleteHi sir,
ReplyDeleteIt was a very great guide.
But I found the following error.
Do you have any opinion, please?
Thank you!
kiki@DESKTOP-FCE765O:/mnt/c/Users/zizuw$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
* 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
Press to keep the current choice[*], or type selection number: 2
kiki@DESKTOP-FCE765O:/mnt/c/Users/zizuw$ sudo -i -u postgres
postgres@DESKTOP-FCE765O:~$ createuser -U postgres -d -A -P dspace
Enter password for new role:
Enter it again:
createuser: error: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
postgres@DESKTOP-FCE765O:~$
received error after installation http status 404 not found
ReplyDeleteI have managed installation of dspace 6.3 on ubuntu 20.04 successfully but when I access localhost:8080/jspui it says internal system error so how can I fix this error?
ReplyDeleteany help is appreciated.
Thanks for sharing a useful information.
ReplyDeleteDevOps Training
DevOps Online Training
Hello Mahesh,
ReplyDeleteI have the same problem of home/dspace/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1
I have tried to list java alternatives but it tells me there is nothing to configure (no other java installations apart from the current). Like this:
~$ update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Nothing to configure.
~$ echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-amd64
Please help. Am trying to configure DSpace to use email from gmail
Regards,
Hamida
BUILD FAILED
ReplyDelete/build/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1
BUILD FAILED
ReplyDelete/build/dspace-6.3-src-release/dspace/target/dspace-installer/build.xml:789: Java returned: 1
very Good article. But if you need OJS Installation, just visit our website http://sch.com.pk for service by experts.
ReplyDeleteThank you very much for your article. I did everything wright but When I try to open dspace in my browser , it says,Unable to connect
ReplyDeleteFirefox can’t establish a connection to the server at localhost:8080.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
How can I fix it? Thanks in advance.
oh it's working now ! relieved!
ReplyDelete