Dspace 7 Installation
Dspace 7 Installation
root@Ubuntu:~# sudo adduser nijwm
root@Ubuntu:~# sudo usermod -aG sudo nijwm
root@Ubuntu:~# su - nijwm
ubuntu@ip-172-31-94-110:~$ sudo apt update && sudo apt upgrade -y
JAVA INSTALLATION
ubuntu@ip-172-31-94-110:~$ sudo apt install default-jdk
ubuntu@ip-172-31-94-110:~$ cd /usr/lib/jvm/java-11-openjdk-amd64
ubuntu@ip-172-31-94-110:/usr/lib/jvm/java-11-openjdk-amd64$ cd /etc
ubuntu@ip-172-31-94-110:/etc$ sudo nano environment
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
ubuntu@ip-172-31-94-110:/etc$ source /etc/environment
ubuntu@ip-172-31-94-110:/etc$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64
MAVEN INSTALLATION
ubuntu@ip-172-31-94-110:/etc$ sudo apt install maven
ubuntu@ip-172-31-94-110:/etc$ mvn -v
Apache Maven 3.6.3
Maven home: /usr/share/maven
ubuntu@ip-172-31-94-110:/etc$ sudo apt install ant
POSTGRES INSTALLATION IN ETC DIRECTORY
ubuntu@ip-172-31-94-110:/etc$ sudo apt install postgresql postgresql-client postgresql-contrib
ubuntu@ip-172-31-94-110:/etc$ sudo pg_ctlcluster 14 main start && systemctl status postgresql
ubuntu@ip-172-31-94-110:/etc$ sudo passwd postgres (library)
ubuntu@ip-172-31-94-110:/etc$ su postgres
postgres@ip-172-31-94-110:/etc$ psql -c "SHOW SERVER_ENCODING"
server_encoding
-----------------
UTF8
(1 row)
postgres@ip-172-31-94-110:/etc$ exit
ubuntu@ip-172-31-94-110:/etc$ cd postgresql/14/main
ubuntu@ip-172-31-94-110:/etc/postgresql/14/main$ sudo nano postgresql.conf
UNCOMMENT "listen_addresses = 'localhost'
ubuntu@ip-172-31-94-110:/etc/postgresql/14/main$ sudo nano pg_hba.conf
host dspace dspace 127.0.0.1 255.255.255.255 md5
ubuntu@ip-172-31-94-110:/etc/postgresql/14/main$ sudo systemctl restart postgresql
ubuntu@ip-172-31-94-110:/etc/postgresql/14/main$ cd /opt
SOLR INSTALLATION IN OPT DIRECTORY
Go to browser ( https://solr.apache.org/downloads.html ) (Copy PGP from binary release) (and remove .asc)
ubuntu@ip-172-31-94-110:/opt$ sudo wget https://downloads.apache.org/lucene/solr/8.11.2/solr-8.11.2.zip
ubuntu@ip-172-31-94-110:/opt$ sudo apt-get install unzip
ubuntu@ip-172-31-94-110:/opt$ sudo unzip solr-8.11.2.zip && sudo mv solr-8.11.2 solr
CREATING A USER TO ASSIGN RIGHTS TO SOLR OTHERWISE IT WONT START FROM ROOT
useradd dspace
sudo passwd dspace
ubuntu@ip-172-31-94-110:/opt$ sudo chown -R dspace:dspace solr
ubuntu@ip-172-31-94-110:/opt$ ls -la
total 214528
drwxr-xr-x 3 root root 4096 May 24 13:33 .
drwxr-xr-x 19 root root 4096 May 24 12:56 ..
ubuntu@ip-172-31-94-110:/opt$ cd
root@Test2:~# nano .profile
/opt/solr/bin/solr start Add this line to the top
ubuntu@ip-172-31-94-110:~$ /opt/solr/bin/solr start
*** [WARN] *** Your open file limit is currently 1024.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Waiting up to 180 seconds to see Solr running on port 8983 [\]
Started Solr server on port 8983 (pid=19464). Happy searching!
GO TO WEB BROWSER and tyope: www.iitgnarchieve.in:8983/solr/ ( if it doesnt work with domain go with ip4)
TOMCAT INSTALLATION
ubuntu@ip-172-31-94-110:~$ sudo apt install tomcat9
ubuntu@ip-172-31-94-110:~$ cd /etc/systemd/system/
ubuntu@ip-172-31-94-110:/etc/systemd/system$ ls -la (Now look for /lib/systemd/system/systemd-resolved.service)
ubuntu@ip-172-31-94-110:/etc/systemd/system$ cd /lib/systemd/system
ubuntu@ip-172-31-94-110:/lib/systemd/system$ ls (Find tomcat9.service)
root@Dspace-iitr:/lib/systemd/system# sudo nano tomcat9.service
UNDER # SECURITY ADD
ReadWritePaths=/dspace/ (Dspace is the database user and not the system user as mine is iitr for system user)
root@Dspace-iitr:/lib/systemd/system# cd /
ubuntu@ip-172-31-94-110:~$ sudo mkdir /dspace
root@Dspace-iitr:/# ls -la
total 76
drwxr-xr-x 20 root root 4096 Jul 25 11:09 .
drwxr-xr-x 20 root root 4096 Jul 25 11:09 ..
lrwxrwxrwx 1 root root 7 Jul 18 02:09 bin -> usr/bin
drwxr-xr-x 4 root root 4096 Jul 18 02:11 boot
drwxr-xr-x 17 root root 3800 Jul 25 10:24 dev
drwxr-xr-x 2 root root 4096 Jul 25 11:09 dspace
root@Dspace-iitr:/# sudo chown -R dspace:dspace /dspace/
root@Dspace-iitr:/# ls -la
total 76
drwxr-xr-x 20 root root 4096 Jul 25 11:09 .
drwxr-xr-x 20 root root 4096 Jul 25 11:09 ..
lrwxrwxrwx 1 root root 7 Jul 18 02:09 bin -> usr/bin
drwxr-xr-x 4 root root 4096 Jul 18 02:11 boot
drwxr-xr-x 17 root root 3800 Jul 25 10:24 dev
drwxr-xr-x 2 iitr iitr 4096 Jul 25 11:09 dspace
root@Dspace-iitr:/# sudo nano /etc/environment
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd6 ( now remove the " ")
JAVA_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"
save and exit
root@Dspace-iitr:/# source /etc/environment
root@Dspace-iitr:/# echo $JAVA_OPTS
-Xmx512M -Xms64M -Dfile.encoding=UTF-8
GO TO BROWSER and type www.iitgnarchieve.in:8080 ( IT WORKS) ( if it doesnt work with domain go with ip4)
root@Dspace-iitr:/# cd /etc/tomcat9
root@Dspace-iitr:/etc/tomcat9# ls
Catalina context.xml logging.properties server.xml web.xml
catalina.properties jaspic-providers.xml policy.d tomcat-users.xml
root@Dspace-iitr:/etc/tomcat9# sudo nano server.xml
SCROLL DOWN and find <Connector port="8080" and edit it))))
-----------------------------
<Connector port="8080"
minSpareThreads="25"
enableLookups="false"
redirectPort="8443"
connectionTimeout="20000"
disableUploadTimeout="true"
URIEncoding="UTF-8"/>
-----------------------
root@Dspace-iitr:/etc/tomcat9# sudo apt install git
root@Dspace-iitr:/etc/tomcat9# sudo systemctl daemon-reload
root@Dspace-iitr:/etc/tomcat9# sudo systemctl restart tomcat9.service && sudo systemctl status tomcat9.service
root@Dspace-iitr:/etc/tomcat9# cd
DOWNLOAD DSPACE
root@Dspace-iitr:~# wget https://github.com/DSpace/DSpace/archive/refs/tags/dspace-7.2.zip
root@Dspace-iitr:~# sudo unzip dspace-7.2.zip && sudo rm -rf dspace-7.2.zip
root@Dspace-iitr:~# sudo mv DSpace-dspace-7.2 dspace7
root@Dspace-iitr:~# cd dspace7
CREATE DSPACE USER AND DSPACE DATABASE
root@Dspace-iitr:~/dspace7# su postgres
postgres@Dspace-iitr:/root/dspace7$ createuser --username=postgres --no-superuser --pwprompt dspace
postgres@Dspace-iitr:/root/dspace7$ createdb --username=postgres --owner=dspace --encoding=UNICODE dspace
postgres@Dspace-iitr:/root/dspace7$ psql dspace -c "CREATE EXTENSION pgcrypto;"
postgres@Dspace-iitr:/root/dspace7$ exit
root@Dspace-iitr:~/dspace7# sudo systemctl restart postgresql
root@Dspace-iitr:~/dspace7# ls
root@Dspace-iitr:~/dspace7# cd dspace/config
root@Dspace-iitr:~/dspace7/dspace/config# cp local.cfg.EXAMPLE local.cfg (change the password)
root@Dspace-iitr:~/dspace7/dspace/config# nano local.cfg
root@Dspace-iitr:~/dspace7/dspace/config# cd /
root@Dspace-iitr:/# ls -la
total 76
drwxr-xr-x 20 root root 4096 Jul 25 11:09 .
drwxr-xr-x 20 root root 4096 Jul 25 11:09 ..
lrwxrwxrwx 1 root root 7 Jul 18 02:09 bin -> usr/bin
drwxr-xr-x 4 root root 4096 Jul 18 02:11 boot
drwxr-xr-x 17 root root 3800 Jul 25 10:24 dev
drwxr-xr-x 2 iitr iitr 4096 Jul 25 11:09 dspace
root@Dspace-iitr:/# cd
root@Dspace-iitr:~# cd dspace7/
root@Dspace-iitr:~/dspace7# mvn package
root@Dspace-iitr:~/dspace7# cd dspace/target/dspace-installer
root@Dspace-iitr:~/dspace7/dspace/target/dspace-installer# ant fresh_install Dont do it with sudo)
root@Dspace-iitr:~/dspace7/dspace/target/dspace-installer# cd /
root@Dspace-iitr:/# ls -la
total 76
drwxr-xr-x 20 root root 4096 Jul 25 11:09 .
drwxr-xr-x 20 root root 4096 Jul 25 11:09 ..
lrwxrwxrwx 1 root root 7 Jul 18 02:09 bin -> usr/bin
drwxr-xr-x 4 root root 4096 Jul 18 02:11 boot
drwxr-xr-x 17 root root 3800 Jul 25 10:24 dev
drwxr-xr-x 14 iitr iitr 4096 Jul 25 11:46 dspace
root@Dspace-iitr:/# cd dspace/
root@Dspace-iitr:/dspace# ls
bin config exports handle-server lib log reports solr triplestore upload var webapps
root@Dspace-iitr:/dspace# cd /dspace/bin/
root@Dspace-iitr:/dspace/bin# ./dspace database migrate
root@Dspace-iitr:/dspace/bin# cd ..
root@Dspace-iitr:/dspace# cd webapps
root@Dspace-iitr:/dspace/webapps# ls
server
root@Dspace-iitr:/dspace/webapps# sudo cp -R /dspace/webapps/* /var/lib/tomcat9/webapps*
root@Dspace-iitr:/dspace/webapps# ls -la /var/lib/tomcat9/webapps
total 16
drwxrwxr-x 4 tomcat tomcat 4096 Jul 28 05:47 .
drwxr-xr-x 5 root root 4096 Jul 28 05:15 ..
drwxr-xr-x 3 root root 4096 Jul 28 05:11 ROOT
drwxr-xr-x 5 root root 4096 Jul 28 05:47 server
root@Dspace-iitr:/dspace/webapps# cd ..
root@Dspace-iitr:/dspace# cd solr/
root@Dspace-iitr:/dspace/solr# ls
authority oai search statistics
root@Dspace-iitr:/dspace/solr# ls -la /opt/solr/server/solr/configsets/
total 16
drwxr-xr-x 4 dspace dspace 4096 Jun 13 11:28 .
drwxr-xr-x 5 dspace dspace 4096 Jul 28 05:07 ..
drwxr-xr-x 3 dspace dspace 4096 Jun 13 11:28 _default
drwxr-xr-x 3 dspace dspace 4096 Jun 13 11:28 sample_techproducts_configs
root@Dspace-iitr:/dspace/solr# cp -R /dspace/solr/* /opt/solr/server/solr/configsets/
root@Dspace-iitr:/dspace/solr# ls -la /opt/solr/server/solr/configsets/
total 32
drwxr-xr-x 8 dspace dspace 4096 Jul 28 05:56 .
drwxr-xr-x 5 dspace dspace 4096 Jul 28 05:07 ..
drwxr-xr-x 3 dspace dspace 4096 Jun 13 11:28 _default
drwxr-xr-x 3 root root 4096 Jul 28 05:56 authority
drwxr-xr-x 3 root root 4096 Jul 28 05:56 oai
drwxr-xr-x 3 dspace dspace 4096 Jun 13 11:28 sample_techproducts_configs
drwxr-xr-x 3 root root 4096 Jul 28 05:56 search
drwxr-xr-x 3 root root 4096 Jul 28 05:56 statistics
root@Dspace-iitr:/dspace/solr# cd /opt
root@Dspace-iitr:/opt# cd solr/
root@Dspace-iitr:/opt/solr# cd bin/
root@Dspace-iitr:/opt/solr/bin# ./solr restart
GO TO BROWSER and search http://iitgnarchieve.in:8983/solr/search/select/ (Check this because it is not working)
root@Dspace-iitr:/opt/solr/bin# /dspace/bin/dspace create-administrator
root@Dspace-iitr:/opt/solr/bin# systemctl restart tomcat9.service
root@Dspace-iitr:/opt/solr/bin# cd /
root@Dspace-iitr:/# ls -la
total 76
drwxr-xr-x 20 root root 4096 Jul 25 11:09 .
drwxr-xr-x 20 root root 4096 Jul 25 11:09 ..
lrwxrwxrwx 1 root root 7 Jul 18 02:09 bin -> usr/bin
drwxr-xr-x 4 root root 4096 Jul 18 02:11 boot
drwxr-xr-x 17 root root 3800 Jul 25 10:24 dev
drwxr-xr-x 14 iitr iitr 4096 Jul 25 11:46 dspace
root@Dspace-iitr:/# sudo chown -R tomcat:tomcat /dspace
root@Dspace-iitr:/# ls -la
total 76
drwxr-xr-x 20 root root 4096 Jul 25 11:09 .
drwxr-xr-x 20 root root 4096 Jul 25 11:09 ..
lrwxrwxrwx 1 root root 7 Jul 18 02:09 bin -> usr/bin
drwxr-xr-x 4 root root 4096 Jul 18 02:11 boot
drwxr-xr-x 17 root root 3800 Jul 25 10:24 dev
drwxr-xr-x 14 tomcat tomcat 4096 Jul 25 11:46 dspace
Go to browser and search ( http://iitgnarchieve.in:8080/server/oai/request?verb=Identify )
SEE PRODUCTION manual
INSTALLING NODE JS
GOT TO GOOGLE AND SERACH FOR ( nvm git) nvm-sh/nvm LINK: https://github.com/nvm-sh/nvm
nijwm@dspace:/$ cd
root@Dspace-iitr:~# wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
After installing nvm restart your terminal
root@Dspace-iitr:~# nvm ls-remote See the (LTS version)
root@Dspace-iitr:~# nvm install --lts
root@Dspace-iitr:~# node -v
root@Dspace-iitr:~# npm install --global yarn
root@Dspace-iitr:~# npm install --global pm2
NOW INSTALLATION OF FRONTEND
Download Code (to [dspace-angular]): Download the latest dspace-angular release from the DSpace GitHub repository. You can choose to either download the zip or tar.gz file provided by GitHub, or you can use "git" to checkout the appropriate tag (e.g. dspace-7.2) or branch.
Dspace 7.2 (Forntedn / UI Only) https://github.com/DSpace/dspace-angular/releases
select source code
Frontend Link: https://github.com/DSpace/DSpace/releases
root@Dspace-iitr:~# wget https://github.com/DSpace/dspace-angular/archive/refs/tags/dspace-7.2.zip
root@Dspace-iitr:~# unzip dspace-7.2.zip
root@Dspace-iitr:~# rm dspace-7.2.zip
root@Dspace-iitr:~# mv dspace-angular-dspace-7.2 dspace-7-angular
root@Dspace-iitr:~# ls dspace-7-angular
root@Dspace-iitr:~# cd dspace-7-angular
root@Dspace-iitr:~/dspace-7-angular# yarn install
root@Dspace-iitr:~/dspace-7-angular# ls (Find config file)
root@Dspace-iitr:~/dspace-7-angular# cd config
root@Dspace-iitr:~/dspace-7-angular/config# ls
config.example.yml config.yml
root@Dspace-iitr:~/dspace-7-angular/config# cp config.example.yml config.prod.yml
root@Dspace-iitr:~/dspace-7-angular/config# nano config.prod.yml
CTRL+ W ( for search) FIND ui:
# This example is valid if your Backend is publicly available at https://api.mydspace.edu/server/
# The REST settings MUST correspond to the primary/public URL of the backend. Usually, this means they must be kept in sync
# with the value of "dspace.server.url" in the backend's local.cfg
rest:
ssl: false ( problem in test environment but in production it should be yes)
host: localhost ( 0r your domain name)
port: 8080 ( because tomcat usese 8080)
nameSpace: /server
root@Dspace-iitr:~/dspace-7-angular/config# yarn config:check:rest ( Not necessary. This will show error)
root@Dspace-iitr:~/dspace-7-angular/config# yarn run build:prod
root@Dspace-iitr:~/dspace-7-angular/config# cd ..
root@Dspace-iitr:~/dspace-7-angular# nano dspace-angular.json ( A new file will be created)
COPY & PASTE
{
"apps": [
{
"name": "dspace-ui",
"cwd": "/home/dspace/dspace-7-angular", ( for server it is root)
"script": "dist/server/main.js",
"env": {
"NODE_ENV": "production"
}
}
]
}
(change the cwd) like /home/nijwm/dspace-angular-dspace-7.2) (if not correct it will give error)
exit
root@Dspace-iitr:~/dspace-7-angular# mv dspace-angular.json ../
root@Dspace-iitr:~/dspace-7-angular# cd ../
root@Dspace-iitr:~# ls (here should be the angular file)
root@Dspace-iitr:~# ls -la ( ceheck for profile file)
root@Dspace-iitr:~# nano .profile
/opt/solr-8.11.1/bin/solr start
bash -ci 'pm2 start dspace-angular.json'
root@Dspace-iitr:~# pm2 stop dspace-angular.json (It should show stopped)
nijwm@dspace:$ sudo reboot now
root@Dspace-iitr:~# pm2 start dspace-angular.json
After reboot Go to browser ( http://iitgnarchieve.in:4000/)
root@Dspace-iitr:~# cd dspace-7-angular/config
root@Dspace-iitr:~/dspace-7-angular/config# nano config.prod.yml
ubuntu@ip-172-31-94-110:~$ /opt/solr/bin/solr start
root@Dspace-iitr:~# pm2 stop dspace-angular.json
root@Dspace-iitr:~# pm2 start dspace-angular.json
root@Dspace-iitr:~/dspace7# cd dspace/config
root@Dspace-iitr:~/dspace7/dspace/config# cp local.cfg.EXAMPLE local.cfg (change the password)
root@Dspace-iitr:~/dspace7/dspace/config# nano local.cfg
root@Dspace-iitr: su iitr
root@Dspace-iitr: /opt/solr/bin/solr start