Installation of DSpace 6.3 on Ubuntu 20.04
Installation of DSpace 6.3 on Ubuntu 20.04
Requirements
UNIX-like OS or Microsoft Windows
Java JDK 7 or 8 (OpenJDK or Oracle JDK)
Apache Maven 3.0.5 or above (3.3.9+)* (Java build tool)
Apache Ant 1.8 or later (Java build tool)
PostgreSQL 9.4 or later - pgcrypto installed
Apache Tomcat 7 or later
Git (code version control)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Open Applications > Accessories > Terminal and apply ----CTRL + ALT + T (in the keyboard)
sudo apt update && sudo apt upgrade
Install OpenJDK ant maven and PostgreSQL
sudo apt install openjdk-8-jdk ant maven postgresql postgresql-client
Choose OpenJDK-8 as default for that run this command
sudo update-alternatives --config java
Login to PostgreSQL and create the database
sudo -i -u postgres
createuser --username=postgres --no-superuser --pwprompt dspace
createdb --username=postgres --owner=dspace --encoding=UNICODE -T template0 dspace
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
exit
Open the following file,
sudo nano /etc/postgresql/14/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 /etc/init.d/postgresql restart
Create a DSpace user
sudo useradd -m dspace
sudo passwd dspace
sudo mkdir /dspace && sudo chown dspace /dspace
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
Insert <!-- at the beginning of the plugin and --> at the end of the plugin.
<!--
<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 https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.65/bin/apache-tomcat-9.0.65.tar.gz
Or you can visit the Tomcat website and download the latest package.
Extract Tomcat package
sudo tar xvzf apache-tomcat-9.0.65.tar.gz
Rename folder "apache-tomcat-10.0.17" to "tomcat" and Delete the Tomcat archive file from /opt folder
sudo mv apache-tomcat-9.0.65 tomcat && sudo rm apache-tomcat-9.0.65.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
Administrator account
Apply following command in a terminal,
sudo /dspace/bin/dspace create-administrator
Enter an email address when asked for which will be your dspace login id (e.g. test@gmail.com).
Enter First name and surname
Enter a password.
Delete the build folder
sudo rm -rf /build
--------------------------------------------- xxxxxxxxxxxxxxxxxxxxx -------------------------------------------------xxxxxxxxxxxxxxxxxxxxxxxxxxxx------------------------
Open DSpace in your browser
DSpace has two interfaces; xmlui and jspui. You can load either one Dspace interface in a browser.
If tomcat starts but dspace 404 error
cd /opt/tomcat/bin
sudo ./catalina.sh run
tomcat problem
https://stackoverflow.com/questions/47603170/tomcat-cant-start-tomcat-after-installing-it-on-ubuntu-job-for-tomcat-servic
-----------xxxxxxxxxxxxxxxxxxx---------------------xxxxxxxxxxxxxxxxx-------------------------