<?xml version="1.0" encoding="UTF-8"?>
<OAI-PMH xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.openarchives.org/OAI/2.0/">
  <responseDate>2010-03-12T04:41:14Z</responseDate>
  <request identifier="oai:kete.net.nz:documentation:Topic:261" verb="GetRecord" metadataPrefix="oai_dc">http://kete.net.nz/documentation/topics/show/261-debian-lenny-installing-required-software</request>
  <GetRecord>
    <record>
      <header>
        <identifier>oai:kete.net.nz:documentation:Topic:261</identifier>
        <datestamp>2009-12-21T21:40:49Z</datestamp>
      </header>
      <metadata>
        <oai_dc:dc xmlns:dcterms="http://purl.org/dc/terms/" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/">
          <dc:identifier>http://kete.net.nz/documentation/topics/show/261-debian-lenny-installing-required-software</dc:identifier>
          <dc:title>Debian Lenny Installing Required Software</dc:title>
          <dc:publisher>kete.net.nz</dc:publisher>
          <dc:description><![CDATA[Describes the steps necessary for installing Kete's required software on a Debian Lenny host.]]></dc:description>
          <dc:description><![CDATA[Originally written by Kieran Pilkington, Kete Developer for Katipo Communications, Ltd.
Part of the Installation Guide

Install Required Software for Running Kete
Note: all of the commands on this page are run as root, so if you close the console, make sure you 'su' back to root before continuing
First, lets setup a new source where we can grab the latest Git from. We'll need it to grab the source code later on. In a new console, open up /etc/apt/sources.list in an editor and add to that file these lines (if they aren't already there)
deb http://ftp.nz.debian.org/debian lenny maindeb-src http://ftp.nz.debian.org/debian lenny maindeb http://www.backports.org/debian lenny-backports main contrib non-freedeb http://ftp.indexdata.dk/debian lenny maindeb-src http://ftp.indexdata.dk/debian lenny main
Change .nz in the first two sources to the closest mirror where you live (.uk. for england, .au. for australia etc).
Now update, and install the keyring so you can install from this source.
root@host: # apt-get updateroot@host: # apt-get install debian-backports-keyring
And type 'Y' at the prompt. Then lets jump into what we can grab from debian packages.
root@host: # apt-get update   # grab any new packages after backport keyring was addedroot@host: # apt-get install apt-utils build-essential ruby1.8-dev rubygems imagemagick librmagick-ruby1.8 librmagick-ruby-doc libmagick9-dev libmysqlclient15off libmysqlclient15-dev mysql-server mysql-common mysql-client libmysql-ruby1.8 memcached libxslt1-dev libpcre3-dev zlib1g-dev unzip gzip mytop yaz libyaz3-dev idzebra-2.0 libidzebra-2.0 libidzebra-2.0-dev libidzebra-2.0-modules curl libcurl3-dev libreadline5-dev apache2 apache2-threaded-devroot@host: # apt-get -t lenny-backports install git-core git-svn git-doc
(optional - enables conversion of uploaded HTML, Plain Text, PDF, and Microsoft Word documents to the description of the document)
root@host: # apt-get install wv poppler-utils lynx
(optional - enables support for harvesting embedded metadata in uploaded files, see mini_exiftool gem step later)
root@host: # apt-get install libimage-exiftool-perl
Installing the Rails framework
You need an installation of Ruby. Ruby Enterprise Edition is a product from the same people that make mod_rails/Passenger (discussed at the bottom of this page). It's updated a lot more regularly than Debian updates their packages, which means it has more bug and security fixes. It's also optimized to run faster than a standard installation of Ruby. It requires a few extra installation steps, but it's well worth the effort. (for instructions on using debians packages, see an older version of this topic)
The great thing about Ruby Enterprise Edition (refered to as REE) is that the installer does the installing of Ruby and Rails in one go. It takes less than 15 minutes to setup once downloaded (depending on system speed) and less than 10 minutes to update in the future (depending on the amount of sites you have). Start by following the instructions at&nbsp;http://www.rubyenterpriseedition.com/download.html (download, extract, install). Keep the settings as the default ones REE assigns.
Now add the following to the .bash_profile, and .bashrc files of any users that'll affect the installation (root, kete, and yourself for example). Be sure to use the correct path for REE; it varies by release. Replace the X's in the string below.
# Use correct Ruby, RubyGem pathsPATH=/opt/ruby-enterprise-1.8.7-2009.XX/bin:$PATHexport PATH
Then as both root and the kete user, check that we are using the correct RubyGems version:
$ which gem/opt/ruby-enterprise-1.8.7-2009.XX/bin/gem # should look something like this with correct date
Note: If you plan to use Ruby Enterprise Edition as well as Capistrano, an extra step is necessary. See how to Configure sudo path in capistrano deployments.
Additional Setup Instructions
MySQL
You would have been prompted to add a MySQL root password during install of mysql. If you weren't, run the following commands (change [your_new_password] to a password of your choosing) :
root@host: # mysqladmin -u root password [new_password]
Kete also supports unicode characters, so we'll want to adjust mysql to make unicode the default for new databases. Make utf8 the default by editing /etc/mysql/my.cnf (as root) and adding this in the existing sections:
[client]default-character-set=utf8[mysqld]init-connect = SET NAMES utf8character-set-server = utf8
Save the file, and restart mysql with
root@host: # /etc/init.d/mysql restart
You can confirm that required charset variables now point at utf8 by connecting to the mysql database as mysql root (remember you set that password above) and running:
SHOW VARIABLES LIKE 'character_set%';
Aside from file system and dir, everything else should be utf8.
HTTP Request Server
We recommend Apache 2 in combination with Ruby Enterprise Edition for optimal performance.If you'd prefer to use Nginx with Mongrel, see an older version of this topic.
Apache 2 was installed earlier so, go ahead and install the passenger gem (the gem was installed during the setup of Ruby Enterprise Edition, if you are using a different interpreter, the run 'gem install passenger' as root, then continue).
root@host: # passenger-install-apache2-module
Copy the Apache2 config lines it gives you at the end of the file to the end of your apache2.conf configuration file at /etc/apache2/apache2.conf. The lines look similar to this (paths may differ depending on which ruby implementation you're using):
LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2009.XX/lib/ruby/gems/1.8/gems/passenger-2.2.8/ext/apache2/mod_passenger.soPassengerRoot /opt/ruby-enterprise-1.8.7-2009.XX/lib/ruby/gems/1.8/gems/passenger-2.2.8PassengerRuby /opt/ruby-enterprise-1.8.7-2009.XX/bin/ruby

Some of Kete's downloading functionality requires an authorization step. &nbsp;If used a lot this potentially can slow all requests being served from the site. &nbsp;Thankfully there is an easy solution that Kete knows to use if enabled; X-sendfile. &nbsp;You need to do the following to set it up:
root@host: # cd /usr/local/src/; wget http://tn123.ath.cx/mod_xsendfile/mod_xsendfile-0.9.tar.gz # or get the latest version of the sourceroot@host: # tar xfz mod_xsendfile-0.9.tar.gzroot@host: # cd mod_xsendfile-0.9root@host: # apxs2 -cia mod_xsendfile.croot@host: # cd /etc/apache2/mods-available; touch xsendfile.loadroot@host: # echo "LoadModule xsendfile_module /usr/lib/apache2/modules/mod_xsendfile.so" &gt; xsendfile.loadroot@host: # cd /etc/apache2/mods-enabled/; ln -s ../mods-available/xsendfile.load
Then you need to add the following to your Apache2 config file (either global, or in a virtualhost):
XSendFile onXSendFileAllowAbove on
And force a reload of apache:
root@host: # /etc/init.d/apache2 force-reload
If it isn't already, you'll probably want to get Apache2 to start up automatically at boot. To do that, open a new console and run
root@host: # update-rc.d apache2 defaults
Important Note: At this point, Apache2 and Passenger are installed but not yet configured for our Kete site. We'll handle that in a separate step once we have Kete installed. Until then, web requests will throw an error until you have actually deployed your Kete application.
Next step:Setting Up the Environment]]></dc:description>
          <dc:date>2009-05-14T02:33:39Z</dc:date>
          <dc:creator>Kieran P</dc:creator>
          <dc:creator>kieran</dc:creator>
          <dc:contributor>Kieran P</dc:contributor>
          <dc:contributor>kieran</dc:contributor>
          <dc:contributor>Walter McGinnis</dc:contributor>
          <dc:contributor>walter</dc:contributor>
          <dc:description/>
          <dc:type>InteractiveResource</dc:type>
          <dc:subject><![CDATA[Kete]]></dc:subject>
          <dc:subject><![CDATA[Debian]]></dc:subject>
          <dc:subject><![CDATA[Installation]]></dc:subject>
          <dc:subject><![CDATA[Software]]></dc:subject>
          <dc:subject><![CDATA[Z39.50]]></dc:subject>
          <dc:subject><![CDATA[ZOOM]]></dc:subject>
          <dc:subject><![CDATA[Hardware]]></dc:subject>
          <dc:subject><![CDATA[lenny]]></dc:subject>
          <dc:rights>http://creativecommons.org/licenses/by-sa/3.0/nz/</dc:rights>
          <dc:format>text/html</dc:format>
          <dc:coverage>Topic</dc:coverage>
        </oai_dc:dc>
      </metadata>
      <kete/>
    </record>
  </GetRecord>
</OAI-PMH>
