Horizontal Navigation

Monday 28 November 2016

Proxy Setting for apt-get and wget in Ubuntu

If you are using Internet through your Institutions Proxy Server, then set up proxy in the following files of Ubuntu 
To check if you have proxy configured in your system:
env | grep proxy
First Method:
To setup proxy, add the following lines to these environment settings:


1) apt.conf (for apt-get)
sudo gedit /etc/apt/apt.conf
Acquire::http::Proxy "http://username:password@proxy:port";
Acquire::https::Proxy "http://username:password@proxy:port";
Acquire::ftp::Proxy "http://username:password@proxy:port";
2) wgetrc (for wget)
sudo gedit /etc/wgetrc
Then uncomment the following three lines:
https_proxy  = http://username:password@proxy:port
http_proxy = http://username:password@proxy:port
ftp_proxy = http://username:password@proxy:port
Uncomment 'use_proxy = on'

Then reboot. sudo reboot


After rebooting your machine, you can now use apt-get and wget normally like sudo apt-get install package-name and wget url

Second Method:
If you don't want to change any configurations and just wanted to use proxy for the entire duration of your session:
For apt-get:
sudo http_proxy='http://username:password@proxy:port' apt-get install package-name
For wget:
export http_proxy='http://username:password@proxy:port' && wget url

OR
export http_proxy=http://proxy:port && wget --proxy-user=user --proxy-password=password url
Things to remember: 
1) Use this format if your proxy doesn't require login credentials: http://proxy:port
2) If your proxy server is Windows-based just like ours, don't forget to add your domain in your login.
ex. http://domain\username:password@proxy:port
3) Character escape your password if it has special characters.
ex. proxy-password=me\@123
4) If after setting up the http_proxy environment variable for wget and the connection still fails, also set up the https_proxy and ftp_proxy variables.
References: 
1. http://askubuntu.com/questions/664777/systemwide-proxy-settings-in-ubuntu
2. http://annelagang.blogspot.in/

Sunday 27 November 2016

Installation of Koha on Ubuntu 14.04

Koha can install on Ubuntu/Xubuntu/Kubuntu/Lubuntu. Use the following steps for the installation of Koha on Ubuntu 14.04 LTS

Step 1: Install Ubuntu 14.04 LTS
Open Terminal by: Applications -> Accessories -> Terminal
   
Step 2: Update the system (Ubuntu 14.04 LTS) using following commands:

(i)  sudo su (Enter Sudo Password)
(ii) apt-get update
(iii)apt-get upgrade

Step 3: Add Koha community repository and Add Koha software channel into Ubuntu.

 (i)
echo deb http://debian.koha-community.org/koha stable main | sudo tee /etc/apt/sources.list.d/koha.list
 
(ii) wget -O- http://debian.koha-community.org/koha/gpg.asc | sudo apt-key add -

(iii)apt-get update

Step 4: Install Koha
Use the following command for the installation of latest release of Koha.

sudo apt-get install libgd-perl
sudo apt-get install koha-common
The command will start to download Koha and required packages.
On the way, the process will ask to enter mail of system. Accept the default values.

Step 5: Server configuration
Now you need to edit the network information like domain name and port numbers. Use the following command

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

Here I change port number of Koha staff client to 8090. Find following line in the file and make changes.     

INTRAPORT="8090"

Step 6: Install MySQL server
Apply following command to install MySQL server.

sudo apt-get install mysql-server

Give a new password for root user while installation.

Step 7: Koha instance creation
 
Apply following commands to create Apache configuration files.

(i)   sudo a2enmod rewrite
(ii)  sudo a2enmod cgi
(iii) sudo service apache2 restart


Step 8: Create a Koha instance with the name library.

sudo koha-create --create-db library


Step 9: Ubuntu MySQL security Tweak
Apply the  following command:
 

sudo mysql_secure_installation

[Enter the MySQL Root password]

Give the answer n (no) for the first question. Give y (yes) for other questions.

Step 10: Adding ports
I have assigned 8090 port for Koha staff client and 80 for OPAC.
Open following file and add new port.

(i) sudo gedit /etc/apache2/ports.conf

(ii) Then copy & paste following line below Listen 80

Listen 8090

(iii) Restart Apache server by using following command

sudo service apache2 restart

Step 11: Enable modules and sites by using following commands

(i)  sudo a2dissite 000-default
(ii) sudo a2enmod deflate
(iii)sudo a2ensite library
(iv) sudo service apache2 restart


Step 12: Change Koha default master password. Please follow two sub-steps.
 
Sub-step 1: First change the password of koha_library database.
(i) sudo su
         
[enter the Linux Root password]

(ii) mysql -uroot -p  
           [enter the MySQL Root password]

(iii) use mysql;
(iv)  SET PASSWORD FOR 'koha_library'@'localhost' = PASSWORD('koha123');
(v) flush privileges;
(vi) quit;

Sub-step 2: Then put new password in /etc/koha/sites/library/koha-conf.xml file. To open the said file, use the command given below.

(i) sudo gedit /etc/koha/sites/library/koha-conf.xml 
(ii)  Then find the line using ctrl+f and  see by replacing default password with koha123. Please see: " <pass>koha123</pass>"

Step 13: Install missing PERL modules (You may skip this step)
After install need to install some PERL PERL modules using CPAN.

Koha > About Koha > Perl Modules

Find missing PERL modules in different colors.

Open a terminal and apply following command to enable CPAN.

sudo su
cpan

To install a particular PERL module, e.g.

install Test::DBix::Class

Step 14: Now start Koha by opening the following links in browser

Start the Apache server by using the following command:
sudo service apache2 restart
 

Then Open browser and use the following URL:
http://localhost:8090 (Staff client). Then complete web installer steps.
http://localhost:80 (Online Public Access Catalogue)