# Instiki Installing on Shared Hosts

## Configuration

Depending on your hosting provider, in a shared hosting environment you might have to add ENV['RAILS_ENV'] ||= 'production' to the top of config/environment.rb to ensure that the application runs in production mode.

## Building itex2MML

Some shared hosting providers don’t provide compilers because they are very sensitive about system resources. You may still be able to compile the itex2MML library for the web host (target machine) if you have access to another machine (build machine) of the same architecture (i.e., processor type: i686, x86_64, etc.) that is running the same version of glibc. This procedure allows for the target and build machines to be running different versions of libruby. If they are running the same version, you may skip to step 2.

1. Copy the equivalent of /usr/lib/libruby.so from the target machine to the itexToMML/itex-src directory on the build machine. Edit the Makefile by adding -L. to the build command for the ruby target:

ruby:   itex2MML_ruby.o y.tab_ruby.o lex.yy_ruby.o
$(RUBY_LD) itex2MML_ruby.o y.tab_ruby.o lex.yy_ruby.o -L. -L$(RUBYLIBDIR) $(LIBRUBYARG) -o itex2MML.$(DYLIB_EXT)

The extra -L. tells the compiler to look in the current directory for libraries. It will find the Ruby library from the target machine there.

Instead of copying the library, another option is to link against libruby-static.a instead by changing \$(LIBRUBYARG) to -lruby-static (or -lruby1.8-static on Ubuntu edgy).

2. Now build and test the library on the build machine:

make ruby && make test_ruby

You will need two files from this process: the shared library,itex2MML.so, and the ruby wrapper, itextomml.rb.

1. Place the two files in the lib directory of your Instiki installation on the target machine. Test that the library works by running ruby lib/itextomml.rb.

Now, you should have itex2MML support for Instiki on the target machine.

## Using MySQL

Using SQLite is great for local installations, but if you have access to a MySQL server, you may choose to use that instead. Create the database and modify config/database.yml as follows, using the values for your host:

production:
port: 3306
ruby bundle exec rake db:migrate