Topic: Debian Squeeze Installing Required Software
Topic type:
Describes the steps necessary for installing Kete's required software on a Debian Squeeze host.
Originally written by Walter McGinnis, Kete Project Lead for Katipo Communications, Ltd. based on earlier work by Kieran Pilkington and others.
Confirmed that this does work with Amazon AWS - just remember to add the 9901 and 9902 ports to the AWS security instance you are using so that Zebra will work correctly.
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
If you haven't already, install the aptitude package, wget package, and the package for your favorite text editor.
root@host # apt-get install aptitude wget your_favorite_editor_package_name # you can skip this if they are already on your system
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 squeeze main # see note below about adjusting domain name for local mirror
deb-src http://ftp.nz.debian.org/debian squeeze main
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
deb http://ftp.indexdata.dk/debian squeeze main
deb-src http://ftp.indexdata.dk/debian squeeze main
deb http://packages.dotdeb.org squeeze all # see http://www.dotdeb.org/ for info on dotdeb, needed for newer mysql version, squeeze stock mysql 5.1.49 has bug
deb-src http://packages.dotdeb.org squeeze all
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 YAZ and Zebra.
root@host: # wget http://ftp.indexdata.dk/debian/indexdata.asc
root@host: # apt-key add indexdata.asc
root@host: # wget http://www.dotdeb.org/dotdeb.gpg
root@host: # cat dotdeb.gpg | apt-key add -
Then lets jump into what we can grab from debian packages.
root@host: # aptitude update # grab any new packages after backport keyring was added
root@host: # aptitude install apt-utils build-essential ruby1.8-dev rubygems imagemagick librmagick-ruby1.8 librmagick-ruby-doc libmagick9-dev libmysqlclient libmysqlclient-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-dev
root@host: # aptitude install git-core git-doc
(optional - enables conversion of uploaded HTML, Plain Text, PDF, and Microsoft Word documents to the description of the document)
root@host: # aptitude install wv poppler-utils lynx
(optional - enables support for harvesting embedded metadata in uploaded files, see mini_exiftool gem step later)
root@host: # aptitude install libimage-exiftool-perl
Installing the Rails framework
The Kete project, at least for the time being, has standardized on Ruby Enterprise Edition for its version of the Ruby programming language. In addition we use Passenger (a.k.a mod_rails) in combination with Apache to serve Kete as a Ruby on Rails application.
Ruby Enterprise Edition (refered to as REE) has an installer. Start by following the download and install instructions at http://www.rubyenterpriseedition.com/download.html with one change:
./ruby-enterprise-X.X.X/installer --dont-install-useful-gems
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 paths PATH=/opt/ruby-enterprise-1.8.7-20XX.XX/bin:$PATH export 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-20XX.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 utf8
character-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
Current versions of Kete run on Apache 2 in combination with Ruby Enterprise Edition with Passenger. If you have an older version of Kete that requires Nginx with Mongrel, see an older version of this topic.
IMPORTANT - SKIP THIS STEP UNTIL MENTIONED IN 'PREPARING APPLICATION', THEN COME BACK TO THESE INSTRUCTIONS.
Apache 2 was installed earlier so, go ahead and install Passenger module for Apache.
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-20XX.XX
/lib/ruby/gems/1.8/gems/passenger-2.2.8/ext/apache2/mod_passenger.so
PassengerRoot/opt/ruby-enterprise-1.8.7-20XX.XX/
lib/ruby/gems/1.8/gems/passenger-2.2.8
PassengerRuby/opt/ruby-enterprise-1.8.7-20XX.XX/
bin/ruby
END STUFF TO SKIP FOR NOW
Some of Kete's downloading functionality requires an authorization step. If used a lot this potentially can slow all requests being served from the site. Thankfully there is an easy solution that Kete knows to use if enabled; X-sendfile. You need to do the following to set it up:
root@host: # cd /usr/local/src/; wget https://tn123.org/mod_xsendfile/mod_xsendfile-0.12.tar.gz --no-check-certificate # or get the latest version of the source
root@host: # tar xfz mod_xsendfile-0.12.tar.gz
root@host: # cd mod_xsendfile-0.12
root@host: # apxs2 -cia mod_xsendfile.c
Then you need to add the following to your Apache2 config file (either global, or in a virtualhost):
XSendFile on
And force a reload of apache:
root@host: # /etc/init.d/apache2 restart
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 # if it is already enabled, the response will tell you so
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
Discuss This Topic
There are 2 comments in this discussion.
Read and join this discussion
> /opt/ruby-enterprise-1.8.7-2012.02/bin/passenger-install-apache2-module
> But this did not exist! Running the installer without --dont-install-useful-gems
> seems to have solved the problem.
Thanks for the heads up. I'll look into it.
You'll need to uninstall some conflicts gems later as noted in this step:
http://old.kete.net.nz/documentation/topics/show/121
We're working on using bundler to simplify this.
magnusenger
said Problem with --dont-install-useful-gems
I tried to run this:
Then I was told to run this, to install Phusion Passenge
But this did not exist! Running the installer without
--dont-install-useful-gems
seems to have solved the problem.