Thursday, January 13, 2022

To edit any files with SFTP or FTP with normal user (ubuntu 20.04)

 The following commands are allowed to edit on SFTP/FTP

sudo find /etc/koha/ -type d -exec chmod 777 {} \;

sudo find /etc/koha/  -type f -exec chmod 666 {} \;














Monday, January 10, 2022

Open port on ubuntu 16.04/20.04 LTS

 Open terminal [ctrl+T] and hit 


sudo ufw status

Apache Full                ALLOW       Anywhere
22                         ALLOW       Anywhere
3306                       ALLOW       161.202.20.0/24
3306 on eth1               ALLOW       Anywhere
3306                       ALLOW       Anywhere
Apache Full (v6)           ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)
3306 (v6) on eth1          ALLOW       Anywhere (v6)
3306 (v6)                  ALLOW       Anywhere (v6)
There is no 8080 port in above list
Now allow 8080 port 
sudo ufw allow

Tuesday, November 16, 2021

DSpace Autobackup

 #!/bin/bash

PGPASSWORD="dspace" pg_dump -U dspace -h localhost -Fc dspace | gzip > dspace_backup/dspace-$(date +%Y-%m-%d-%H.%M.%S).sql.gz

now=$(date +"%d_%m_%Y")

zip -r  /home/koha/dspace_backup/$now-assetstore.zip /dspace/assetstore

Friday, July 9, 2021

Installing Tomcat

cd /opt && sudo wget https://mirrors.estointernet.in/apache/tomcat/tomcat-9/v9.0.50/bin/apache-tomcat-9.0.50.tar.gz


sudo tar xvzf apache-tomcat-9.0.50.tar.gz

sudo mv apache-tomcat-9.0.50 tomcat

sudo gedit /etc/profile

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

 

sh /opt/tomcat/bin/shutdown.sh

sh /opt/tomcat/bin/startup.sh

  



Friday, February 12, 2021

Import large sql file in Phpmyadmin on Ubuntu 20.04 (Debian9)

If try to import large SQL (MySqL) file and take long lime or fail to work.

Try the bellow steps:

Create an 'Upload' and a 'save' directories for PhpMyadmin

mkdir /etc/phpmyadmin/upload 

mkdir /etc/phpmyadmin/save 

chmod a+w /etc/phpmyadmin/upload 

chmod a+w /etc/phpmyadmin/save

Then edit phpmyadmin's config file: 

sudo nano /etc/phpmyadmin/config.inc.php

add absolute path for both 'upload' and 'save' directories:

$cfg['UploadDir'] = '/etc/phpmyadmin/upload'; 

$cfg['SaveDir'] = '/etc/phpmyadmin/save';

$cfg['Servers'] [$i] ['LoginCookieValidity'] = 72000;

Now copy the koha_library.sql file to [/etc/phpmyadmin/upload]

cp /your koha_library.sql file/   /etc/phpmyadmin/upload/

sudo chmod 777 /etc/phpmyadmin/upload/koha_library.sql


Timeout error in phpMyAdmin during import database from file

and 

Open (search code using F6 in nano editor)

nano /usr/share/phpmyadmin/libraries/config.default.php

$cfg['ExecTimeLimit'] = 300; Make it to

$cfg['ExecTimeLimit'] = 0;

Restart Apache2 

service apache2 restart


                                                           

Thursday, February 11, 2021

How do I uninstall MySQL completely from ubuntu/Debian

sudo -i

service mysql stop


killall -KILL mysql mysqld_safe mysqld


apt-get --yes purge mysql-server mysql-client


apt-get --yes autoremove --purge


apt-get autoclean


deluser --remove-home mysql


delgroup mysql



sudo rm -rf /var/lib/mysql 

 

sudo apt-get remove --purge *mysql\*


sudo apt-get autoremove


sudo apt-get autoclean 




Tuesday, January 12, 2021

MySQL Autobackup of Koha in Debian/Ubuntu


I am showing you the easiest way to keep automate your koha db backupthat is the combination of MySQL Dumps and a cronjob.

Create a file called mysqldump.sh

mkdir /home/debian/backup/mysqldump.sh

copy the bellow line.

mysqldump -uroot -p******* koha_library | gzip > /home/debian/backup/koha_`date +%F`.sql.gz

save it

Test the script

 chmod +x /home/debian/backup/mysqldump.sh

Create and schedule a new cron job

Execute the script:

 sh /home/debian/backup/mysqldump.sh

And add the following line at the bottom of crontab -e

 30 23 * * * /home/debian/backup/mysqldump.sh

(This will execute the script every day at 23:30.)

------------------------------PERIODIC REMOVAL OF FILES--------------------------

tested on Debian/UBUNTU

  nano /home/debian/backup/mysqldump.sh

Add the line at the end: (this script will remove your Koha backfiles after 7 days)

  find /home/debian/backup/koha* -type f -mtime +7 -exec rm {}

--------------------------Auto Restart Mysql service------------------------------------------

And add the following line at the bottom of crontab -e 

30 23 * * * systemctl is-active  || systemctl start mysql.service

This will run every midnight at 11.30PM



Schedule Restart ​PM2 Service for DSpace 9.2 on Ubuntu

Start Manually pm2 start /home/dspace/dspace-angular-dspace-9.2/dspace- ui.json   Find PM2 binary path which pm2 Add DAILY resta...