Cara Install DSpace 6 di Ubuntu 20.04

Tutorial kali ini kita belajar bagaimana cara install DSpace di Ubuntu 20.04. DSpace adalah open source software untuk membangun repository, umumnya digunakan oleh perguruan tinggi.

*Hardware Recommendations*

Hardware yang direkomendasikan sebagai server DSpace.

*Minimal DSpace Production*

· 3-4GB RAM · 20GB Storage

*Mid-range DSpace Production*

· 5-6GB RAM · 200GB Storage

*High-end DSpace Production*

· 9-10GB RAM · 1TB Storage

*Software Requirements*

Software yang dibutuhkan untuk menjalankan DSpace.

· Java JDK 8 · Apache Maven · Apache Ant · PostgreSQL · Apache Tomcat

*Membuat User*

Membuat user dspace.

[INPUT]

1 2 sudo useradd -m dspace sudo passwd dspace

*Install PostgreSQL*

Install PostgreSQL database.

[INPUT]

1 sudo apt install postgresql postgresql-client -y

Membuat *user dspace* dengan *password dspace* di PostgreSQL.

[INPUT]

1 2 3 sudo su postgres createuser -U postgres -d -A -P dspace exit

Membuat *database dspace*.

[INPUT]

1 sudo -u dspace createdb -U dspace -E UNICODE dspace

Mengaktifkan pgcrypto extension.

[INPUT]

1 2 3 sudo su postgres psql –username=postgres dspace -c “CREATE EXTENSION pgcrypto;” exit

Buka file konfigurasi PostgreSQL.

[INPUT]

1 sudo nano /etc/postgresql/12/main/pg_hba.conf

Tambahkan konfigurasi berikut.

[INPUT]

1 local  all  dspace  md5

PostgreSQL configuration pg_hba.conf

Restart PostgreSQL.

[INPUT]

1 2 sudo systemctl restart postgresql sudo systemctl status postgresql

*Building DSpace*

Install OpenJDK 8.

[INPUT]

1 sudo apt install openjdk-8-jdk -y

Jika sebelumnya sudah terpasang versi lain OpenJDK, ubah java default ke OpenJDK 8.

[INPUT]

1 sudo update-alternatives –config java

Install ant dan maven.

[INPUT]

1 sudo apt install ant maven -y

Membuat folder dspace.

[INPUT]

1 2 sudo mkdir /dspace sudo chown dspace /dspace

Membuat folder build untuk building DSpace.

[INPUT]

1 2 3 sudo mkdir /build sudo chmod -R 777 /build cd /build

Download DSpace 6.3 dari GitHub.

[INPUT]

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

Extract dspace*.tar.gz

[INPUT]

1 tar xzvf dspace*.tar.gz

Pindah ke folder dspace-6.3-src-release.

[INPUT]

1 cd dspace-6.3-src-release

Copy file local.cfg.

[INPUT]

1 cp dspace/config/local.cfg.EXAMPLE dspace/config/local.cfg

Compile DSpace package.

[INPUT]

1 mvn -U package

Compile DSpace package

Install DSpace.

[INPUT]

1 2 cd dspace/target/dspace-installer sudo ant fresh_install

DSpace installation

*Install Apache Tomcat*

Download dan extract Apache Tomcat 9.

[INPUT]

1 2 3 cd /opt sudo wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.41/bin/apache-tomcat-9.0.41.tar.gz sudo tar xzvf apache-tomcat-9.0.41.tar.gz

Ubah folder apache-tomcat-9.0.41 menjadi tomcat.

[INPUT]

1 sudo mv apache-tomcat-9.0.41 tomcat

Buka file /etc/profile.

[INPUT]

1 sudo nano /etc/profile

Tambah konfigurasi environment variables untuk Java.

[INPUT]

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

Java environment variables

Copy dspace webapps ke tomcat webapps.

[INPUT]

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

Membuat bash script agar Tomcat bisa berjalan secara otomatis.

[INPUT]

1 sudo nano /etc/init.d/tomcat

Masukkan bash script berikut.

[INPUT]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 #!/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 “; exit 1;; esac

Berikan permission executeable dan set sebagai service.

[INPUT]

1 2 sudo chmod +x /etc/init.d/tomcat sudo update-rc.d tomcat defaults

Jalankan Tomcat server dan cek statusnya.

[INPUT]

1 2 sudo service tomcat start sudo service tomcat status

*Administrator DSpace*

Membuat akun administrator DSpace.

[INPUT]

1 sudo /dspace/bin/dspace create-administrator

Create administrator account

Hapus folder build.

[INPUT]

1 sudo rm -rf /build

Tes akses DSpace.

1. *http://localhost:8080/xmlui* atau *http://serverIP:8080/xmlui* 2. *http://localhost:8080/jspui* atau *http://serverIP:8080/jspui*

*Akses dengan Subdomain*

Install Nginx web server.

[INPUT]

1 sudo apt install nginx -y

Membuat file konfigurasi Nginx server block untuk subdomain dspace.musaamin.my.id.

[INPUT]

1 sudo nano /etc/nginx/conf.d/dspace.musaamin.my.id.conf

Isi konfigurasinya.

[INPUT]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 server {     listen 80;     server_name dspace.musaamin.my.id;     access_log /var/log/nginx/dspace.musaamin.my.id_access.log;     error_log /var/log/nginx/dspace.musaamin.my.id_error.log;       root /opt/tomcat/webapps/;     client_max_body_size 100M;       location / {         return 301 /xmlui;     }       location /xmlui {         index index.jsp;         proxy_set_header X-Forwarded-Host $host;         proxy_set_header X-Forwarded-Server $host;         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;         proxy_pass http://localhost:8080/xmlui;         proxy_redirect  http://localhost:8080/xmlui http://dspace.musaamin.my.id/xmlui;           proxy_buffering off;         proxy_store     off;           proxy_connect_timeout 120;         proxy_send_timeout    120;         proxy_read_timeout    120;     } }

Tes konfigurasi Nginx.

[INPUT]

1 sudo nginx -t

Jika tidak ada kesalahan.

[INPUT]

1 2 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful

Restart Nginx.

[INPUT]

1 sudo systemctl restart nginx

Tes browse *http://dspace.musaamin.my.id*

DSpace repository site (xmlui)

*Install SSL Let’s Encrypt*

Install certbot Let’s Encrypt.

[INPUT]

1 2 sudo snap install –classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot    

Request SSL untuk subdomain dspace.musaamin.my.id di Nginx.

[INPUT]

1 sudo certbot –nginx -d dspace.musaamin.my.id    

Jika sukses install SSL, ditampilkan pesan

[INPUT]

1 Congratulations! You have successfully enabled https://dspace.musaamin.my.id    

Tes browse *https://dspace.musaamin.my.id*

/*Gratis saldo $100 untuk pendaftaran akun baru di Vultr. Daftar sekarang juga!*/

Selamat mencoba 🙂

Leave a Reply

Your email address will not be published.