Version at: 16/03/2014, 21:55 vs. version at: 19/03/2014, 00:55
11#How to Prepare a Development Environment for Tatoeba Using a Pre-made Virtual Machine
22
33## Installing the VM
44* Grab the vm file [http://mirrors.bouah.net/pub/tatoeba/Tatovm/](http://mirrors.bouah.net/pub/tatoeba/Tatovm/)
55
66* Untar the file:
77
88 * On Windows:
99
1010 * Download both the vbox and the gz file
1111
1212 * Use 7zip [http://www.7-zip.org/] to extract Tatovm.vmdk file from the gz file (using the "Extract here" item from the right-click menu)
1313
1414 * On Linux: use file-roller or from the terminal, type:
1515
1616 tar -xvf vmfile
1717
1818* Get and install VirtualBox [https://www.virtualbox.org/wiki/Downloads]
1919
2020* Load the VM files in VirtualBox:
2121
2222 From the GUI: **Machine -> Add**, then browse to the location of the .vbox file
2323
2424 From the command line: VBoxManage registervm /path/to/vm.vbox
2525
2626## Accessing the VM
2727* The default http port is 8080 and the default SSH port is 4242.
2828
2929* On Windows, you may want to download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) as your SSH GUI.
3030
3131* To SSH into the machine, use the username **tatoeba** and password **tatoeba**:
3232
3333 ssh -p 4242 tatoeba@127.0.0.1
3434
3535* Now you can see the website running in your browser by pointing it to the following address:
3636
3737 127.0.0.1:8080
3838
3939* Steps such as installing packages require superuser privileges. Prior to such steps, execute:
4040
4141 su -
4242
4343 Type in the password **tatovm** when prompted.
4444
4545 After performing your operation, execute "exit" to end superuser access.
4646
4747* The MySQL user is **root** and password is **tatoeba** in case you need to do operations directly on the table or import more data.
4848
4949
5050##Performing Additional Configuration Steps
5151
5252These steps will eventually be folded into a new VM, but for now, they must be performed after the VM is installed.
5353
5454* Optional: add the following to .bashrc:
5555
5656 export TERM=xterm-256color
5757
5858* Log in as superuser (see above) and execute these commands:
5959
6060 apt-get update
6161
6262 apt-get install git
6363
6464 apt-get install php5-curl
6565
6666 apt-get install bzr
6767
68 apt-get install libpq5 *(for use with Sphinx)*
68 apt-get install libpq5 *(used with Sphinx)*
6969
70and, if you'll be working with UI translations:
70 apt-get install poedit *(used with UI translations)*
7171
72 apt-get install poedit
72 apt-get install flac *(used with audio)*
7373
74 apt-get install lame *(used with audio)*
7475
7576* The current VM was assembled shortly before we made the transition from a Subversion repository on Assembla to a Git repository on GitHub, so execute the following steps to update your code from the new repository:
7677
7778 * Log in as superuser.
7879
7980 * Rename /var/http/tatoeba to /var/http/tatoeba-bak .
8081
8182 * Execute this line:
8283 chmod 0777 /var/http
8384
8485 * Log out as superuser (important).
8586
8687 * In the /var/http directory, pull the code from the [GitHub Tatoeba repository](https://github.com/Tatoeba/tatoeba2) as follows:
8788
8889 git clone https://github.com/Tatoeba/tatoeba2.git /var/http/tatoeba
8990
9091 * If you will be committing code, configure your user.name and user.email. (You can do this retroactively after your first commit, but it's better to do it beforehand.) For instance, if your username at GitHub is ghuser, and your e-mail address is address@example.com, you'll execute:
9192
9293 git config --global user.name "ghuser"
9394
9495 git config --global user.email address@example.com
9596
9697 * Your new directory /var/http/tatoeba should have the same directory structure as the old /var/http/tatoeba-bak. You can now delete /var/http/tatoeba-bak .
9798
9899* Execute SQL scripts as follows:
99100
100101 mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/updates/2013-05-31.sql
101102
102103 mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/updates/2013-08-13.sql
103104
104105 mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/scripts/create\_fill\_langStats.sql
105106
106107* As superuser, make tmp/cache and its subfolders writable:
107108
108109 su
109110
110111 chmod 0777 /var/http/tatoeba/app/tmp/cache/
111112
112113 chmod 0777 /var/http/tatoeba/app/tmp/cache/*
113114
114115* You may find it useful at this point to back up your databases so that you can return them to their virgin state. Make a directory (for instance, /backup ; this may require root permission) and then execute a command such as this one:
115116
116117 mysqldump -u root -ptatoeba -A > /backup/all_dbs.sql
117118
118119## Install and Configure Sphinx Search
119120
120121Follow the instructions under [Installing and Configuring Sphinx Search](install-sphinx).
121122
122123## Customizing Your Installation
123124* There are three ways to access the codebase via your favorite editor in the comfort of your host computer:
124125
125126 * Mount a drive over SSH:
126127
127128 * On Windows: download NetDrive [www.netdrive.net] and use the aforementioned credentials and port
128129
129130 * On Linux: install SSHFS and then mount it using:
130131
131132 sshfs tatoeba@127.0.0.1:4242 /path/to/mountpoint
132133
133134 * Mount a drive over WebDAV:
134135
135136 * On Windows: use NetDrive. The user and password are **tatoeba**, and the port is 8080.
136137
137138 * On Linux: use your favorite file manager with WebDAV support, or install cadaver and connect using the above credentials.
138139
139140 * Mount a shared file (slow and not recommended):
140141
141142 * Set up Guest additions [https://help.ubuntu.com/community/VirtualBox/GuestAdditions]
142143
143144 * In the GUI select Devices -> Shared Folders -> Add
144145
145146 * Browse to the folder you want to share from your host and select it
146147
147148 * Select the Make permanent option
148149
149150 * Now mount the shared file on the guest system:
150151
151152 mount -t vboxfs /media/sharefoldername /path/to/mountpoint
152153
153154* You can also install a graphical environment (GNOME or any other development environment) to work directly from the VM:
154155
155156 apt-get install task-gnome-desktop
156157
157158##Logging Into Tatoeba on the VM
158159
159160The users provided by default are:
160161
161162 admin
162163 corpus_maintainer
163164 advanced_contributor
164165 contributor
165166 inactive
166167 spammer
167168
168169The default password for each user is '123456'.
169170
170171In addition, you can register new users.
diff view generated by jsdifflib

Version at: 16/03/2014, 21:55

#How to Prepare a Development Environment for Tatoeba Using a Pre-made Virtual Machine

## Installing the VM
* Grab the vm file [http://mirrors.bouah.net/pub/tatoeba/Tatovm/](http://mirrors.bouah.net/pub/tatoeba/Tatovm/)

* Untar the file:

   * On Windows: 

        * Download both the vbox and the gz file

        * Use 7zip [http://www.7-zip.org/] to extract Tatovm.vmdk file from the gz file (using the "Extract here" item from the right-click menu)

   * On Linux: use file-roller or from the terminal, type:

   tar -xvf vmfile

* Get and install VirtualBox [https://www.virtualbox.org/wiki/Downloads]

* Load the VM files in VirtualBox:

  From the GUI: **Machine -> Add**, then browse to the location of the .vbox file

  From the command line: VBoxManage registervm /path/to/vm.vbox

## Accessing the VM
* The default http port is 8080 and the default SSH port is 4242.

* On Windows, you may want to download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) as your SSH GUI.

* To SSH into the machine, use the username **tatoeba** and password **tatoeba**:

   ssh -p 4242 tatoeba@127.0.0.1

* Now you can see the website running in your browser by pointing it to the following address:

   127.0.0.1:8080

* Steps such as installing packages require superuser privileges. Prior to such steps, execute:

   su -   

   Type in the password **tatovm** when prompted.

   After performing your operation, execute "exit" to end superuser access.

* The MySQL user is **root** and password is **tatoeba** in case you need to do operations directly on the table or import more data.


##Performing Additional Configuration Steps

These steps will eventually be folded into a new VM, but for now, they must be performed after the VM is installed. 

* Optional: add the following to .bashrc:

    export TERM=xterm-256color

* Log in as superuser (see above) and execute these commands:

    apt-get update

    apt-get install git

    apt-get install php5-curl

    apt-get install bzr

    apt-get install libpq5  *(for use with Sphinx)*

and, if you'll be working with UI translations:

    apt-get install poedit


* The current VM was assembled shortly before we made the transition from a Subversion repository on Assembla to a Git repository on GitHub, so execute the following steps to update your code from the new repository:

    * Log in as superuser.

    * Rename /var/http/tatoeba to /var/http/tatoeba-bak .

    * Execute this line: 
   chmod 0777 /var/http

    * Log out as superuser (important).
 
    * In the /var/http directory, pull the code from the [GitHub Tatoeba repository](https://github.com/Tatoeba/tatoeba2) as follows:

    git clone https://github.com/Tatoeba/tatoeba2.git /var/http/tatoeba

    * If you will be committing code, configure your user.name and user.email. (You can do this retroactively after your first commit, but it's better to do it beforehand.) For instance, if your username at GitHub is ghuser, and your e-mail address is address@example.com, you'll execute:

        git config --global user.name "ghuser"

        git config --global user.email address@example.com

    * Your new directory /var/http/tatoeba should have the same directory structure as the old /var/http/tatoeba-bak. You can now delete /var/http/tatoeba-bak .

* Execute SQL scripts as follows:

    mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/updates/2013-05-31.sql

    mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/updates/2013-08-13.sql

    mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/scripts/create\_fill\_langStats.sql

* As superuser, make tmp/cache and its subfolders writable:

   su
 
   chmod 0777 /var/http/tatoeba/app/tmp/cache/

   chmod 0777 /var/http/tatoeba/app/tmp/cache/*
 
* You may find it useful at this point to back up your databases so that you can return them to their virgin state. Make a directory (for instance, /backup ; this may require root permission) and then execute a command such as this one:

    mysqldump -u root -ptatoeba -A > /backup/all_dbs.sql

## Install and Configure Sphinx Search

Follow the instructions under [Installing and Configuring Sphinx Search](install-sphinx).
 
## Customizing Your Installation
* There are three ways to access the codebase via your favorite editor in the comfort of your host computer:

   * Mount a drive over SSH:

       * On Windows: download NetDrive [www.netdrive.net] and use the aforementioned credentials and port

       * On Linux: install SSHFS and then mount it using:

       sshfs tatoeba@127.0.0.1:4242 /path/to/mountpoint

    * Mount a drive over WebDAV:

        * On Windows: use NetDrive. The user and password are **tatoeba**, and the port is 8080.

        * On Linux: use your favorite file manager with WebDAV support, or install cadaver and connect using the above credentials.

    * Mount a shared file (slow and not recommended):

        * Set up Guest additions [https://help.ubuntu.com/community/VirtualBox/GuestAdditions]

        * In the GUI select Devices -> Shared Folders -> Add

        * Browse to the folder you want to share from your host and select it

        * Select the Make permanent option

        * Now mount the shared file on the guest system:

       mount -t vboxfs /media/sharefoldername /path/to/mountpoint

* You can also install a graphical environment (GNOME or any other development environment) to work directly from the VM:

  apt-get install task-gnome-desktop

##Logging Into Tatoeba on the VM

The users provided by default are:

    admin
    corpus_maintainer
    advanced_contributor
    contributor
    inactive
    spammer

The default password for each user is '123456'.

In addition, you can register new users.

version at: 19/03/2014, 00:55

#How to Prepare a Development Environment for Tatoeba Using a Pre-made Virtual Machine

## Installing the VM
* Grab the vm file [http://mirrors.bouah.net/pub/tatoeba/Tatovm/](http://mirrors.bouah.net/pub/tatoeba/Tatovm/)

* Untar the file:

   * On Windows: 

        * Download both the vbox and the gz file

        * Use 7zip [http://www.7-zip.org/] to extract Tatovm.vmdk file from the gz file (using the "Extract here" item from the right-click menu)

   * On Linux: use file-roller or from the terminal, type:

   tar -xvf vmfile

* Get and install VirtualBox [https://www.virtualbox.org/wiki/Downloads]

* Load the VM files in VirtualBox:

  From the GUI: **Machine -> Add**, then browse to the location of the .vbox file

  From the command line: VBoxManage registervm /path/to/vm.vbox

## Accessing the VM
* The default http port is 8080 and the default SSH port is 4242.

* On Windows, you may want to download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) as your SSH GUI.

* To SSH into the machine, use the username **tatoeba** and password **tatoeba**:

   ssh -p 4242 tatoeba@127.0.0.1

* Now you can see the website running in your browser by pointing it to the following address:

   127.0.0.1:8080

* Steps such as installing packages require superuser privileges. Prior to such steps, execute:

   su -   

   Type in the password **tatovm** when prompted.

   After performing your operation, execute "exit" to end superuser access.

* The MySQL user is **root** and password is **tatoeba** in case you need to do operations directly on the table or import more data.


##Performing Additional Configuration Steps

These steps will eventually be folded into a new VM, but for now, they must be performed after the VM is installed. 

* Optional: add the following to .bashrc:

    export TERM=xterm-256color

* Log in as superuser (see above) and execute these commands:

    apt-get update

    apt-get install git

    apt-get install php5-curl

    apt-get install bzr

    apt-get install libpq5  *(used with Sphinx)*

    apt-get install poedit *(used with UI translations)*

    apt-get install flac *(used with audio)*

    apt-get install lame *(used with audio)*

* The current VM was assembled shortly before we made the transition from a Subversion repository on Assembla to a Git repository on GitHub, so execute the following steps to update your code from the new repository:

    * Log in as superuser.

    * Rename /var/http/tatoeba to /var/http/tatoeba-bak .

    * Execute this line: 
   chmod 0777 /var/http

    * Log out as superuser (important).
 
    * In the /var/http directory, pull the code from the [GitHub Tatoeba repository](https://github.com/Tatoeba/tatoeba2) as follows:

    git clone https://github.com/Tatoeba/tatoeba2.git /var/http/tatoeba

    * If you will be committing code, configure your user.name and user.email. (You can do this retroactively after your first commit, but it's better to do it beforehand.) For instance, if your username at GitHub is ghuser, and your e-mail address is address@example.com, you'll execute:

        git config --global user.name "ghuser"

        git config --global user.email address@example.com

    * Your new directory /var/http/tatoeba should have the same directory structure as the old /var/http/tatoeba-bak. You can now delete /var/http/tatoeba-bak .

* Execute SQL scripts as follows:

    mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/updates/2013-05-31.sql

    mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/updates/2013-08-13.sql

    mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/scripts/create\_fill\_langStats.sql

* As superuser, make tmp/cache and its subfolders writable:

   su
 
   chmod 0777 /var/http/tatoeba/app/tmp/cache/

   chmod 0777 /var/http/tatoeba/app/tmp/cache/*
 
* You may find it useful at this point to back up your databases so that you can return them to their virgin state. Make a directory (for instance, /backup ; this may require root permission) and then execute a command such as this one:

    mysqldump -u root -ptatoeba -A > /backup/all_dbs.sql

## Install and Configure Sphinx Search

Follow the instructions under [Installing and Configuring Sphinx Search](install-sphinx).
 
## Customizing Your Installation
* There are three ways to access the codebase via your favorite editor in the comfort of your host computer:

   * Mount a drive over SSH:

       * On Windows: download NetDrive [www.netdrive.net] and use the aforementioned credentials and port

       * On Linux: install SSHFS and then mount it using:

       sshfs tatoeba@127.0.0.1:4242 /path/to/mountpoint

    * Mount a drive over WebDAV:

        * On Windows: use NetDrive. The user and password are **tatoeba**, and the port is 8080.

        * On Linux: use your favorite file manager with WebDAV support, or install cadaver and connect using the above credentials.

    * Mount a shared file (slow and not recommended):

        * Set up Guest additions [https://help.ubuntu.com/community/VirtualBox/GuestAdditions]

        * In the GUI select Devices -> Shared Folders -> Add

        * Browse to the folder you want to share from your host and select it

        * Select the Make permanent option

        * Now mount the shared file on the guest system:

       mount -t vboxfs /media/sharefoldername /path/to/mountpoint

* You can also install a graphical environment (GNOME or any other development environment) to work directly from the VM:

  apt-get install task-gnome-desktop

##Logging Into Tatoeba on the VM

The users provided by default are:

    admin
    corpus_maintainer
    advanced_contributor
    contributor
    inactive
    spammer

The default password for each user is '123456'.

In addition, you can register new users.

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.