Version at: 16/03/2014, 18:12 vs. version at: 16/03/2014, 18:13 | ||
---|---|---|
1 | 1 | #How to Prepare a Development Environment for Tatoeba Using a Pre-made Virtual Machine |
2 | 2 | |
3 | 3 | ## Installing the VM |
4 | 4 | * Grab the vm file [http://mirrors.bouah.net/pub/tatoeba/Tatovm/](http://mirrors.bouah.net/pub/tatoeba/Tatovm/) |
5 | 5 | |
6 | 6 | * Untar the file: |
7 | 7 | |
8 | 8 | * On Windows: |
9 | 9 | |
10 | 10 | * Download both the vbox and the gz file |
11 | 11 | |
12 | 12 | * 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) |
13 | 13 | |
14 | 14 | * On Linux: use file-roller or from the terminal, type: |
15 | 15 | |
16 | 16 | tar -xvf vmfile |
17 | 17 | |
18 | 18 | * Get and install VirtualBox [https://www.virtualbox.org/wiki/Downloads] |
19 | 19 | |
20 | 20 | * Load the VM files in VirtualBox: |
21 | 21 | |
22 | 22 | From the GUI: **Machine -> Add**, then browse to the location of the .vbox file |
23 | 23 | |
24 | 24 | From the command line: VBoxManage registervm /path/to/vm.vbox |
25 | 25 | |
26 | 26 | ## Accessing the VM |
27 | 27 | * The default http port is 8080 and the default SSH port is 4242. |
28 | 28 | |
29 | 29 | * On Windows, you may want to download [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) as your SSH GUI. |
30 | 30 | |
31 | 31 | * To SSH into the machine, use the username **tatoeba** and password **tatoeba**: |
32 | 32 | |
33 | 33 | ssh -p 4242 tatoeba@127.0.0.1 |
34 | 34 | |
35 | 35 | * Now you can see the website running in your browser by pointing it to the following address: |
36 | 36 | |
37 | 37 | 127.0.0.1:8080 |
38 | 38 | |
39 | 39 | * Steps such as installing packages require superuser privileges. Prior to such steps, execute: |
40 | 40 | |
41 | 41 | su - |
42 | 42 | |
43 | 43 | Type in the password **tatovm** when prompted. |
44 | 44 | |
45 | 45 | After performing your operation, execute "exit" to end superuser access. |
46 | 46 | |
47 | 47 | * The MySQL user is **root** and password is **tatoeba** in case you need to do operations directly on the table or import more data. |
48 | 48 | |
49 | 49 | |
50 | 50 | ##Performing Additional Configuration Steps |
51 | 51 | |
52 | 52 | These steps will eventually be folded into a new VM, but for now, they must be performed after the VM is installed. |
53 | 53 | |
54 | 54 | * Optional: add the following to .bashrc: |
55 | 55 | |
56 | 56 | export TERM=xterm-256color |
57 | 57 | |
58 | 58 | * Log in as superuser (see above) and execute these commands: |
59 | 59 | |
60 | 60 | apt-get update |
61 | 61 | |
62 | 62 | apt-get install git |
63 | 63 | |
64 | 64 | apt-get install php5-curl |
65 | 65 | |
66 | 66 | apt-get install bzr |
67 | 67 | |
68 | 68 | and, if you'll be working with UI translations: |
69 | 69 | |
70 | 70 | apt-get install poedit |
71 | 71 | |
72 | 72 | |
73 | 73 | * 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: |
74 | 74 | |
75 | 75 | * Log in as superuser. |
76 | 76 | |
77 | 77 | * Rename /var/http/tatoeba to /var/http/tatoeba-bak . |
78 | 78 | |
79 | 79 | * Execute this line: |
80 | 80 | chmod 0777 /var/http |
81 | 81 | |
82 | 82 | * Log out as superuser (important). |
83 | 83 | |
84 | 84 | * In the /var/http directory, pull the code from the [GitHub Tatoeba repository](https://github.com/Tatoeba/tatoeba2) as follows: |
85 | 85 | |
86 | 86 | git clone https://github.com/Tatoeba/tatoeba2.git /var/http/tatoeba |
87 | 87 | |
88 | 88 | * 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 . |
89 | 89 | |
90 | 90 | * Execute SQL scripts as follows: |
91 | 91 | |
92 | 92 | mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/updates/2013-05-31.sql |
93 | 93 | |
94 | 94 | mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/updates/2013-08-13.sql |
95 | 95 | |
96 | mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/scripts/create_fill_langStats.sql | |
96 | mysql -u root -ptatoeba tatoeba < /var/http/tatoeba/docs/database/scripts/create\_fill\_langStats.sql | |
97 | 97 | |
98 | 98 | * 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: |
99 | 99 | |
100 | 100 | mysqldump -u root -ptatoeba -A > /backup/all_dbs.sql |
101 | 101 | |
102 | 102 | |
103 | 103 | ## Customizing Your Installation |
104 | 104 | * There are three ways to access the codebase via your favorite editor in the comfort of your host computer: |
105 | 105 | |
106 | 106 | * Mount a drive over SSH: |
107 | 107 | |
108 | 108 | * On Windows: download NetDrive [www.netdrive.net] and use the aforementioned credentials and port |
109 | 109 | |
110 | 110 | * On Linux: install SSHFS and then mount it using: |
111 | 111 | |
112 | 112 | sshfs tatoeba@127.0.0.1:4242 /path/to/mountpoint |
113 | 113 | |
114 | 114 | * Mount a drive over WebDAV: |
115 | 115 | |
116 | 116 | * On Windows: use NetDrive. The user and password are **tatoeba**, and the port is 8080. |
117 | 117 | |
118 | 118 | * On Linux: use your favorite file manager with WebDAV support, or install cadaver and connect using the above credentials. |
119 | 119 | |
120 | 120 | * Mount a shared file (slow and not recommended): |
121 | 121 | |
122 | 122 | * Set up Guest additions [https://help.ubuntu.com/community/VirtualBox/GuestAdditions] |
123 | 123 | |
124 | 124 | * In the GUI select Devices -> Shared Folders -> Add |
125 | 125 | |
126 | 126 | * Browse to the folder you want to share from your host and select it |
127 | 127 | |
128 | 128 | * Select the Make permanent option |
129 | 129 | |
130 | 130 | * Now mount the shared file on the guest system: |
131 | 131 | |
132 | 132 | mount -t vboxfs /media/sharefoldername /path/to/mountpoint |
133 | 133 | |
134 | 134 | * You can also install a graphical environment (GNOME or any other development environment) to work directly from the VM: |
135 | 135 | |
136 | 136 | apt-get install task-gnome-desktop |
137 | 137 | |
138 | 138 | ##Logging Into Tatoeba on the VM |
139 | 139 | |
140 | 140 | The users provided by default are: |
141 | 141 | |
142 | 142 | admin |
143 | 143 | corpus_maintainer |
144 | 144 | advanced_contributor |
145 | 145 | contributor |
146 | 146 | inactive |
147 | 147 | spammer |
148 | 148 | |
149 | 149 | The default password for each user is '123456'. |
150 | 150 | |
151 | 151 | In addition, you can register new users. |
diff view generated by jsdifflib |
Version at: 16/03/2014, 18:12
#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 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 * 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 * 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 ## 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: 16/03/2014, 18:13
#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 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 * 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 * 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 ## 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.