Content translation/cxserver/Setup

Content Translation Server
If you want to do an anonymous checkout:

Or if you plan to hack CXServer, then please follow the Gerrit 'getting started' docs and use an authenticated checkout url instead, such as:

Nodejs
Install nodejs 0.8 or 0.10. When you are using Ubuntu and depending on OS version you will not end up with the most recent version of nodejs please read this first before you proceed:

On Ubuntu Server 12.04 LTS instead do (to get v0.10.x) :

For other systems, see:
 * http://nodejs.org/download/
 * https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

JS dependencies
Install the JS dependencies. Run this command in the cxserver directory:

Installation
To install language pair,

Where xxx and yyy are two different languages.

Installation
Apertium can be install using apt-get or compiling source packages. apt-get will fetch older version than compiling from source.

Language pair for Apertium can be installed as package using,

Configuration
We've not yet decided which approach we will take for Apertium configuration. APY is considered one of the option.

Server Configuration
An example configuration file is given as config.example.js. Rename that file to config.js and make your changes. Then restart the server.

As a cxserver command
Following step is to be performed only once. You might have to use 'sudo'.

Subsequently, just use following to start the server.

Then browse to http://localhost:8080/. You'll see the server playground page.

Running it in secure mode (https)
You need to provide SSL certificate to start the server over secure mode.

As a cxserver command
Following step is to be performed only once. You might have to use 'sudo'.

Subsequently, just use following to start the server.

Then browse to https://localhost:8080/. You'll see the server playground page.

Debugging
To run the ContentTranslation server:

It will open Chrome developer tools with the ContentTranslation source code. You can debug the code just like a web application. You can also edit the code and save from the debugger.

Starting cxserver automatically
There are many ways to start services automatically, consult your server's operating system documentation.

upstart
On Ubuntu and other operating systems using Upstart, one approach is

And, use following upstart script:

To start cxserver,

To stop cxserver,

systemd
On recent versions of Debian, Fedora and other operating systems using systemd, use a cxserver.service unit file similar to the following template (modify the file paths as appropriate) and place file at /lib/systemd/system/ directory.

The optional EnvironmentFile directive above can specify the path to a file similar to the following template. Place this file as /etc/cxserver/cxserver.env as mentioned in cxserver.service file above.

To start cxserver,

To stop cxserver,

TODO: Fix /usr/sbin/cxserver

Configuration
1. Configure varnish http accelerator port:

edit /etc/default/varnish

Example configuration to run varnish on port 8000

2. Configure the varnish default backend:

edit /etc/varnish/default.vcl

3. Restart the varnish:

Make sure you are running cxserver nodejs server on port 8080 - the backend configuration of varnish

127.0.0.1:8000 will be your server URL with varnish 127.0.0.1:8080 will be your server URL without varnish

4. Configure cxclient's wgContentTranslationServerURL to 127.0.0.1:8000

Extensions dependencies
Content translation extension requires following extensions as dependencies.


 * 1) BetaFeatures
 * 2) CLDR
 * 3) EventLogging