Here, we use Debian 12 to install DSpace 8. If you don't like the Vanilla Debian, try PepperMintOS, / MX Linux / Linux Mint Debian edition. Beginners can find YouTube videos on how to install Debian Linux.
Prepare the system for Dspace installation
DSpace consists of both a Java-based backend and an Angular-based front end. Both the backend and front end need to be installed separately. Install the prerequisites for the DSpace software. Dspace builds on the Java platform and requires software packages like Tomcat, Solr, Maven, Ant, etc.
Update the operating system.
Apply the following commands one by one to receive new updates. It makes the system new.
sudo apt update && sudo apt upgrade -y
Create a DSpace user from the terminal after the installation. Here are the commands to create the DSpace user;
sudo useradd -m dspace
sudo passwd dspace
[enter a password for the new user dspace]
sudo usermod -aG sudo dspace
Build the Installation Package
Install packages to support the Dspace installation.
sudo apt install wget curl git build-essential mousepad zip unzip -y
Install Open JDK
The JDK is a development environment for building applications, applets, and components using the Java programming language. JDK prepares an environment to run Java-based applications on the machine.
sudo apt install openjdk-17-jdk -y
Set the JAVA_HOME Environment Variable
DSpace requires the Java installation location. Open the following file to add the java environment variable,
sudo mousepad /etc/environment
Add the following two lines to the file,
JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
JAVA_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"
Save and close the file.
Apply the following commands one by one to check Java Home is successfully saved,
source /etc/environment
echo $JAVA_HOME
echo $JAVA_OPTS
Install Maven and Ant
Apache Maven requires for the build process during the Dspace installation. Maven helps to download the dependencies. Maven is used to build the installer. Ant used to install/deploy DSpace to the installation directory
sudo apt install maven ant -y
Install PostgreSQL
PostgreSQL, also known as Postgres, is a free and open-source relational database management system. Dspace makes use of PostgreSQL as a Relational Database System. Apply the following command to install PostreSQL and related packages;
sudo apt-get install postgresql postgresql-client postgresql-contrib libpostgresql-jdbc-java -y
Apply the following command to check the PostgreSQL version number.
psql -V psql
Check whether the installation of PostgreSQL is successful or not,
Apply the key, CTRL + C, to exit from the screen.
Create a password for PostgreSQL.
sudo passwd postgres
Try to login into PostgreSQL using the password created.
su postgres
The command prompt looks like this postgres@user: if you could log in successfully. apply the following command to exit from there,
exit
Open the following file,
Save and exit
We need to tighten the security of PostgreSQL. Open the following file,
sudo mousepad /etc/postgresql/15/main/pg_hba.conf
Find the line, # Database administrative login by Unix domain socket.
Add the following lines below it,
#DSpace configuration
host dspace dspace 127.0.0.1 255.255.255.255 md5
Restart Postresql
sudo systemctl restart postgresql
Solr Installation
Solr is an open-source search platform, written in Java. Its major features include full-text search, hit highlighting, faceted search, real-time indexing, dynamic clustering, database integration, NoSQL features, and rich document handling.
Download the Solr software package from the website and save it to the opt folder in the operating system.
Enter into the home folder. Apply the following command,
cd
Download the Solr (version 8) package using the following command line,
sudo wget https://downloads.apache.org/lucene/solr/8.11.4/solr-8.11.4.zip
Unzip the package,
sudo unzip solr-8.11.4.zip
Apply the following command to install Solr,
sudo bash solr-8.11.4/bin/install_solr_service.sh solr-8.11.4.zip
After successful installation, exit from the process. Apply the key combination,
Ctl + C
Apply the following commands one by one to start automatically upon system boot.
sudo systemctl status solr
Apply CTRL + C key combination to exit from Solr status in Terminal.
Add the URL on a browser to open the Solr interface,
Download the DSpace package
cd /build
Download the DSpace 8 package into /build folder.
Extract the package,
sudo unzip dspace-8.0.zip
Install Tomcat
Tomcat provides a "pure Java" HTTP web server environment where Java code can run.
sudo mousepad /lib/systemd/system/tomcat10.service
Find the category, #Security,
Add the following line at the last portion,
ReadWritePaths=/dspace
Save and close the file.
Alter Tomcat's default configuration to support searching and browsing of multi-byte UTF-8.
Open the following file,
sudo mousepad /etc/tomcat10/server.xml
Find the below-mentioned lines in the file, and comment out. Add <!-- in the first line and --> in the last line,
connectionTimeout="20000"
redirectPort="8443" />
It will look like this after commented out,
connectionTimeout="20000"
redirectPort="8443" /> -->
Add the following lines below the commented-out lines,
minSpareThreads="25"
enableLookups="false"
redirectPort="8443"
connectionTimeout="20000"
disableUploadTimeout="true"
URIEncoding="UTF-8"/>
Restart Tomcat,
sudo systemctl restart tomcat10.service
If it shows the following message,
Warning: The unit file, source configuration file or drop-ins of tomcat9.service changed on disk. Run 'systemctl daemon-reload to reload units.
Apply the following command,
sudo systemctl daemon-reload
Again try to restart the Tomcat,
Database setup
Login into the Postgres terminal,
sudo su postgres
Enter the following directory.
cd /etc/postgresql/15/main
Create the user named dspace. Enter the password when it asks. This is the connection password for the DSpace database; note it down.
createuser --username=postgres --no-superuser --pwprompt dspace
This command will create the database with the name dspace. The database owner is dspace, the user created in the previous command.
createdb --username=postgres --owner=dspace --encoding=UNICODE dspace
Enable pgcrypto extension.
The pgcrypto module provides cryptographic functions for PostgreSQL. It secures data from the security breach.
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
Exit from the Postgres terminal,
exit
Create a new DSpace configuration fil.
sudo cp local.cfg.EXAMPLE local.cfg
sudo mousepad local.cfg
See the essential lines in the file and their purpose. Give IP address or domain name instead of localhost.
dspace.server.url = http://localhost:8080/server
dspace.ui.url = http://localhost:4000
dspace.name = DSpace at My University
If any changes in the DSpace database username/password, mention them here.
db.username = dspace
db.password = dspace
Uncomment the following line in the local.cfg file,
Save and close the file.
Installation of DSpace backend
mvn package
The package-building process depends on the Internet speed and server responses and it may take 10 to 20 minutes to finish.
Install DSpace Backend
ant fresh_install
After successful install, exit from sudo user, apply the following command,
Copy the DSpace web apps folder to the Tomcat server,
Change the permission of the folder.
Restart Solr
sudo systemctl restart solr
Open the Solr on the browser using the URL, http://localhost:8983 and check the Core Selector is available on the Left side of the screen.
sudo ./dspace database migrate
Create a DSpace Administrator Account
sudo /dspace/bin/dspace create-administrator
This process will ask questions,
E-mail address: e.g. dspace@localhost
First name: e.g. DSpace
Last name: e.g. MGU
Is the above data correct? (y or n): y
Password will not display on screen.
Password: Enter the password to login DSpace.
Again to confirm: Confirm the password again.
Administrator account created
Change permission of DSpace to Tomcat user
sudo systemctl restart tomcat10.service
Open the REST API Interface at,
Try to open OAI-PMH Interface,
http://localhost:8080/server/oai/request?verb=Identify
Install the Front End
To install the front required to install Node.js, Yarn, and DSpace-Angular packages.
Install Node.js
Node.js is an open-source, cross-platform, back-end JavaScript runtime environment.
Install npm
sudo apt install npm
Install Yarn
Yarn is a software packaging system.
sudo npm install --global pm2
Front end installation
DSpace user interfaces build on Angular. Angular is a TypeScript-based free and open-source web application framework. Follow the steps to install Dspace-Angular.
We are going to place the dspace-angular package into dspace home folder. Enter it into the folder;
cd /home/dspace
Download the dspace-angular package,
sudo wget https://github.com/DSpace/dspace-angular/archive/refs/tags/dspace-8.0.zip
rm dspace-8.0.zip
Enter into the dspace-angular folder,
cd /home/dspace/dspace-angular-dspace-8.0
Install all dependencies,
yarn install
Enter into the /dspace-angular/config folder,
cd config
Copy and rename the following file,
cp config.example.yml config.prod.yml
Open the config file
mousepad config.prod.yml
Find the block of information related REST API server settings.
Save and close the file.
Run the command,
exit
Startup the User Interface
Create the file,
sudo mousepad /home/dspace/dspace-angular-dspace-8.0/dspace-ui.json
Copy the following content into the dspace-ui.jason file,
Start the application using PM2. Apply the following command to start the service,
Create a cronjob entry at the ROOT user to autostart dspace-ui.json. Login as a ROOT user. Apply the following commands,
Add the following line
Enter the below URL on the browser to start the DSpace front end,
You may also want to install/configure pm2-logrotate to ensure that PM2's log folder doesn't fill up over time.
pm2 set pm2-logrotate:max_size 1000K
pm2 set pm2-logrotate:compress true
pm2 set pm2-logrotate:rotateInterval 0 0 19 1 1 7
Build directory no longer required after the installation of DSpace; remove it. Apply the following command;
Restart the computer and check the Solr, Tomcat, and DSpace works.
Express my sincere thanks to the contributors; Matúš Formanek (KMKD FHV University, Slovakia), Jeremiah Kellogg (Library Faculty, Systems, Eastern Oregon University), Anoop P.A. (Technical Assistant, Kerala Institute Of Local Administration), and Mahesh Palamuttath (Librarian, East Campus, Sacred Heart College, Thevara, Ernakulam).
No comments:
Post a Comment