Monday, February 5, 2024

Installing Koha 23.05 on ubuntu

apt update
sudo apt-get -y install sudo wget gnupg
wget -q -O- https://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
sudo apt-get update
echo 'deb http://debian.koha-community.org/koha stable main' | sudo tee /etc/apt/sources.list.d/koha.list    
sudo apt-get update
sudo apt-get install koha-common
sudo apt-get install mysql-server 
sudo a2enmod rewrite 
sudo a2enmod cgi 
sudo service apache2 restart
sudo nano /etc/apache2/ports.conf
Listen 80
Listen <staff interface port number> i.e. 8080
sudo nano /etc/koha/koha-sites.conf
change INTRAPORT to 8080
sudo service apache2 restart 
sudo koha-create --create-db library
sudo nano /etc/apache2/sites-enabled/000-default.conf
sudo service apache2 restart 
To Know the koha_library password
sudo koha-passwd library
http://IP-Domain name:8080 (staff)
http://IP-Domain (OPAC)

Tuesday, March 7, 2023

If Node Version Manager (nvm) does not install in Ubuntu

 Manual Install

export NVM_DIR="$HOME/.nvm" && (

  git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"

  cd "$NVM_DIR"

  git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`

) && \. "$NVM_DIR/nvm.sh"

-------------------------------------

export NVM_DIR="$HOME/.nvm"

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion


------------------------------------

(

  cd "$NVM_DIR"

  git fetch --tags origin

  git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`

) && \. "$NVM_DIR/nvm.sh"

----------------

nvm install 16.18.1

Sunday, January 29, 2023

Installing DSpace 6.x on Ubuntu/Debian

Software Requirements

Software needed to run DSpace.

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


Create User

Create a dspace user.


sudo useradd -m dspace

sudo passwd dspace


Install PostgreSQL

Install PostgreSQL database.


sudo apt install postgresql postgresql-client -y


Create a dspace user with a dspace password in PostgreSQL.


sudo su postgres

createuser -U postgres -d -A -P dspace

exit


Create a dspace database .


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


Activate the pgcrypto extension.


sudo su postgres

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

exit


Open the PostgreSQL configuration file.


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


Add the following line at the bottom of the configuration.


local  all  dspace  md5


Restart PostgreSQL.


sudo systemctl restart postgresql

sudo systemctl status postgresql


Building DSpace

Install OpenJDK 8.


sudo apt install openjdk-8-jdk -y


If you have previously installed another version of OpenJDK, change the default java to OpenJDK 8.


sudo update-alternatives --config java


Install ant and maven.


sudo apt install ant maven -y


Create a dspace folder.


sudo mkdir /dspace

sudo chown dspace /dspace


Create a build folder for building DSpace.


sudo mkdir /build

sudo chmod -R 777 /build

cd /build



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


Extract dspace*.tar.gz


sudo tar xzvf dspace*.tar.gz


Move to the dspace-6.3-src-release folder


cd dspace-6.3-src-release


Copy the local.cfg file.


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


Compile the DSpace package.


sudo mvn -U package


Install DSpace.


cd dspace/target/dspace-installer

sudo ant fresh_install


Install Apache Tomcat

Download and extract Apache Tomcat 9.


cd /opt


wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.71/bin/apache-tomcat-9.0.71.tar.gz


sudo tar xzvf apache-tomcat-9.0.71.tar.gz


Change the apache-tomcat-9.0.41 folder to tomcat.


sudo mv apache-tomcat-9.0.71 tomcat


Open the file /etc/profile.


sudo nano /etc/profile


Add these lines at the bottom, configuration environment variables for Java.


export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

export CATALINA_HOME=/opt/tomcat


Copy dspace webapps to tomcat webapps.


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


Create a bash script so that Tomcat can run automatically.


sudo nano /etc/init.d/tomcat


Enter the following bash script.


#!/bin/bash

### BEGIN INIT INFO

# Provides:        tomcat9

# 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


Give it executable permissions and set it as service.


sudo chmod +x /etc/init.d/tomcat

sudo update-rc.d tomcat defaults


Run Tomcat server and check its status.


sudo service tomcat start

sudo service tomcat status


DSpace Administrator


Create a DSpace administrator account.


sudo /dspace/bin/dspace create-administrator


Delete the builds folder.


sudo rm -rf /build


DSpace access test.


http://localhost:8080/xmlui or http://serverIP:8080/xmlui

http://localhost:8080/jspui or http://serverIP:8080/jspui

Friday, December 2, 2022

How to automatically reboot Ubuntu 22.04

 

Schedule reboots in the Ubuntu


launch a terminal

Type sudo su

sudo crontab -e and then press ENTER

Then 

Add the below line 

00 09   *   *   *    /sbin/shutdown -r +5

Press CTRL+X, then Y, then ENTER.

Your ubuntu server automatically restarts at 9:05am daily

Monday, August 29, 2022

Installing Koha 22.05 on Ubuntu 20.04 LTS

sudo apt-get update


sudo apt upgrade


sudo apt clean


sudo apt-get -y install sudo wget gnupg2


echo deb http://debian.koha-community.org/koha oldstable main | sudo tee /etc/apt/sources.list.d/koha.list



wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -



sudo apt update


sudo apt install -y mariadb-server


sudo mysqladmin -u root password (******)


sudo apt install -y koha-common


sudo nano /etc/koha/koha-sites.conf



update INTRAPORT from '80' to 8080


INTRAPORT="8080"


sudo a2enmod rewrite


sudo a2enmod cgi


sudo service apache2 restart


sudo koha-create --create-db library


sudo nano  /etc/apache2/ports.conf


Edit ports.conf & add the the port 8080



Listen 80

Listen 8080



sudo service apache2 restart


sudo a2dissite 000-default


sudo a2enmod deflate


sudo a2ensite library


sudo service apache2 restart



To view the (koha_library) admin user password


sudo xmlstarlet sel -t -v 'yazgfs/config/pass' /etc/koha/sites/library/koha-conf.xml;echo


Tuesday, July 12, 2022

Extract .xz files on Linux (ubuntu)

sudo apt update

sudo apt install xz-utils

unxz file.xz

In my case, I have a file koha_library.sql.xz

unxz koha_library.sql.xz

Search text in nano editor in Ubuntu Linux

Edit file in Nano

Press CTRL + W or F6   

Than Enter

Installing Koha 23.05 on ubuntu

apt update sudo apt-get -y install sudo wget gnupg wget -q -O- https://debian.koha-community.org/koha/gpg.asc | sudo apt-key add - sudo apt...