Version at: 01/02/2015, 18:16 vs. version at: 05/02/2015, 22:17
11# How to Install Tatoeba
22
33Introduction
44---------------
55
66Unless you are a Windows user, we recommend that you use [IMOUTO](https://github.com/Tatoeba/admin) to install Tatoeba so that you do not have to configure everything manually.
77
88If you are a Windows user or if for some reason you have issues with IMOUTO, you can still try to set things up manually. This article will try to guide you in doing that.
99
1010
1111Required tools
1212------------------
1313
1414You will need to install the following:
1515
1616* Apache
1717* PHP 5.3
1818* MySQL
1919* Git client
2020
2121#### Windows users
2222
2323* [XAMPP](http://www.apachefriends.org/en/xampp-windows.html) will do the trick for Apache/PHP/MySQL. But you may need to use version **1.7.7** of XAMPP rather than the latest version, because Tatoeba currently uses PHP 5.3.
2424* You can use [Github for Windows](https://windows.github.com/) as your Git client.
2525
2626#### Mac or Linux users
2727
2828* [XAMPP](http://www.apachefriends.org/en/xampp.html) works, too.
2929
3030
3131Source code
3232--------------
3333
3434Clone our [Git repository](https://github.com/Tatoeba/tatoeba2).
3535
3636 git clone https://github.com/Tatoeba/tatoeba2.git
3737
3838Virtual host
3939---------------
4040
4141If you already have some other websites set up on your machine, you will need to set up a virtual host. The point is that instead of going to something like **http://localhost/tatoeba2**, you go to some custom URL. I personally use **http://tatoeba.dev/**.
4242
4343The reason is because CakePHP will not handle the URL rewriting properly if you try to browse through a subdirectory. You will get some error saying something like "The action tatoeba2 is not defined in controller PagesController".
4444
45If you don't know how to set up a virtual host, you should be able to find tutorial by googling it. Here are some links:
45If you don't know how to set up a virtual host, you should be able to find tutorial by googling it. Here are some links.
4646
47* On Mac using XAMPP:
48[http://f6design.com/journal/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/](http://f6design.com/journal/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/)
49* On Windows 7 using XAMPP:
50[http://austinpassy.com/tutorials/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/](http://austinpassy.com/tutorials/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/)
47On Mac using XAMPP:
48
49* [http://f6design.com/journal/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/](http://f6design.com/journal/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/)
50
51On Windows using XAMPP:
52
53* [http://sawmac.com/xampp/virtualhosts/](http://sawmac.com/xampp/virtualhosts/)
54* [http://austinpassy.com/tutorials/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/](http://austinpassy.com/tutorials/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/)
55* [https://www.youtube.com/watch?v=n9BB_-VLoaY](https://www.youtube.com/watch?v=n9BB_-VLoaY)
5156
5257
5358Create the config files
5459--------------------------
5560
5661### core.php
5762
5863Copy the file `app/config/core.php.template` and name it `core.php`.
5964
6065Make sure you have the search and autotranscription disabled.
6166
6267 Configure::write('Search.enabled', false);
6368 Configure::write('AutoTranscriptions.enabled', false);
6469
6570
6671### database.php
6772
6873Copy the file `app/config/database.php.template` and name it `database.php`.
6974
7075In the file `app/config/database.php`, set your login, password and database in the $default array.
7176
7277 var $default = array(
7378 'driver' => 'mysql',
7479 'persistent' => false,
7580 'host' => 'localhost',
7681 'login' => 'root',
7782 'password' => 'somepassword',
7883 'database' => 'tatoeba',
7984 'prefix' => '',
8085 'encoding' => 'utf8'
8186 );
8287
8388You don't have to worry about the rest of the file at this stage.
8489
8590
8691
8792Database
8893-------------------
8994
9095### Create the database
9196
9297First, create the database. Make sure the name you use here is the name you've set in `app/core/database.php`. I'll name it `tatoeba`.
9398
9499 CREATE DATABASE tatoeba
95100 USE tatoeba
96101
97102### Create the tables and import the data
98103
99104#### From Trang's database
100105
101106The easiest solution is to download the copy of [Trang's local database](https://dl.dropboxusercontent.com/u/953908/tatoeba/tatoeba_database.sql). It contains data from 2010, that is around 600k sentences.
102107
103108You can import the database with the command:
104109
105110 mysql -u username -p database_name < tatoeba_database.sql
106111
107112All the passwords have been replace so you will be able to log in with the password `123` on any login.
108113
109114#### From the scripts in docs/database
110115
111116Another solution is to execute all the scripts in this order:
112117
113118* scripts in `docs/database/tables`
114119* scripts in `docs/database/triggers`
115120* scripts in `docs/database/import`
116121
117122From there you will be able to log in with `123456` with one of the following usernames:
118123
119124* admin
120125* corpus_maintainer
121126* advanced_contributor
122127* contributor
123128* inactive
124129* spammer
125130
126131
127132Other things you may have to configure
128133----------------------------------------------
129134    
130135### tmp folder writable
131136
132137Make sure your `/app/tmp/cache` is writabe as well as any folder in it (models, persistent, views).
133138
134139### thread_stack for XAMPP on a Mac
135140
136141You'll need to up the default thread_stack from 64K to 256K.
137142`/Applications/XAMPP/xamppfiles/etc/my.cnf`
138143`thread_stack = 256K`
139144
140145### short_open_tag = On
141146
142147Make sure `<?` is allowed as an open tag. In your `php.ini`, check that you have:
143148
144149 short_open_tag = On
145150
146151Other Things to Install
147152--------------------------
148153
149154These can be ignored for local development of the code, but need to be installed in order to get the app fully operational.
150155
151156* imagick (for resizing images for profile avatars)
152157* Sphinx search engine
153158* Furigana
154159* autocompletion for tags is based on suggestd (TODO put link an explanation on how to compile/use it)
155160* for Chinese/Cantonese the transliteration is generated by sinoparserd (TODO add more explanation)
156161* language autodetection is based on tatodetect
diff view generated by jsdifflib

Version at: 01/02/2015, 18:16

# How to Install Tatoeba

Introduction
---------------

Unless you are a Windows user, we recommend that you use [IMOUTO](https://github.com/Tatoeba/admin) to install Tatoeba so that you do not have to configure everything manually.

If you are a Windows user or if for some reason you have issues with IMOUTO, you can still try to set things up manually. This article will try to guide you in doing that.


Required tools
------------------

You will need to install the following:

* Apache
* PHP 5.3
* MySQL
* Git client

#### Windows users

* [XAMPP](http://www.apachefriends.org/en/xampp-windows.html) will do the trick for Apache/PHP/MySQL. But you may need to use version **1.7.7** of XAMPP rather than the latest version, because Tatoeba currently uses PHP 5.3.
* You can use [Github for Windows](https://windows.github.com/) as your Git client.

#### Mac or Linux users

* [XAMPP](http://www.apachefriends.org/en/xampp.html) works, too.


Source code
--------------

Clone our [Git repository](https://github.com/Tatoeba/tatoeba2).

    git clone https://github.com/Tatoeba/tatoeba2.git

Virtual host
---------------

If you already have some other websites set up on your machine, you will need to set up a virtual host. The point is that instead of going to something like **http://localhost/tatoeba2**, you go to some custom URL. I personally use **http://tatoeba.dev/**.

The reason is because CakePHP will not handle the URL rewriting properly if you try to browse through a subdirectory. You will get some error saying something like "The action tatoeba2 is not defined in controller PagesController".

If you don't know how to set up a virtual host, you should be able to find tutorial by googling it. Here are some links:

* On Mac using XAMPP:
[http://f6design.com/journal/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/](http://f6design.com/journal/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/)
* On Windows 7 using XAMPP:
[http://austinpassy.com/tutorials/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/](http://austinpassy.com/tutorials/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/)


Create the config files
--------------------------

### core.php

Copy the file `app/config/core.php.template` and name it `core.php`.

Make sure you have the search and autotranscription disabled.

    Configure::write('Search.enabled', false);
    Configure::write('AutoTranscriptions.enabled', false);


### database.php

Copy the file `app/config/database.php.template` and name it `database.php`.

In the file `app/config/database.php`, set your login, password and database in the $default array.

    var $default = array(
        'driver' => 'mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'root',
        'password' => 'somepassword',
        'database' => 'tatoeba',
        'prefix' => '',
        'encoding' => 'utf8'
    );

You don't have to worry about the rest of the file at this stage.



Database
-------------------

### Create the database

First, create the database. Make sure the name you use here is the name you've set in `app/core/database.php`. I'll name it `tatoeba`.

    CREATE DATABASE tatoeba
    USE tatoeba

### Create the tables and import the data

#### From Trang's database

The easiest solution is to download the copy of [Trang's local database](https://dl.dropboxusercontent.com/u/953908/tatoeba/tatoeba_database.sql). It contains data from 2010, that is around 600k sentences.

You can import the database with the command:

    mysql -u username -p database_name < tatoeba_database.sql

All the passwords have been replace so you will be able to log in with the password `123` on any login.

#### From the scripts in docs/database

Another solution is to execute all the scripts in this order:

* scripts in `docs/database/tables`
* scripts in `docs/database/triggers`
* scripts in `docs/database/import`

From there you will be able to log in with `123456` with one of the following usernames: 

* admin
* corpus_maintainer
* advanced_contributor
* contributor
* inactive
* spammer


Other things you may have to configure
----------------------------------------------
	
### tmp folder writable

Make sure your `/app/tmp/cache` is writabe as well as any folder in it (models, persistent, views). 

### thread_stack for XAMPP on a Mac

You'll need to up the default thread_stack from 64K to 256K.
`/Applications/XAMPP/xamppfiles/etc/my.cnf`
`thread_stack = 256K`

### short_open_tag = On

Make sure `<?` is allowed as an open tag. In your `php.ini`, check that you have:

    short_open_tag = On

Other Things to Install
--------------------------

These can be ignored for local development of the code, but need to be installed in order to get the app fully operational.

* imagick (for resizing images for profile avatars)
* Sphinx search engine
* Furigana
* autocompletion for tags is based on suggestd (TODO put link an explanation on how to compile/use it)
* for Chinese/Cantonese the transliteration is generated by sinoparserd (TODO add more explanation)
* language autodetection is based on tatodetect 

version at: 05/02/2015, 22:17

# How to Install Tatoeba

Introduction
---------------

Unless you are a Windows user, we recommend that you use [IMOUTO](https://github.com/Tatoeba/admin) to install Tatoeba so that you do not have to configure everything manually.

If you are a Windows user or if for some reason you have issues with IMOUTO, you can still try to set things up manually. This article will try to guide you in doing that.


Required tools
------------------

You will need to install the following:

* Apache
* PHP 5.3
* MySQL
* Git client

#### Windows users

* [XAMPP](http://www.apachefriends.org/en/xampp-windows.html) will do the trick for Apache/PHP/MySQL. But you may need to use version **1.7.7** of XAMPP rather than the latest version, because Tatoeba currently uses PHP 5.3.
* You can use [Github for Windows](https://windows.github.com/) as your Git client.

#### Mac or Linux users

* [XAMPP](http://www.apachefriends.org/en/xampp.html) works, too.


Source code
--------------

Clone our [Git repository](https://github.com/Tatoeba/tatoeba2).

    git clone https://github.com/Tatoeba/tatoeba2.git

Virtual host
---------------

If you already have some other websites set up on your machine, you will need to set up a virtual host. The point is that instead of going to something like **http://localhost/tatoeba2**, you go to some custom URL. I personally use **http://tatoeba.dev/**.

The reason is because CakePHP will not handle the URL rewriting properly if you try to browse through a subdirectory. You will get some error saying something like "The action tatoeba2 is not defined in controller PagesController".

If you don't know how to set up a virtual host, you should be able to find tutorial by googling it. Here are some links.

On Mac using XAMPP:

* [http://f6design.com/journal/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/](http://f6design.com/journal/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/)

On Windows using XAMPP:

* [http://sawmac.com/xampp/virtualhosts/](http://sawmac.com/xampp/virtualhosts/)
* [http://austinpassy.com/tutorials/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/](http://austinpassy.com/tutorials/setting-up-virtual-hosts-wordpress-multisite-with-xampp-on-windows-7/)
* [https://www.youtube.com/watch?v=n9BB_-VLoaY](https://www.youtube.com/watch?v=n9BB_-VLoaY)


Create the config files
--------------------------

### core.php

Copy the file `app/config/core.php.template` and name it `core.php`.

Make sure you have the search and autotranscription disabled.

    Configure::write('Search.enabled', false);
    Configure::write('AutoTranscriptions.enabled', false);


### database.php

Copy the file `app/config/database.php.template` and name it `database.php`.

In the file `app/config/database.php`, set your login, password and database in the $default array.

    var $default = array(
        'driver' => 'mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'root',
        'password' => 'somepassword',
        'database' => 'tatoeba',
        'prefix' => '',
        'encoding' => 'utf8'
    );

You don't have to worry about the rest of the file at this stage.



Database
-------------------

### Create the database

First, create the database. Make sure the name you use here is the name you've set in `app/core/database.php`. I'll name it `tatoeba`.

    CREATE DATABASE tatoeba
    USE tatoeba

### Create the tables and import the data

#### From Trang's database

The easiest solution is to download the copy of [Trang's local database](https://dl.dropboxusercontent.com/u/953908/tatoeba/tatoeba_database.sql). It contains data from 2010, that is around 600k sentences.

You can import the database with the command:

    mysql -u username -p database_name < tatoeba_database.sql

All the passwords have been replace so you will be able to log in with the password `123` on any login.

#### From the scripts in docs/database

Another solution is to execute all the scripts in this order:

* scripts in `docs/database/tables`
* scripts in `docs/database/triggers`
* scripts in `docs/database/import`

From there you will be able to log in with `123456` with one of the following usernames: 

* admin
* corpus_maintainer
* advanced_contributor
* contributor
* inactive
* spammer


Other things you may have to configure
----------------------------------------------
	
### tmp folder writable

Make sure your `/app/tmp/cache` is writabe as well as any folder in it (models, persistent, views). 

### thread_stack for XAMPP on a Mac

You'll need to up the default thread_stack from 64K to 256K.
`/Applications/XAMPP/xamppfiles/etc/my.cnf`
`thread_stack = 256K`

### short_open_tag = On

Make sure `<?` is allowed as an open tag. In your `php.ini`, check that you have:

    short_open_tag = On

Other Things to Install
--------------------------

These can be ignored for local development of the code, but need to be installed in order to get the app fully operational.

* imagick (for resizing images for profile avatars)
* Sphinx search engine
* Furigana
* autocompletion for tags is based on suggestd (TODO put link an explanation on how to compile/use it)
* for Chinese/Cantonese the transliteration is generated by sinoparserd (TODO add more explanation)
* language autodetection is based on tatodetect 

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.