Version at: 15/03/2014, 15:21 vs. version at: 15/03/2014, 15:39
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: use 7zip [http://www.7-zip.org/]
99
1010 On Linux: use file-roller or from the terminal, type:
1111
1212 tar -xvf vmfile
1313
1414* Get and install VirtualBox [https://www.virtualbox.org/wiki/Downloads]
1515
1616* Load the VM files in VirtualBox:
1717
1818 From the GUI: Machine -> Add then browse to the location of the .vbox file
1919
2020 From the command line: VBoxManage registervm /path/to/vm.vbox
2121
2222## Accessing the VM
2323* The default http port is 8080 and the default SSH port is 4242.
2424
2525* To SSH into the machine, use the username **tatoeba** and password **tatoeba**:
2626
2727 ssh -p 4242 tatoeba@127.0.0.1
2828
2929* Now you can see the website running in your browser by pointing it to the following address:
3030
3131 127.0.0.1:8080
3232
3333* If you see warning messages introduced by "Strict standards:", you probably have a version of PHP that is newer than 5.3.3, the version recommended for Tatoeba development. You can verify this by executing "php -v". To downgrade to PHP 5.3.3, execute "su -" (with password **tatovm**) and then follow [these instructions](http://blog.wpkg.org/2013/06/20/downgrading-to-php-5-3-on-debian-wheezy-7-0/). Once the operation is complete, type "exit" to end superuser access.
3434
3535* The MySQL user is **root** and password is **tatoeba** in case you need to do operations directly on the table or import more data.
3636
3737
3838##Performing Additional Configuration Steps
3939
4040These steps will eventually be folded into a new VM, but for now, they must be performed after the VM is installed.
4141
4242* 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:
4343
44 * Install the git package if "which git" does not show you that you already have it installed. This requires superuser privileges.
45
4446 * Rename ~/tatoeba-www to ~/tatoeba-www-bak .
4547
4648 * In your home directory (~), pull the code from the [GitHub Tatoeba repository](https://github.com/Tatoeba/tatoeba2) as follows:
4749
4850 git clone https://github.com/Tatoeba/tatoeba2.git ~tatoeba/tatoeba-www
4951
5052 * Your new directory ~/tatoeba-www should have the same directory structure as the old ~/tatoeba-www-bak. You can now delete ~/tatoeba-www-bak .
5153
5254* Execute the two SQL scripts 2013-05-31.sql and 2013-08-13.sql as follows:
5355
5456 mysql -u root -ptatoeba tatoeba < /home/tatoeba/tatoeba-www/docs/database/updates/2013-05-31.sql
5557
5658 mysql -u root -ptatoeba tatoeba < /home/tatoeba/tatoeba-www/docs/database/updates/2013-08-13.sql
5759
5860* 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:
5961
6062 mysqldump -ptatoeba -A > /backup/all_dbs.sql
6163
6264* Install curl using these commands (which will require superuser permissions, so you'll need to use "su -" beforehand and "exit" afterwards):
6365
6466 apt-get update
6567
6668 apt-get install php5-curl
6769
6870* As root, install poedit and bzr for use with UI translations stored on Launchpad (which uses a Bazaar repository):
6971apt-get install poedit
7072apt-get install bzr
7173
7274* Optional: add the following to .bashrc:
7375export TERM=xterm-256color
7476
7577## Customizing Your Installation
7678* There are three ways to access the codebase via your favorite editor in the comfort of your host computer:
7779
7880 * Mount a drive over SSH:
7981
8082 * On Windows: download NetDrive [www.netdrive.net] and use the aforementioned credentials and port
8183
8284 * On Linux: install SSHFS and then mount it using:
8385
8486 sshfs tatoeba@127.0.0.1:4242 /path/to/mountpoint
8587
8688 * Mount a drive over WebDAV:
8789
8890 * On Windows: use NetDrive. The user and password are **tatoeba**, and the port is 8080.
8991
9092 * On Linux: use your favorite file manager with WebDAV support, or install cadaver and connect using the above credentials.
9193
9294 * Mount a shared file (slow and not recommended):
9395
9496 * Set up Guest additions [https://help.ubuntu.com/community/VirtualBox/GuestAdditions]
9597
9698 * In the GUI select Devices -> Shared Folders -> Add
9799
98100 * Browse to the folder you want to share from your host and select it
99101
100102 * Select the Make permanent option
101103
102104 * Now mount the shared file on the guest system:
103105
104106 mount -t vboxfs /media/sharefoldername /path/to/mountpoint
105107
106108* You can also install a graphical environment (GNOME or any other development environment) to work directly from the VM:
107109
108110 apt-get install task-gnome-desktop
109111
diff view generated by jsdifflib

Version at: 15/03/2014, 15:21

#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: use 7zip [http://www.7-zip.org/]

   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.

* 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

* If you see warning messages introduced by "Strict standards:", you probably have a version of PHP that is newer than 5.3.3, the version recommended for Tatoeba development. You can verify this by executing "php -v". To downgrade to PHP 5.3.3, execute "su -" (with password **tatovm**) and then follow [these instructions](http://blog.wpkg.org/2013/06/20/downgrading-to-php-5-3-on-debian-wheezy-7-0/). Once the operation is complete, type "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. 

* 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:

    * Rename ~/tatoeba-www to ~/tatoeba-www-bak .
 
    * In your home directory (~), pull the code from the [GitHub Tatoeba repository](https://github.com/Tatoeba/tatoeba2) as follows:

    git clone https://github.com/Tatoeba/tatoeba2.git ~tatoeba/tatoeba-www
 
    * Your new directory ~/tatoeba-www should have the same directory structure as the old ~/tatoeba-www-bak. You can now delete ~/tatoeba-www-bak .

* Execute the two SQL scripts 2013-05-31.sql and 2013-08-13.sql as follows:

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

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

* 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 -ptatoeba -A > /backup/all_dbs.sql

* Install curl using these commands (which will require superuser permissions, so you'll need to use "su -" beforehand and "exit" afterwards):
    
    apt-get update

    apt-get install php5-curl

* As root, install poedit and bzr for use with UI translations stored on Launchpad (which uses a Bazaar repository):
apt-get install poedit
apt-get install bzr

* Optional: add the following to .bashrc:
export TERM=xterm-256color
 
## 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

version at: 15/03/2014, 15:39

#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: use 7zip [http://www.7-zip.org/]

   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.

* 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

* If you see warning messages introduced by "Strict standards:", you probably have a version of PHP that is newer than 5.3.3, the version recommended for Tatoeba development. You can verify this by executing "php -v". To downgrade to PHP 5.3.3, execute "su -" (with password **tatovm**) and then follow [these instructions](http://blog.wpkg.org/2013/06/20/downgrading-to-php-5-3-on-debian-wheezy-7-0/). Once the operation is complete, type "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. 

* 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:

    * Install the git package if "which git" does not show you that you already have it installed. This requires superuser privileges.

    * Rename ~/tatoeba-www to ~/tatoeba-www-bak .
 
    * In your home directory (~), pull the code from the [GitHub Tatoeba repository](https://github.com/Tatoeba/tatoeba2) as follows:

    git clone https://github.com/Tatoeba/tatoeba2.git ~tatoeba/tatoeba-www
 
    * Your new directory ~/tatoeba-www should have the same directory structure as the old ~/tatoeba-www-bak. You can now delete ~/tatoeba-www-bak .

* Execute the two SQL scripts 2013-05-31.sql and 2013-08-13.sql as follows:

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

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

* 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 -ptatoeba -A > /backup/all_dbs.sql

* Install curl using these commands (which will require superuser permissions, so you'll need to use "su -" beforehand and "exit" afterwards):
    
    apt-get update

    apt-get install php5-curl

* As root, install poedit and bzr for use with UI translations stored on Launchpad (which uses a Bazaar repository):
apt-get install poedit
apt-get install bzr

* Optional: add the following to .bashrc:
export TERM=xterm-256color
 
## 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

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.