Topic: openSUSE Installing Required Software

Topic type:

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

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

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

root@host: # yast2 -i gcc gcc-c++ make automake git ruby ruby-devel rubygems mysql mysql-client libmysqlclient15 libmysqlclient-devel ruby-mysql zlib gzip unzip memcached ImageMagick ImageMagick-devel ruby-RMagick ruby-RMagick-doc libxml2 libxml2-devel libxslt libxslt-devel yaz libyaz-devel idzebra idzebra-devel curl libcurl-devel libreadline5 readline-devel apache2 apache2-devel 

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

root@host: # yast2 -i wv wv-devel poppler-tools libpoppler4 poppler-data lynx

(optional - enables support for harvesting embedded metadata in uploaded files, see mini_exiftool gem step later)

root@host: # yast2 -i libexif exiftool

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 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 opensuse 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 http://www.rubyenterpriseedition.com/download.html (download, extract, install). Keep the settings as the default ones REE assigns.

Warning: Versions prior to 20090610 contained a security issue which could cause DoS issues. It is highly recommended that you use 20090610 or a newer version when installing. If you have a previous version of Ruby Enterprise Edition, we recommend upgrading it as soon as possible.

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-2009XXXX/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-2009XXXX/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

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:

[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.

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

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 httpd.conf configuration file at /etc/apache2/httpd.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.6-2009XXXX/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
PassengerRoot
/opt/ruby-enterprise-1.8.6-2009XXXX/lib/ruby/gems/1.8/gems/passenger-2.2.2
PassengerRuby
/opt/ruby-enterprise-1.8.6-2009XXXX/bin/ruby

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 http://tn123.ath.cx/mod_xsendfile/mod_xsendfile-0.9.tar.gz # or get the latest version of the source
root@host: # tar xfz mod_xsendfile-0.9.tar.gz
root@host: # cd mod_xsendfile-0.9
root@host: # apxs2 -cia mod_xsendfile.c
root@host: # a2enmod xsendfile

Then you need to add the following to your Apache2 config file (either global, or in a virtualhost):

XSendFile on
XSendFileAllowAbove 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: # 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