Installing a Cyclotis server

The server part of Cyclotis is a set of Perl/PSGI web applications, Perl and SQL scripts, based on PostgreSQL version 8.4 or later. Any operating system (including linux, BSD, or maybe Windows) which can host PostgreSQL 8.4 (or recommended, almost 9.2) and Perl 5.10 should be able to host a Cyclotis server, but it has mainly be tested on linux distributions Red Hat Entreprise 6 and 7, and Debian 8 or 9.

In this tutorial we will try to install our tools in an existing distribution. Installation of dependancies, including Postgres, are minimally detailed, as it can depend on your distribution. Installation of linux distribution

  • Install Postgres : warning, in some distributions (Redhat based) the package named "postgres" refers to the client; here we will also need the server and the contrib package
Debian Red Hat, Fedora, Centos
apt-get install postgresql postgresql-client postgresql-client-common postgresql-common postgresql-contrib yum install postgresql postgresql-server postgresql-contrib

Normally, this should create the first Postgresql instance (with only template database). If not, see reference about Postgres's "initdb" script. It is also possible to use one or more distinct instances of Postgres server : in Debian this is easier with pg_createcluster, while in other distributions it is to be done manually. For this tutorial, we will remain with default server.

  • Install Perl : in most linux or bsd distributions, the core interpreter is already installed, and unless your distribution was made before 2010, you probably have a sufficient version. Also add the following Perl packages:
    • DBI (generic access to databases)
    • DBD::Pg (the Postgres-specific Perl driver)

To do so:

Debian Red Hat, Fedora, Centos
apt-get install libdbi-perl libdbd-pg-perl yum install perl-DBD-Pg

One difficulty with our server is that the creation of Cyclotis/Postgresql database has to be done with Postgres's admin rights (the ones of the postgres user, not from the Unix root!), but only for the initial creation, not to add memories later. For that tutorial we will put all memories in the same Postgres database, to make it simpler.

  • Configure Postgres's user policy, editing pg_hba.conf (probably in /var/lib/pgsql/data or /var/lib/postgresql/data) : for this tutorial we will accept local and distant (TCP/IP) connections, and use "trust" to avoid passwords.
  • Create postgres users tb-admin and tb-user : createuser tb-admin; createuser tb-user.
    The first one will create and delete memories, the second will use them
  • Give to Unix "postgres" user execution rights to the SQL scripts (you can remove later): chown a+x db/*.pl
  • Connect as postgres (su postgres), without changing environment.
  • Create the catalog (the database, if you prefer): cd SQL/db; perl dbcreator.pl create-db postgres#tb-admin@/MyCyclotis (in this syntax,we create database "MyCyclotis" which will be managed by user "tb-admin". User "postgres" is only used during creation. Being connected as "postgres", the server will not require password.
  • Exit postgres user, not used anymore (exit)

Now we can create a first memory:

  • Create the memory: cd SQL/db; perl dbcreator.pl create-table tb-admin@/MyCyclotis MyFirstMemory (for db, same syntax as before except that we do not need "postgres" user anymore; Then the name of the memory to be created).

At this step it should already be possible to use the memory by a client (using Trados or OmegaT) if it is in the same computer as the server: for example, for OmegaT, you can take one of the sample property files given with the plugin, change the host to "localhost" and the database to "MyFirstMemory". If you accepted TCP/IP connections in previous step, this should also work for OmegaT being on a distinct server.

You can continue to create memories with the SQL scripts, but we know that this is not easy. Instead, you can download web creator : this is a small web application, based on perl/Dancer, not especially beautiful but doing all what is needed.

Install Perl/Dancer framework : in Debian and Red-Hat based distributions, package "dancer(Perl)" or "perl-dancer" are available. Else you an use the CPAN.

Once installed, extract the archive and open the config.yml file:

  • First, configure which database to be connected to; for this tutorial, probably "localhost", port "5432", catalog "MyCyclotis", user "tb-admin" without password.
  • Then, where the SQL scripts are located. Be sure that the user which runs the web application has execution rights to these scripts, almost to dbcreator.pl
  • For the simplicity of this tutorial, let's remove any other parameter, including "parent", "possible-values", "list", etc: for the moment, we create a memory per project when needed, that's all. You can learn later about how the application can be more customized
  • Now you can start the application: perl web-creator-html.pl

    The server will tell you which port it is listening on. Be sure this port is opened by your firewall, if not stop the application and start it again with another port (using -p with port number: perl web-creator-html.pl -p 8080).
  • And finally open your browser (http://your-host:your-port/) and you should see list of existing memories, probably only one for the moment. In this application you can create or delete memories at any moment : this is for immediate use, not for highly secured server!

We are perfectly aware that all of this is not easy. We try to make it progressively simpler, but that is an hard work (developers, if you have ideas...). In the meantime, if it is too difficult to you, use our already configured SaaS server instead!

Add new comment