Koha 3.4 on Debian Squeeze (Git Method)

This guide assumes you are familiar with Debian, and that you have already setup a server with apache2 and mysql and have created a user (koha in this case) to install koha under and that said user has full sudo permissions. It is also tailored to those doing "dev" type installs, but can easily be adapted for "production" type installs.
== Installing Koha ==
All the below steps can be and should be undertaken as the koha user!
su - koha
=== Software Dependencies ===
Update the apt sources to include "Indexdata"
sudo vim /etc/apt/sources.list
add the lines:
# Index Data
deb http://ftp.indexdata.dk/debian squeeze main
deb-src http://ftp.indexdata.dk/debian squeeze main
The Index Data packages are signed with a key you can install as follows;file is downloaded and installed to roots home directory for cleanliness in this example
sudo wget http://ftp.indexdata.dk/debian/indexdata.asc --directory-prefix=/root
sudo apt-key add /root/indexdata.asc
Install dependencies: example script
Configure the cpan to enable installation of remaining perl module dependencies
cpan
This will take you through cpan configuration script, accepting the defaults is fine.
Once complete, run;
install Bundle::CPAN
This installs the latest CPAN module and lots of helper modules and is a good test that cpan is
working correctly.
Now install Perl Dependency Modules via CPAN: example script
==== Installing and Configuring MySQL ====
Ensureing the correct character encoding for koha;
sudo cp /usr/share/mysql/config.medium.ini /etc/my.cnf
Then add the following lines to the my.cnf;
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
default-character-set=utf8
default-collation=utf8_unicode_ci
Restart mysql for changes to take effect:
sudo /etc/init.d/mysql restart
Creating the koha database (replace **** by your chosen kohaadmin password);
 mysql -uroot -p'******'
 mysql> CREATE DATABASE koha CHARACTER SET utf8 COLLATE utf8_bin;
 mysql> GRANT ALL ON koha.* TO 'kohaadmin'@'localhost' IDENTIFIED BY '****';
 mysql> FLUSH PRIVILEGES;
=== Koha ===
==== Download ====
Change to Koha home directory and download Koha source via git.
cd /home/koha
git clone git://git.koha-community.org/koha.git kohaclone
To keep things clean, create a new release tracking branch. (replace INSTALLNAME with whatever you want to call your install);
cd kohaclone
git checkout -b INSTALLNAME --track tag/v3.04.00 
==== Installation ====
This follows the standard perl conventions. From within the kohaclone repository:
perl Makefile.PL
make
make install
To run from the git clone select a dev install. See the Koha INSTALL documentation for more info.
Fix any Dependancy issues mentioned after running Makefile.PL using instructions How_to_install_missing_Perl_modules_on_Debian and re-run Makefile.PL until no issues are flagged.
==== Setting Environment Variable ====
Add environment variables to ~/.bashrc
(the actual values will differ depending on the answers to Makefile.PL)
For a dev install:
 export KOHA_CONF=/home/koha/koha-dev/etc/koha-conf.xml
 export PERL5LIB=/home/koha/kohaclone
==== Configuring Apache2 ====
Link /home/koha/koha-dev/etc/koha/koha-httpd.conf to /etc/apache2/sites-available/koha
 sudo ln -s /home/koha/koha-dev/etc/koha-httpd.conf /etc/apache2/sites-available/koha
Add "Listen" on port 8080 directive to /etc/apache2/ports.conf;
 sudo nano /etc/apache2/ports.conf
Configure final apache2 Settings, link the Koha site and Restart service to make settings stick;
 sudo a2enmod rewrite
 sudo a2ensite koha
 sudo apache2ctl restart
You should now find the Koha on-line setup page at YOURHOST:8080.
;Notes
Category:Obsolete