Topic: openSUSE Installing Required Software

Topic Type: Topic

Describes the steps necessary for installing Kete's required software on an openSUSE 11.0 host.

Originally written by Kieran Pilkington, Kete Developer for Katipo Communications, Ltd.

An appendix to the Installation Guide


Install Required Software for Running Kete

We'll jump right into what we can grab from openSUSE packages. Open a new console and run the following commands

$ su
root@host: # yast2 -i gcc gcc-c++ make automake git ruby ruby-devel rubygems mysql mysql-client libmysqlclient15 ruby-mysql zlib gzip unzip memcached ImageMagick ruby-RMagick ruby-RMagick-doc libxml2 libxml2-devel libxslt libxslt-devel

(optional - enables conversion of uploaded HTML, Plain Text, PDF, and Microsoft Word documents to the description of the document)

$ su
root@host: # yast2 -i wv wv-devel poppler-tools libpoppler3 poppler-data lynx

Installing the Rails framework

There are two options when it comes to installing Rails. The first is to install it on the ruby installation you setup above using yast2. The more optimized option is to use Ruby Enterprise Edition, a product from the same people that make mod_rails/Passenger (discussed at the bottom of this page). It's optimized to run faster than a standard installation of Ruby. It requires a few extra installation steps, but it's well worth the effort.

Installing Rails on package installed Ruby

Install both rails (framework) and mongrel (server) that Kete will run on. You may encounter something like "could not find blah..." when running the following commands. Rubyforge and the gem mirrors can be flaky, just try again and it will usually come right.

root@host: # gem update --system
root@host: # gem update
root@host: # gem install rails mongrel mongrel_cluster -y

Installing Rails with Ruby Enterprise Edition

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 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 filea 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.6-2008XXXX/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.6-2008XXXX/bin/gem # should look something like this with correct date

Additional Setup Instructions

MySQL

If this is the first time MySQL is being used on the system, run the following commands (change [your_new_password] to a password of your choosing) :

root@host: # /etc/init.d/mysql start
root@host: # mysqladmin -u root password [your_new_password]

Kete also supports unicode characters, so we'll want to adjust mysql to make unicode the default for new databases. Make utf8 he default by editing /etc/my.cnf (as root) and adding this in the [mysqld] section:

# making utf8 the default
init-connect = 'SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_general_ci

Save the file, and restart mysql with

root@host: # /etc/init.d/mysql restart

Memcached

You also need to turn on memcached to run at startup. To do that, open a new console and run

root@host: # chkconfig -a memcached
root@host: # chkconfig memcached on
root@host: # memcached -du root

YAZ and Zebra

Kete relies on specific versions of YAZ and Zebra, so the older versions must be compiled from source.

root@host: # mkdir /usr/local/src
root@host: # chmod 777 /usr/local/src
root@host: # cd /usr/local/src
root@host: # wget http://ftp.indexdata.dk/pub/yaz/yaz-2.1.54.tar.gz
root@host: # tar xfz yaz-2.1.54.tar.gz
root@host: # wget http://ftp.indexdata.dk/pub/zebra/idzebra-2.0.6.tar.gz
root@host: # tar xfz idzebra-2.0.6.tar.gz
root@host: # cd yaz-2.1.54
root@host: # ./configure --prefix=/usr
root@host: # make
root@host: # sudo make install
root@host: # cd ../idzebra-2.0.6
root@host: # ./configure --prefix=/usr --with-yaz=../yaz-2.1.54 --enable-mod-alvis
root@host: # make
root@host: # sudo make install

HTTP Request Server

For the following section, you have two choices to serve HTTP requests. Nginx ("engine X") or Apache2. Each has their own advantages, so the choice is yours, depending on what you have available to work with.

Note: Neither of these are nessesary when running in development or test mode. You can despense with the http request server when requests are made from the same computer as the application is being run on. When you deploy to production, then you'll want one of these setup.

Nginx

Pros: Nginx allows you to configure how many mongrel servers you want to have and at which IPs. A good choice if you plan to deploy your application around the globe.
Cons: Not Nginx related, but using Nginx requires having multiple mongrels on a single computer, and it can use a lot of memory and can be a pain to manage at deploy time.

Grab the latest tarball from http://sysoev.ru/nginx/download.html and do the following (adjust version numbers accordingly).

root@host: # cd /usr/local/src
root@host: # wget http://sysoev.ru/nginx/nginx-0.6.32.tar.gz
root@host: # tar xfz nginx-0.6.32.tar.gz
root@host: # cd nginx-0.6.32/
root@host: # ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin --with-http_ssl_module
root@host: # make
root@host: # sudo make install

Lastly grab a /etc/init.d/nginx script for managing the daemon by doing this:

root@host: # sudo wget http://notrocketsurgery.com/files/nginx -O /etc/init.d/nginx
root@host: # sudo chmod 750 /etc/init.d/nginx

You'll probably want to get nginx to start up automatically at boot. To do that, open a new console and run

root@host: # chkconfig -a nginx
root@host: # chkconfig nginx on

Important Note: At this point, Nginx is 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 and started a mongrel cluster to match your settings in /usr/local/nginx/conf/nginx.conf

You may want to add /usr/local/sbin to your PATH.

root@host: # PATH=/usr/local/sbin/:$PATH
root@host: # export $PATH

Apache2

Pros: Quick to setup, easy to deploy and restart applications. Minimal memory consumption. Simple site configuration.
Cons: Can't deploy across mulitple Apache2 configurations.

Start by install Apache2 from yast2 if you don't already have it.

root@host: # yast2 -i apache2 apache2-devel

Then install the passenger gem and install the module.

root@host: # gem install passenger
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 will be different if using REE):

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /usr/bin/ruby

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: # chkconfig -a apache2
root@host: # chkconfig apache2 on

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 0 comments in this discussion.

join this discussion

Creative Commons Attribution-Share Alike 3.0 New Zealand License
openSUSE Installing Required Software by k776 is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License