About Connotea

Connotea is a free online reference management service for scientists, researchers, and clinicians, created in December 2004 by Nature Publishing Group. It is similar to other social bookmarking tools like CiteULike and del.icio.us, where users bookmark their favorite pages in a web based tool. However, Connotea is mainly aimed at scientists, researchers, and clinicians.

Installation issues

Following installation steps assume that you already have MySQL 5.0+, Apache 2.0+, and Perl 5.8+ installed on your machine. Connotea 1.5+ versions use Memcached, a caching system to improve performance by alleviating database load.

Prerequisites

Verify that you have required MySQL, Apache, and Perl installed on your machine.

Connotea source directory structure

The Connotea source directory contains many file and sub directories.

  • html sub-directory - should be accessible to apache.
  • site sub-directory - In the Connotea 1.5+ versions, html sub-dir has been renamed to site.
  • README file - provides some directive to be included in the Apache configuration file.
  • config file - has some configuration statements. The database string gives us hint of user that should be created in the mysql database.
  • sql sub-directory- contains schema files to be imported in the !MySQL databases. (Look into the schema.sql file to find out which databases will be created. The db user specified in config file should have the necessary permission on these databases. )
  • Bibliotech sub-directory - contains perl modules used for Connotea. Note that these are different from what you would install from CPAN. In short, these are Connotea specific modules.

Database

We will need four databases for the Connotea installation.

  • bibliotech : Main database for the connotea installation. Create a database called bibliotech and make the necessary changes for database connection in the bibliotech.conf file.
     create database bibliotech;
     mysql -uroot -p < /path/to/connotea-source/sql/schema.sql 
     GRANT ALL ON bibliotech.* TO 'username' IDENTIFIED BY 'password';   
    
  • bibliotech_search : Used for full text search.
        cd sql
        perl mkschema_search < schema.sql > schema_search.sql
        create database bibliotech_search;
        mysql -uroot -p < /path/to/connotea-source/sql/schema_alter.sql 
        GRANT ALL ON bibliotech.* TO 'username' IDENTIFIED BY 'password';   
    
  • clicks : Used by clicks module. Create a database called clicks and also include the necessary connection information in the bibliotech.conf file.
     create database clicks;
     mysql -uroot -p < /path/to/connotea-source/sql/clicks.sql 
     GRANT ALL ON bibliotech.* TO 'username' IDENTIFIED BY 'password';   
    
  • conwiki : Used by CGI wiki module. You will need to enter the database name, user name, password, and host information while installing the Perl module.
        CREATE DATABASE conwiki;
        GRANT ALL ON conwiki.* TO conwiki@localhost IDENTIFIED BY 'password';
    

The schema files are located in the sql directory in the Connotea source.

Perl

Install mod_perl module for apache. Create a perl directory /var/www/perl on CentOS (/srv/www/perl-lib on Suse). The Connotea specific modules which are located in the Bibliotech directory need to placed in this perl directory. These modules are dependent upon many other modules which should be installed using CPAN. Some of these modules could not be installed using CPAN. To solve this problem I used yum. For this we need to add cpan repository to yum and install cpan2rpm tool. This process was followed from FreeSide installation guide. As they are not Connotea specific, they have been documented on a separate page here.

Go to a cpan shell for installing these modules by typing,

 LANG=C perl -MCPAN -e shell 

Once in cpan shell, install following modules by typing install XXX::YYY . Listed below are the modules mentioned in the Connotea documentation. Follow the sequence below to resolve any dependency issues.

Apache2
Apache::Const
Apache::File (installed through yum)
IO::String
XML::Writer (installed through yum)
XML::Twig (installed through yum)
SOAP::Lite (installed through yum)
Pod::Man
Bio::Biblio::IO (force)
CGI
Class::DBI
Config::Scoped
Data::Dumper
Date::Parse
DateTime (installed through yum)
DateTime::Set (installed through yum)
DateTime::Format::ISO8601
DateTime::Format::MySQL
DateTime::Incomplete
Digest::MD5
Encode (force)
Fcntl (installed through yum)
File::Temp
File::Touch
FindBin (installed through yum)
HTML::Entities
HTML::Sanitizer (force)
IO::File
LWP::UserAgent
List::Util
Net::Daemon::Log (force)
Netscape::Bookmarks
Parse::RecDescent
RDF::Core
SQL::Abstract
Set::Array
Storable
Time::HR
URI
URI::Escape
URI::Heuristic
URI::OpenURL
URI::QueryParam
Want
XML::Element
XML::LibXML (installed through yum)
XML::RSS
YAML(installed through yum)
CGI::Wiki (see Note below)

# not required for core web service service:
Apache::Emulator
Text::BibTeX

Notes:

  • The CGI::Wiki module tries to access database through /var/lib/mysql/mysql.sock socket. In our @lab installation there are two MySQL installations. The MySQL 5.0 version which is used for Connotea installation is installed in the /usr/local/mysql directory. It creates a socket within that directory by default. However, CGI::Wiki will try to access it through /var/lib/mysql/mysql.sock socket and will give an error. I couldn't find any way to tell CGI::Wiki to look for socket in another location. Eventually, I ended up starting MySQL server by creating a socket where CGI::Wiki was looking.
  • You may get warning message like 'Use of uninitialized value in pattern match (m//) at /var/www/perl/Bibliotech/Config.pm line 59.', while starting apache. For this add if-defined condition above this line.
    if(defined $var)
    { 
      line #59
    }
    
  • In addition to the above modules, I had to install following modules as well. The Apache would not start giving some error message related to missing Perl module, which was used in Connotea code.
    Lingua::EN::NameParse
    HTTP::OAI::UserAgent
    Text::CSV
    Cache::Memcached
    Template
    Authen::Captcha (required for Captcha - so if you comment out CAPTCHA code in the bibliotech.conf file, you may not need this)
    IPC::Run
    JSON
    
    

Apache

Create a new directory under the default DocumentRoot folder. Copy all files from the 'site/default' directory in the connotea to this new directory. In our @lab installation a new directory called 'bibliotech' was created under the DocumentRoot. Place the following directives in the configuration file, httpd.conf. Note that PerlModule directive is not allowed within the Directory directive. Of course, one can change the /bibliotech in the Location directive to other preferred name.

PerlModule Bibliotech::Apache
PerlModule Bibliotech::AuthCookie
<Location /bibliotech>
  SetHandler perl-script
  PerlHandler Bibliotech::Apache
  PerlAuthenHandler Bibliotech::AuthCookie::authen_handler
  AuthType basic
  require valid-user
</Location>

You may need to edit perl.conf file for loading perl modules and executing perl scripts. On Centos machine this file is located in the /etc/httpd/conf.d/ directory. The directory you specify in this configuration file is where you should place Connotea specific modules. In this case, these Connotea specific modules are located in the /var/www/perl/ directory.

Alias /perl /var/www/perl
<Directory /var/www/perl>
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    Options +ExecCGI
</Directory>

Memcached

Memcached has a dependancy on libevent. Please follow instructions below to install libevent.

curl -O http://www.monkey.org/~provos/libevent-1.1a.tar.gz
tar zxf libevent-1.1a.tar.gz
cd libevent-1.1a
./configure
make
make install
cd ..
mv libevent-1.1a.tar.gz ../installed/

To install memcached use following instructions.

curl -O http://www.danga.com/memcached/dist/memcached-1.1.12.tar.gz
tar zxf memcached-1.1.12.tar.gz
cd memcached-1.1.12
./configure
make
make install
mv memcached-1.1.12.tar.gz ../installed

Use following command to start the memcached server. The -m options indicates max. memory to be used by the server, -p indicates port number, -u indicates identity of the user. For more options check 'man memcached'.

memcached -d -u nobody -m 512 127.0.0.1 -p 11211

Sometimes memcached can't find libevent.so file. The file is located in the /usr/local/lib/ directory. Make sure that this directory is included in your library path.

echo $LD_LIBRARY_PATH

If you do not see /usr/local/lib in this path, then add it to the library path.

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH

If you get error message like "error while loading shared libraries: libevent.so : No such file or directory", then you may need to create symbolic link between libevent.so and the libevent.so.{version#} files. I had to execute following command. It may vary for other installations.

ln -s /usr/local/lib/libevent-1.1a.so /usr/local/lib/libevent-1.1a.so.1.0.2

References: