Published by: Jivesna Tech

Installation of postfix mail server
#apt-get install postfix

Copy the configuration file.
#cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf

Install packages
#apt-get install libsasl2-2
#apt-get install libsasl2-modules
#apt-get install ca-certificates

Open the following file and add few lines.
#nano /etc/postfix/main.cf

relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes

Create a new file to save the gmail password.
#nano /etc/postfix/sasl_passwd

[smtp.gmail.com]:587 urgmailid@gmail.com:yourpassword

Change the permission of following file.
# chmod 400 /etc/postfix/sasl_passwd

Translate the /etc/postfix/sasl_passwd to Postfix lookup tables.
# postmap /etc/postfix/sasl_passwd

Create the /etc/aliases.db
#postalias hash:/etc/aliases

Create the /etc/postfix/cacert.pem.
cat /etc/ssl/certs/Entrust.net_Premium_2048_Secure_Server_CA.pem >> /etc/postfix/cacert.pem

Restart Postfix.
/etc/init.d/postfix restart

Published by: vivek choudhary

Installation of prerequisite applications

#apt-get install openjdk-7-jdk postgresql ant maven

Create a database user
# sudo su postgres
#createuser -U postgres -d -A -P dspace

Enter password for new role: [Enter a password e.g. dspace]
Shall the new role be allowed to create more new roles? (y/n) n

Type exit

#vi /etc/postgresql/9.3/main/pg_hba.conf

Add this line to the configuration file at the end:

local all dspace md5
:wq

Restart PostgreSQL
#/etc/init.d/postgresql rsetart

Create Dspace user
#sudo useradd -m dspace
#sudo passwd dspace
#sudo mkdir /dspace
#sudo chown dspace /dspace

Create the PostgreSQL 'dspace' database

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

Create a build directory
#sudo mkdir /build
#sudo chmod -R 777 /build
#cd /build
wget https://github.com/DSpace/DSpace/releases/download/dspace-5.5/dspace-5.5...
#tar -zxf dspace-5.5-src-release.tar.gz
#cd /build/dspace-5.5-src-release
#mvn -U package

#cd dspace/target/dspace-installer
#sudo ant fresh_install

#cd /opt
wget http://mirror.fibergrid.in/apache/tomcat/tomcat-8/v8.0.36/bin/apache-tom...
# tar xvzf apache-tomcat-8.0.36.tar.gz
# mv apache-tomcat-8.0.36 tomcat
#vi /etc/profile
Add following lines at the bottom of the file,
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export CATALINA_HOME=/opt/tomcat
# sudo cp -r /dspace/webapps/* /opt/tomcat/webapps

#vi /etc/init.d/tomcat
Add following lines in the file,

#!/bin/bash
### BEGIN INIT INFO
# Provides: tomcat7
# 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
:wq

#chmod +x /etc/init.d/tomcat
#update-rc.d tomcat defaults
#/etc/init.d/tomcat restart

Published by: vivek choudhary

Pr-Installation Setup

#apt-get install mysql-server apache2
#mysql -u root -p
>CREATE database koha;
>CREATE user 'kohaadmin'@'localhost' IDENTIFIED by '{koha user password}';
>GRANT ALL ON koha.* TO 'kohaadmin'@'localhost' IDENTIFIED BY '{koha user password}';
>FLUSH PRIVILEGES;
>\q

Add A Koha Community Repository

# wget -q -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -
#echo 'deb http://debian.koha-community.org/koha 17.05 main' | sudo tee /etc/apt/sources.list.d/koha.list
#echo 'deb http://debian.koha-community.org/koha 17.11 main' | sudo tee /etc/apt/sources.list.d/koha.list
#sudo apt-get update

Download the latest Koha release

Add ‘koha’ User

#adduser koha

Install Dependencies
Determine Build Directory

It may look like:

# ls
koha-16.05.11 koha-latest.tar.gz

Ubuntu Packages from Repository

#sudo apt-get install koha-deps koha-perldeps make

Ubuntu Packages for Perl Dependencies

#koha_dir ./koha_perl_deps.pl -m -u

Build, Test, and Install Koha

#Perl Make.pl
#sudo make
#make install

Configure and Start Apache

#sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha.conf

Tweak Koha Site File

The default file limits connections to those from 127.0.1.1 (or 127.0.0.1), which is rather difficult to test/use in a server environment. Edit the file

#sudo vi /etc/apache2/sites-available/koha.conf

And change the two references from 127.0.1.1 (or 127.0.0.1) to *. The first match should to change should look like:

<VirtualHost *:80>

The second match to change should look like:

<VirtualHost *:8080>
:wq
#sudo /etc/init.d/apache2 restart

Setup Default Ports

# sudo vi /etc/apache2/ports.conf

Make sure both these Lines to the ports.conf file:

Listen 80
Listen 8080
:wq

Enable Modules and Site

# sudo a2enmod rewrite
# sudo a2enmod deflate
# sudo a2ensite koha.conf
# sudo /etc/init.d/apache2 restart

Setup Zebra Search

#sudo ln -s /usr/share/koha/bin/koha-zebra-ctl.sh /etc/init.d/koha-zebra-daemon
#sudo update-rc.d koha-zebra-daemon defaults
#sudo /etc/init.d/koha-zebra-daemon start

Configure Zebra Indexing

#sudo vi /etc/cron.d/koha

KOHA_CONF=/etc/koha/koha-conf.xml
KOHA_PATH=/usr/share/koha
PERL5LIB=/usr/share/koha/lib

*/5 * * * * koha $KOHA_PATH/bin/migration_tools/rebuild_zebra.pl -b -a -z &> /dev/null
:wq

Published by: Vijay Pratap Singh(Jivesna Tech)

SELECT p.cardnumber AS 'Card Number', concat(p.firstname, " ", p.surname) AS 'Name',
p.email As 'E-Mail', c.issuedate AS 'Issue Date',c.date_due AS 'Due Date',
(TO_DAYS(curdate())-TO_DAYS( date_due)) AS 'Days Overdue',(TO_DAYS(curdate())-TO_DAYS( date_due))*5 AS 'Fine',
b.title AS 'Title', b.author AS 'Author', i.itemcallnumber AS'Call No.',
i.barcode AS'Barcode'
FROM borrowers p
LEFT JOIN issues c ON (p.borrowernumber=c.borrowernumber)
LEFT JOIN items i ON (c.itemnumber=i.itemnumber)
LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber)
WHERE c.branchcode = <<Branch|branches>> AND c.date_due < curdate()
ORDER BY p.surname ASC, p.firstname ASC, c.date_due ASC

Published by: Vijay Pratap Singh(Jivesna Tech)

SELECT i.Barcode, b.Title, b.Author,i.ccode,count(DISTINCT i.itemnumber) as "Copies"
FROM biblio b
LEFT JOIN items i USING (biblionumber)
WHERE i.itemnumber
AND b.biblionumber
GROUP BY b.biblionumber

Pages