Fork me on GitHub

Installing the Requirements

An article by Gaspard Bucher

How to install and configure the environment for raising zena.

Installing zena itself is as simple as shown in Getting Started, however, setting up the environment depends on where you want to install zena.

automatic script

If you have a dedicated debian server, you may follow these instructions.

Generic Instructions

Dependencies

Automatic Image Resizing

The online image resizing feature requires graphicsmagick or imagemagick. Installing can be as easy as

sudo apt-get install libgraphicsmagick1-dev

Ruby Environment

Zena requires ruby 1.8. Installing can be as easy as

sudo apt-get install ruby1.8 rubygems1.8

If you want to have different versions installed side-by-side, or can not install through the systems package manager, it is recommended to use “rvm”, the ruby version manager:

curl -L https://get.rvm.io | bash -s stable
# load rvm from ~/.profile or .bash_profile (overrides .profile for bash)
source ~/.rvm/scripts/rvm
rvm notes
rvm requirements
rvm pkg install openssl
rvm install 1.8.7
# set the default ruby version globally
rvm use 1.8.7 --default
#or just for a subdirectory:
cd path_for_zena_apps
rvm use 1.8.7-p??? --rvmrc

# Finally, install the rubygems manager using rvm:
rvm rubygems current

Optional Requirements

Upload Progress Meter

sudo apt-get install libapache2-mod-upload-progress

“math” Brick

Beautiful formulas

apt-get install texlive ghostscript

“worker” Brick

Background processes
Needed for
  • upload progress???
  • delayed delta indexing of the “sphinx” brick
gem install delayed_job --version=1.8.4

“sphinx” Brick

Full text indexed search.
There is also a (SQL) alternative that does not require sphinx, see Indexing and Searching.

sudo apt-get install sphinxsearch
gem install thinking-sphinx --version=1.3.16 
gem install ts-delayed-delta --version=1.3.16 

Shared Hosting or Managed Server

Dependencies

Automatic Image Resizing

If not installed on your system, and you can’t have it installed to the system, you may install it into your user account:

$ wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
$ tar xzf ImageMagick.tar.gz
$ cd ImageMagick-*/
$ ./configure --without-perl --without-magick-plus-plus --prefix=$HOME/local
$ make && make install

Ruby Environment

To avoid installing large amounts of ruby documentation, add to ~/.gemrc :

install: --no-rdoc --no-ri
update:  --no-rdoc --no-ri

To avoid using too much CPU for installation tasks, add to ~/.bashrc :

alias gem="nice -n19 gem"

and to ~/.profile :

source "$HOME/.bashrc"

If your host has ruby 1.8 installed, also add to ~/.profile :

# enable user's own ruby installations, keeping all stuff below $HOME/.gem
export PATH="$HOME/bin:$HOME/.gem/ruby/1.8/bin:$PATH"
export GEM_PATH="$HOME/.gem/ruby/1.8:$( gem env gempath )"
export GEM_HOME="$HOME/.gem/ruby/1.8"

# Disabled for now, because using system libs caused undefined method error.
#export RUBYLIB="$HOME/.gem/ruby/1.8/lib:/usr/local/lib/site_ruby/1.8:/usr/lib/ruby/1.8"

# avoid to forget that extra parameter: ruby -rubygems prog_that_uses_gems
export RUBYOPT=rubygems

export RAILS_ENV=production

Now log out an in again, or load the newly configured environment manually before continuing:

source ~/.profile

If ruby 1.8 is not installed on your system, and you can’t have it installed to the system, follow the generic rvm instructions.

Optional Brick Requirements

Full Text Search Indexing

If sphinxsearch is not installed on your system, and you can’t have it installed to the system:

wget http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz
tar xzf sphinx*.tar.gz
cd spinx-0.9.9

./configure
# on snow leopard this would be:
# LDFLAGS="-arch x86_64" ./configure --prefix=/usr/local --with-mysql=/usr/local/mysql

make && sudo make install

Then install the gems as in the generic instructions above.

Own Server Deployment

To start, you may install a bare-bone debian linux system, install and configure a webserver (apache), database (mysql), security tools etc. Also have a look into the capistrano commands provided with zena.

If anything goes wrong, you can ask the mailing-list or request support from teti.ch.

Once the requirements are met, you can continue with Getting Started.