Talia Installation
This is how you can install the "generic" version of Talia into a Rails application. The instructions are still work in progress, so let us know if something doesn't work for you. The first part of this guide is intended to get you going quickly, while in the second part you will find an assortment of (possibly outdated, take care) installation hints that may be useful for troubleshooting.
In theory the installation should be a matter of
> gem install talia_core
...
> cd rails_application_to_use
> script/generate talia_base
...
> script/configure_talia
Quick Start
The examples here assume that you will run Talia using JRuby. In theory you can also use the native Ruby version, but you will have to do the RDF store configuration yourself for now.
- First step: Install JRuby
- Second step: Install the talia_core gem
- Third step: Configure the talia_core
Install JRuby
For now, follow the instructions on the JRuby page to install it. In most cases it will be best if you have the JRuby bin directory in your path, so that all your commands will run with JRuby.
Installing is easy: Just download the package, unpack it and set your system PATH to point to the bin directory. JRuby 1.4. and higher shouldn't have any known bugs that affect Talia any more.
OR: Install JRuby using rvm:
In many cases, the easiest method for having different versions of ruby is rvm. Just follow the instructions on their homepage to install the tool, then do:
rvm install jruby rvm --default jruby
git
Some configuration and installation scripts expect git to be installed. This should be very easy, just follow the instructions on their page.
Install the talia_core gem
The talia gem is served through gemcutter. With recent versions of gem, everything should work out of the box. If you have trouble installing the gems, though, try the following:
> gem install gemcutter > gem tumble
Install the talia_core gem, it should install all the dependencies automatically:
> gem install talia_core
JDBC sql driver
Talia still includes the crappy "native" mysql adapter that was thrown out of Rails in version 2.2. Therefore you may use the "mysql" adapter even in JRuby. However, if you use JRuby it will be much faster and safer if you install the jdbc-based adapter:
gem install activerecord-jdbcmysql-adapter
Create the application
If you want to use Talia inside a Rails application (which you normally will), you may want to install rails if you haven't already:
Note: at the time of writing the suggested rails version is 2.3.5 for talia gem (v. 0.5.4), more recent versions may not work as expected.
gem install rails -v 2.3.5
For this you will need a rails application, preferably a fresh one. You can just create it using the rails tool - for extra convenience try to use the -r option to give the path to your jruby installation (doesn't always work for me, though).
rails -r /usr/bin/jruby my_app
cd my_app
Now it's time to install the talia-specific parts into your app:
> jruby script/generate talia_base ...
The generator will install all the files needed for Talia and modify your routes.rb file to make the default URLs work.
Configuring Talia
Talia comes with a little script that will assit you in configuring the application. It only covers the standard situations, though. And note that, before running this script, you should make sure that your environment points correctly at your jruby installation (if you use jruby).
jruby script/configure_talia ... MySQL sock file (/var/mysql/mysql.sock):
At this point, enter the path to the mysql.sock file on your system. Then enter all the connection parameters for your database:
Enter the mySQL root pasword: Enter the mySQL username for your application. This account will be created automatically. mySQL account for the application: talia Enter the password for this account: talia Enter a database prefix (if you have more than one installation): woot_ Do you want to create the databases now? (yn) y
Say "y" to create the databases. If the were already created before, you may skip this step. You also need to tell Rails and Talia how to connect to the database:
Enter the sql driver you want to use (e.g. jdbcmysql, mysql, ...) [jdbcmysql]:
With JRuby hitting "return" for the jdbcmysql driver is the best bet. You need to have the "activerecord-jdbcmysql-adapter" gem installed to make this work. Otherwise you could try the "mysql" adapter.
The next questions are about the site name and the URL on which your site may be reached:
Enter the site name (it will appear in the window title): Talia XXX Enter the URI for your site: http://localhost:5000/
Be sure to finish the URI off with a slash.
Do you want to use the IIP image server? (yn) n
Talia supports having images served through the IIPImage server, but it is another piece of software that needs configuration. Say "n" if you don't want that feature for a start (and see ConfiguringIipImage if you do).
Configuring the Sesame RDF store:
Enter the sesame backend to use (native|memory|rdbms|http):
You may choose from different backend engines for the Sesame RDF store. If in doubt enter "native" and just hit return on every following question. Otherwise you will need to enter some configuration parameters for the RDF store. (Note that Talia supports RDF stores other than sesame, but you will have to configure them manually).
Enter the directory to store the Sesame RDF databases (return for default): Enter the path to store the data files (return for default): Enter the prefix/URL where static pages will be loaded (return for internal handler): Do you want to write the configuration now? (Overwrites the existing config!) (yn) y
Hit "y" to write the configuration files. The script should take it from there and migrate your databases and import some ontologies.
Congratulations
If you got this far without an error, you should have a "naked" Talia application ready to play with.
Now you can either install the administration backend or try to import some first data.
Specific Installation Issues
Depending on your requirements and your operating system, the installation may also require that you compile some of the needed software yourself. Here you will find some hints on how to resolve problems on specific platforms and for specific modules.
For the Discovery version of Talia, you do not need to follow these instructions. Instead you'll find a complete installation guide at InstallTaliaForDiscoveryPartners.
mysql network
Note that when using the mysql-jdbc-adapter, the system will always use the TCP connection, never the socket. You have to make sure that the TCP connections for mysql is enabled (remove the skip-networking option), and that your hosts.{deny|allow} files do not block the connections to the server.
mysql on Ubuntu
On the version of Ubuntu that we used the mysql socket file is found at /var/run/mysqld/mysqld.sock. However, once you enable the jdbcmysql driver (or the "full" mysql driver) it will use a TCP connection which gave us an error like this:
ERROR 1044 (42000): Access denied for user 'talia'@'localhost' to database 'mysql'
It seemed that the login was not using localhost as the hostname, but the name that was configured for the server. In this case, to resolve the problem do
GRANT ALL ON <database>.* TO '<talia-user>'@'<my-hostname>' IDENTIFIED BY '<password>';
for all talia databases. You can re-run the configure_talia script after that, without creating the databases again.
Redland
Redland is a C-based RDF store, and the only "real" RDF store that works with native Ruby at the moment. Installing it will most likely require you to compile the package, unless you are using a Linux distribution that already provides it. In addition to the RDF store itself you will also need to have the Ruby language bindings for it.
Windows
Maybe difficult. There was one person who compiled it successfully, but as far as we know it was never used for real on this platform.
Debian Linux
It should work with the apt-packages librdf0 and librdf0-ruby
OS X
On OS X the package has to be compiled with the Ruby bindings. You can build Reland using MacPorts, but this has several drawbacks:
First off, the Ruby bindings are not built by default and have to be built directly from the sources. This is not completely true for the most recent version in ports which contain a package for the Redland bindings. But this package still had problems the last time we checked, and it will insist to install all dependencies (like ruby itself) on it's own, even if they are already present by default.
The mysql and the bdb driver is also not built by default if you use ports. You will have to explicitly enable them during the installation (using a "variant"). If you select the mySQL driver, ports will attempt to install it's own version of mySQL, and you cannot use the official binaries for MacOS.
To avoid some of these problems, you can install the Redland store directly from Source:
Installation with bdb (Berkeley db) bindings and Macports BDB:
- The MacPorts? package for bdb is called "db44" (or "dbXX" for other versions)
- Before calling configure do an export CFLAGS="-I/opt/local/include/db44 -I/opt/local/include" and an export LDFLAGS="-L/opt/local/lib/db44 -L/opt/local/lib"
- Now call ./configure and make to create the libraries
- Best to do a make check to see if everything works all right
- Then install and create the bindings
- This assumes that you use db44 and the default MacPorts? paths, otherwise you need to adjust the directory paths.
Installation with mySQL binary on Leopard
- There seems to be a problem with Leopard and the current pre-compiled mySQL distribution. Redland will look for the dynamic library in /usr/local/mysql/lib/mysql instead of /usr/local/mysql/lib. To work around this, you can issue an ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql for the time being.
- Note that the configure script will automatically configure mySQL if it is installed, so the libraries will be broken if you don't have the symlink. If you don't care for the mySQL store, disable it in the configure script.
Talia Installation Process
- Checkout the talia_app out of the git
- Create the tables in the sql database: both for the Rails/db and for Redland, if required
- Adjust the configuration
- Run the migrations
- Run rake globalize:setup to create the translation tables for Globalize
Configuration
You will find example configuration files in the config directory, which have the ending yml.app_example. To use them, you will have to remove the "app_example" from the ending, review the configuration and adapt it to your needs.
Database Setup
If the database user you configured in database.yml has root privileges, you can simply use
rake db:create:all
to create the databases. Otherwise you will need to create them manually. After the databases are created, you can create all tables for the application using
rake db:migrate
SQLite/Constraints
Talia sets up database constraints, which is generally a good idea for any application. However, the migrations will fail on SQLite because it does not support the commands. In this case run the migration with the noconstraints=yes option which will skip the constraints.
Initializing Redland (mysql store)
When the Redland RDF store is used with the mysql backend, the startup will fail unless the database tables for redland are created. To do this run the rake task talia_core:redland_init, which will create the redland tables. You must pass the configuration for the rdf store to this task. It will also work with other redland backends, but it should only be required for the mysql backend. Sample call
rake talia_core:redland_init rdfconf=config/rdfstore.yml
Installing nip2/vips on Mac OS Leopard
To install these packages with MacPorts? you'll need to compile php5. The php5 package must be built with the +apache2 option - which will install the MacPort? apache version (in addition to the one that is included with Leopard by default). After you have built the packages, you should remove the apache2 and php5 packages again.
Installing the IIP server on Mac
This is the explanation for Mac OS X 10.5 Leopard. Note that it is only meant to set up an example server and is not an instruction for production use. It's quick and dirty and there's lot of stuff that's wrong with it - such as the fcgi being in the general document root.
Building the IIP server is explained here. If you use ports for the jpeg/tiff libraries then you should add a few flags to the configure script:
./configure --with-jpeg-includes=/opt/local/include --with-jpeg-libraries=/opt/local/lib --with-tiff-includes=/opt/local/include --with-tiff-libraries=/op/local/lib
You need to put the newly created binary somewhere in the server path:
mkdir /Library/WebServer/Documents/fcgi-bin cp src/iipsrv.fcgi /Library/WebServer/Documents/fcgi-bin/
Apache is already installed, you can start it through the System Preferences -> Sharing -> "Personal Web Sharing". You have to edit the config file
> vi /etc/apache2/httpd.conf # This line needs to be uncommented LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so
Now you will have to update the apache configuration so that the fcgi binary will be picked up. You can make a separate config file, so that it's easier to remove later on:
> vi /etc/apache2/other/fcgi-iip.conf # Set the options on that directory <Directory "/Library/WebServer/Documents/fcgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> # Set the handler AddHandler fastcgi-script fcg fcgi fpl # Initialise the FCGI server - set some default values FastCgiServer /Library/WebServer/Documents/fcgi-bin/iipsrv.fcgi \ -initial-env LOGFILE=/tmp/iipsrv.log \ -initial-env VERBOSITY=2 \ -initial-env JPEG_QUALITY=50 \ -initial-env MAX_IMAGE_CACHE_SIZE=10 \ -initial-env MAX_CVT=3000
Now restart the Apache and you should have your IIP server running at http://localhost/fcgi-bin/iipsrv.fcgi
/usr/sbin/apachectl restart
Attachments
- hpricot-0.8.255-jruby.gem (323.0 KB) - added by daniel 11 months ago.
