0% found this document useful (0 votes)
24 views6 pages

aaaa new file

Download as txt, pdf, or txt
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 6

Open the terminal (CTRL + ALT + T)

Update and upgrade the ubuntu system

sudo su

sudo apt update -y

sudo apt upgrade -y


Install git (Supporting package for the DSpace installation)

sudo apt install git


Build the Installation Package

Install packages to support the Dspace installation.

sudo apt install wget curl git build-essential gedit zip unzip -y
Install Java development kit (JDK-17)
sudo apt install openjdk-17-jdk -y
You can check the java version with the following command (JDK 11 and JDK 17
versions are fully supported to dsapce7)

java -version
Open the following file to activate the JAVA_HOME & JAVA_OPTS environment variable

sudo gedit /etc/environment


Add the following two lines to the file

JAVA_HOME=”/usr/lib/jvm/java-11-openjdk-amd64”

JAVA_OPTS=”-Xmx512M –Xms64M –Dfile.encoding=UTF-8”


Apply the following command

source /etc/environment
Check the status that the JAVA_HOME & JAVA_OPTS have been set successfully or not

echo $JAVA_HOME

echo $JAVA_OPTS
Install Apache Maven and Apache Ant in the 'etc' directory

cd /etc

sudo apt install maven -y

sudo apt install ant -y


Install Postgresql Database and related packages
Xoa kho luu tru cu:
sudo rm /etc/apt/sources.list.d/pgdg.list
Thêm Kho Lưu trữ PostgreSQL Chính Xác:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main"
> /etc/apt/sources.list.d/pgdg.list'
Thêm Khóa GPG
wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Cập nhật Danh sách Gói
sudo apt update
Cài Đặt PostgreSQL 15.7
sudo apt install -y postgresql-15 postgresql-client-15 postgresql-contrib-15
Nếu Không Thể Cài Đặt Thông Qua Kho Lưu trữ
Nếu kho lưu trữ PostgreSQL không có sẵn hoặc có sự cố, bạn có thể cần cài đặt
PostgreSQL từ mã nguồn:
wget https://ftp.postgresql.org/pub/source/v15.7/postgresql-15.7.tar.gz
tar xzf postgresql-15.7.tar.gz
cd postgresql-15.7
Cài đặt các phụ thuộc cần thiết:
sudo apt install -y build-essential libreadline-dev zlib1g-dev
Biên dịch và cài đặt:
./configure
make
sudo make install
Cấu hình PostgreSQL:
sudo mkdir -p /usr/local/pgsql/data
sudo chown $USER /usr/local/pgsql/data
initdb -D /usr/local/pgsql/data
pg_ctl -D /usr/local/pgsql/data start
Kiểm Tra Phiên Bản Cài Đặt
psql --version

sudo pg_ctlcluster 15 main start


Set the Password for Postgres

sudo passwd postgres


Now Connect to the Postgres user

su postgres

(Enter the password if the system asked)


Run the following commands to check whether UTF8 is enabled or not

cd /etc/postgresql/14/main

psql -c "SHOW SERVER_encoding"


Now, Exit from the Postgres user

exit
Now, open the configure file of PostgreSQL (Change the Postgres version number if
you are using other than Ubuntu 22.04)

sudo gedit /etc/postgresql/15/main/postgresql.conf


Uncomment the following line by removing ‘#’ under the connection settings option

listen_addresses = 'localhost'

Save and Exit


Open the following file and add the line to host-based access on Postgres

sudo gedit /etc/postgresql/15/main/pg_hba.conf


Find the line “# Database administrative login by Unix domain socket” and add the
following line above this line.

host dspace dspace 127.0.0.1 255.255.255.255 md5


Solr Installation
Install Solr in the opt directory (Apply the following commands)

cd /opt

sudo wget https://downloads.apache.org/lucene/solr/8.11.3/solr-8.11.3.zip


Extract the zip file
unzip solr-8.11.3.zip
Delete the solr zip file as it is not required

sudo rm solr-8.11.3.zip
Change the permission of the solr directory

sudo chown -R {user_name}:{user_name} solr-8.11.3


Create the Directory in the root directory with the name dspace

cd /

sudo mkdir /dspace


Change the permission of the newly created directory

sudo chown -R {user_name}:{user_name} /dspace


Return to the home directory

cd

exit
Apply the following command from the home directory

gedit .profile

(Paste the following line in the file for auto-start Solr and save the file)

/opt/solr-8.11.3/bin/solr start
Now apply the following commands from the terminal to start the solr

/opt/solr-8.11.2/bin/solr start
Open the following URL in the browser and check whether the Solr admin dashboard is
loaded.

http://localhost:8983/solr

Install Tomcat

sudo apt install tomcat10


Open the following file

sudo gedit /lib/systemd/system/tomcat910service


Add the following line at the bottom under the Security

ReadWritePaths=/dspace
Open the following file in the tomcat folder

sudo gedit /etc/tomcat10/server.xml


Find the following lines in the file

<Connector port="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" />
Replace the above lines with the following lines
<Connector port="8080" protocol="HTTP/1.1"
minSpareThreads="25"
enableLookups="false"
redirectPort="8443"
connectionTimeout="20000"
disableUploadTimeout="true"
URIEncoding="UTF-8"/>
Restart the Tomcat

sudo systemctl restart tomcat10.service


If you see the following warning message while restarting tomcat

Warning: The unit file, source configuration file or drop-ins of tomcat9.service


changed on disk. Run 'systemctl daemon-reload' to reload units.
Run the following command

sudo systemctl daemon-reload


Now-Again restart the Tomcat

sudo systemctl restart tomcat10.service


Backend Installation of Dspace
Download the DSpace-7.3 in the home folder with the following command.

wget https://github.com/DSpace/DSpace/archive/refs/tags/dspace-8.0.zip
Unzip the DSpace file

unzip dspace-8.0.zip

(It will unzip the folder named 'Dspace-dspace-8.0')


Remove the zip folder as it is not required

sudo rm dspace-8.0.zip
Change the directory and enter the Dspace-dspace-8.0

cd DSpace-dspace-8.0
Change the permission to dspace directory

sudo chown -R wishope:wishope ~/DSpace-dspace-8.0

(Replace the wishope:wishopewith your root user name)


Now set the database under the dspace

su postgres
(Enter the password if the system prompt to password)
Enter into the following directory (Change the Postgres version number accordingly)

cd /etc/postgresql/15/main
Create the username and the password for the new role

createuser --username=postgres --no-superuser --pwprompt dspace

(Enter the password e.g dspace)


Create the new database

createdb --username=postgres --owner=dspace --encoding=UNICODE dspace


Add pgcrypto extension

psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"


DSpace configuration (Enter the dspace configuration directory)
cd DSpace-dspace-8.0/dspace/config
Make a copy of file ‘local.cfg.EXAMPLE’ named ‘local.cfg’

cp local.cfg.EXAMPLE local.cfg
Open the configuration file

gedit local.cfg
Here you will find important lines and their purpose. Make the changes in the file
wherever required

# Name of the site

(Change the name of your repository)

dspace.name = DSpace at My University

# Database username and password

(Change the database username and password if there are any changes)

db.username = dspace

db.password = dspace

Un-comment (delete the #) the following line

solr.server = http://localhost:8983/solr

Save and close the file


Return to the DSpace directory

cd ~/DSpace-dspace-8.0
Build the Installation Package

mvn package
Install DSpace Backend (Enter the dspace-installer directory)

cd /~DSpace-dspace-8.0/dspace/target/dspace-installer/
Install the ant fresh

ant fresh_install
nitialize the Database (Apply the following commands)

cd /dspace/bin

./dspace database migrate


Copy the dspace webapps directory to the Tomcat server

sudo cp -R /dspace/webapps/* /var/lib/tomcat10/webapps*


Now Copy Solr directory

cd /dspace/solr

cp -R /dspace/solr/* /opt/solr-8.11.3/server/solr/configsets
Now Restart the Solr

cd /opt/solr-8.11.3/bin
./solr restart
Create an Administrator Account

/dspace/bin/dspace create-administrator

(Enter the email address, first name, last name, password, etc.)
Change the permissions of dspace to Tomcat User

sudo chown -R tomcat:tomcat /dspace


Restart the Tomcat

sudo systemctl restart tomcat10.service


Now open the browser and locate the following URL to open the REST API interface
http://localhost:8080/server

You might also like