The main server component is the CASMACAT web server that runs under Apache and provides the user interface over any Internet Browser.
Download the Source Code
First find a suitable directory for the CASAMACAT code. If you install it as a user, you can place it in your home directory. If you install it as administrator, you may choose something like
In that directory, type:
git clone git://git.assembla.com/matecat_source.git web-server cd web-server git checkout casmacat
You will also need to create additional directories by typing
mkdir downloads chmod o+w downloads mkdir uploads chmod o+w uploads mkdir logs chmod o+w logs
You will find additional installation instructions in the file
INSTALL.txt. It may be more up-to-date and contain more information than the instructions below.
Create a Database
lib/model/casmacat.sql contain the configuration for the database.
You may want to edit these files to change the name of the database, which is by default
matecat_sandbox. If you do so, please change both files.
You will also need to set up a user for the database. There may be a GUI in your Linux distribution to make this easy, otherwise you can call mysql from the command line:
mysql -u root -p mysql> connect mysql; mysql> create user johndoe@localhost identified by 'secretpw'; mysql> create database matecat_sandbox; mysql> grant usage on *.* to johndoe@localhost; mysql> grant all privileges on matecat_sandbox.* to johndoe@localhost;
With user account in place and (possibly edited) configuration files, you can now set up the database:
mysql -u johndoe -p < lib/model/matecat.sql mysql -u johndoe -p < lib/model/casmacat.sql
To complete the setup of the database, you have to create a copy of the web server configuration file
cp inc/config.ini.sample inc/config.ini
and edit it to point to your database installation:
[db] hostname = "127.0.0.1" username = "johndoe" password = "secretpw" database = "matecat_sandbox"
Set up the Web Server
First, you need to create a user account (such as
catuser) and add it to the
www-data group (as root).
useradd -G www-data -p @password@ catuser
Make sure that the Apache web server reads the access file
.htaccess. This may require you to edit the file
/etc/apache2/apache2.conf have the following line not commented out.
Apache needs to be configured to access your CASMACAT web server installation. This is done with a configuration file in
/etc/apache2/sites-available that is linked to from
This configuration file follows the following template:
<VirtualHost @your_ip_address@:80> ServerName matecat.@your domain@ ServerAdmin webmaster@your domain@ DocumentRoot /opt/casmacat/web-server DirectoryIndex index.php index.php3 index.html index.htm index.shtml <Directory /opt/casmacat/web-server/> Options All AllowOverride All Order allow,deny allow from all </Directory> php_flag register_globals off php_flag magic_quotes_gpc off php_flag short_open_tag on LogLevel error ErrorLog /var/log/apache2/casmacat.error.log CustomLog /var/log/apache2/casmacat.log combined ServerSignature Off </VirtualHost>
Ensure that PHP does not use "magic quotes". Edit the file
/etc/php5/apache2/php.ini to include the line
magic_quotes_runtime = Off
Also, Apache needs to have mod_rewrite turned on.
cd /etc/apache2/mods-enabled/ ln -s ../mods-available/rewrite.load .
With all this, you may now restart Apache
If you now point your web browser to your site, you should see the following screen.
Test the Installation
If you want to test your current setup, you can also use a demo CAT server. We currently provide two different demo servers, one provided by the University of Edinburgh and another one provided by the Polytechnic University of Valencia: