Commit 618e5b4e1fad12baa1b3580fb00ba125095b52cc
1 parent
f1979c27
Exists in
master
and in
39 other branches
Removed out-dated install docs
Showing
1 changed file
with
0 additions
and
421 deletions
Show diff stats
install.rst
... | ... | @@ -1,421 +0,0 @@ |
1 | -.. -*- coding: utf-8 -*- | |
2 | - | |
3 | -.. highlight:: rest | |
4 | - | |
5 | -.. _colab_software: | |
6 | - | |
7 | -================================= | |
8 | -Installing a full colab environment | |
9 | -================================= | |
10 | - | |
11 | -This file will guide you through the installation of colab's dependencys, | |
12 | -external tools and its integration with colab to help you start using/working. | |
13 | - | |
14 | -The dependecys installation steps will be based of Ubuntu 13.04 but the tools, | |
15 | -integrations and the colab itself runs in a virtual machine so it'll be the same regardless of your system. | |
16 | - | |
17 | - | |
18 | -Fabric + VirtualBox + Vagrant | |
19 | -============== | |
20 | - | |
21 | -You can easily install fabric using pip with | |
22 | - | |
23 | -.. code-block:: | |
24 | - | |
25 | - sudo apt-get install python-pip | |
26 | - sudo pip install fabric | |
27 | - | |
28 | -You can also instal Virtual Box with apt-get | |
29 | - | |
30 | -.. code-block:: | |
31 | - | |
32 | - sudo apt-get install virtualbox | |
33 | - | |
34 | -Now, vagrant has an apt-get but its not supported anymore, so you'll have to manually download and install it from the site | |
35 | - | |
36 | - https://www.vagrantup.com/downloads.html | |
37 | - | |
38 | -Starting the VM and environment | |
39 | -=============================== | |
40 | - | |
41 | -Clone the repository to your system | |
42 | - | |
43 | -.. code-block:: | |
44 | - | |
45 | - git clone https://github.com/colab-community/colab.git | |
46 | - cd colab | |
47 | - | |
48 | -Create your local configuration file(we'll adjust it later) | |
49 | - | |
50 | -.. code-block:: | |
51 | - | |
52 | - cp src/colab/local_settings-dev.py src/colab/local_settings.py | |
53 | - | |
54 | -To startup the VM simple do | |
55 | - | |
56 | -.. code-block:: | |
57 | - | |
58 | - vagrant up | |
59 | - | |
60 | -*NOTE* | |
61 | - | |
62 | - In case you have problems creating the virtual machine you might need to download the linux header files | |
63 | - | |
64 | - .. code-block:: | |
65 | - | |
66 | - linux-headers-generic | |
67 | - | |
68 | -Accessing the VM and configurating the database | |
69 | -=============================================== | |
70 | - | |
71 | -You should now be able to access your VM through | |
72 | - | |
73 | -.. code-block:: | |
74 | - | |
75 | - vagrant ssh | |
76 | - | |
77 | -*NOTE* | |
78 | - | |
79 | - In case you get a connection port refused or ssh error, you might need to activate manually an ssh server(rare) | |
80 | - | |
81 | - .. code-block:: | |
82 | - | |
83 | - sudo apt-get install ssh; sudo service ssh start; | |
84 | - | |
85 | -The VM doesnt come with a databse so, you'll need to install one inside it. | |
86 | -Inside de VM download and install postgresql | |
87 | - | |
88 | -.. code-block:: | |
89 | - | |
90 | - sudo apt-get install postgresql | |
91 | - | |
92 | -Access the postgresql database and create a new database and user colab user | |
93 | - | |
94 | -.. code-block:: | |
95 | - | |
96 | - sudo -u postgres psql | |
97 | - CREATE USER colab SUPERUSER INHERIT CREATEDB CREATEROLE; | |
98 | - ALTER USER colab PASSWORD 'colab'; | |
99 | - CREATE DATABASE colab; | |
100 | - | |
101 | -Also, create the Trac's database(note it needs to support UTF8) | |
102 | - | |
103 | -.. code-block:: | |
104 | - | |
105 | - create database "trac_colab" with owner "colab" encoding 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8' TEMPLATE=template0; | |
106 | - \q | |
107 | - | |
108 | -That's the database used for Trac, but its needed so colab can make its migrations correctly and adjust solr accordinly | |
109 | - | |
110 | -Installing Trac on the VM | |
111 | -========================= | |
112 | - | |
113 | -Inside the VM(vagrant ssh) download e install trac | |
114 | - | |
115 | -.. code-block:: | |
116 | - | |
117 | - sudo apt-get install trac | |
118 | - sudo pip install --upgrade Trac | |
119 | - | |
120 | -Now you'll need to configure trac so it can access the previously created database. | |
121 | - | |
122 | -.. code-block:: | |
123 | - | |
124 | - mkdir -p /var/local/trac | |
125 | - sudo trac-admin /var/local/trac initenv | |
126 | - | |
127 | -Set the project name to 'Colab' when asked, and the following postgresql connection string | |
128 | - | |
129 | -.. code-block:: | |
130 | - | |
131 | - postgres://colab:colab@/trac_colab?host=localhost | |
132 | - | |
133 | -The trac database should be populated with relations, now need to give trac write access to its folders | |
134 | - | |
135 | -.. code-block:: | |
136 | - | |
137 | - sudo chown -R www-data /var/local/trac | |
138 | - sudo chmod -R 775 /var/local/trac | |
139 | - | |
140 | -Finally, trac can be run by | |
141 | - | |
142 | -.. code-block:: | |
143 | - | |
144 | - tracd --port 5000 /var/local/trac | |
145 | - | |
146 | -Use port 8000 and access it on port 8080 in your local machine to see it works if you'd like(vagrant has port redirects) | |
147 | - | |
148 | -Installing Solr and indexing colab's schemas | |
149 | -========================================== | |
150 | -In Progress of making it readable | |
151 | - #http servlet jetty | |
152 | - sudo apt-get install jetty | |
153 | - | |
154 | - #solr | |
155 | - wget http://ftp.unicamp.br/pub/apache/lucene/solr/4.6.1/solr-4.6.1.tgz | |
156 | - tar xvzf solr-4.6.1.tgz | |
157 | - sudo mv solr-4.6.1 /usr/share/solr | |
158 | - | |
159 | - sudo cp /usr/share/solr/example/webapps/solr.war /usr/share/solr/example/solr/solr.war | |
160 | - | |
161 | - python manage.py build_solr_schema >> schema.xml | |
162 | - #existe mais de uma referencia a stopwords_en | |
163 | - trocar no schema.xml stopwords_en.txt por lang/stopwords_en.txt | |
164 | - | |
165 | - sudo cp schema.xml /usr/share/solr/example/solr/collection1/conf | |
166 | - | |
167 | - #inclusive a tag | |
168 | - Remova <updateLog> em solrconfig.xml localizado em /usr/share/solr/example/solr/collection1/conf | |
169 | - | |
170 | - #executa servidor | |
171 | - cd /usr/share/solr/example/; java -jar start.jar; | |
172 | - | |
173 | - #indexa | |
174 | - python manage.py update_index | |
175 | - | |
176 | - | |
177 | -Installing Mailman with Nginx | |
178 | -============================= | |
179 | - | |
180 | -Nginx Configuration: | |
181 | - | |
182 | -In order to let nginx serve the Mailman web interface, we need to have the fcgiwrap package installed: | |
183 | - | |
184 | -.. code-block:: | |
185 | - | |
186 | - sudo apt-get install fcgiwrap | |
187 | - | |
188 | -Setting the vhost: | |
189 | - | |
190 | -Create the www.example.com web site root as follows: | |
191 | - | |
192 | -.. code-block:: | |
193 | - | |
194 | - mkdir -p /var/www/www.example.com/web | |
195 | - | |
196 | -Next create a basic nginx vhost configuration editing the .vhost file (editor /etc/nginx/sites-available/www.example.com.vhost): | |
197 | - | |
198 | -.. code-block:: | |
199 | - | |
200 | - server { | |
201 | - listen 8000; | |
202 | - server_name www.example.com example.com; | |
203 | - root /var/www/www.example.com/web; | |
204 | - if ($http_host != "localhost:8080") { | |
205 | - rewrite ^ localhost$request_uri permanent; | |
206 | - } | |
207 | - index index.php index.html; | |
208 | - location = /favicon.ico { | |
209 | - log_not_found off; | |
210 | - access_log off; | |
211 | - } | |
212 | - location = /robots.txt { | |
213 | - allow all; | |
214 | - log_not_found off; | |
215 | - access_log off; | |
216 | - } | |
217 | - # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). | |
218 | - location ~ /\. { | |
219 | - deny all; | |
220 | - access_log off; | |
221 | - log_not_found off; | |
222 | - } | |
223 | - location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ { | |
224 | - expires max; | |
225 | - log_not_found off; | |
226 | - } | |
227 | - } | |
228 | - | |
229 | -To enable the vhost, we create a symlink to it from the /etc/nginx/sites-enabled/ directory: | |
230 | - | |
231 | -.. code-block:: | |
232 | - | |
233 | - cd /etc/nginx/sites-enabled/ | |
234 | - ln -s /etc/nginx/sites-available/www.example.com.vhost www.example.com.vhost | |
235 | - | |
236 | -Reload nginx for the changes to take effect: | |
237 | - | |
238 | -.. code-block:: | |
239 | - | |
240 | - /etc/init.d/nginx reload | |
241 | - | |
242 | -Mailman Configuration: | |
243 | - | |
244 | -.. code-block:: | |
245 | - | |
246 | - sudo apt-get install mailman | |
247 | - | |
248 | -Create a new mailing list: | |
249 | - | |
250 | -.. code-block:: | |
251 | - | |
252 | - sudo newlist mailman | |
253 | - | |
254 | -Open the /etc/aliases (editor /etc/aliases) and add the following: | |
255 | - | |
256 | -.. code-block:: | |
257 | - | |
258 | - mailman: "|/var/lib/mailman/mail/mailman post mailman" | |
259 | - mailman-admin: "|/var/lib/mailman/mail/mailman admin mailman" | |
260 | - mailman-bounces: "|/var/lib/mailman/mail/mailman bounces mailman" | |
261 | - mailman-confirm: "|/var/lib/mailman/mail/mailman confirm mailman" | |
262 | - mailman-join: "|/var/lib/mailman/mail/mailman join mailman" | |
263 | - mailman-leave: "|/var/lib/mailman/mail/mailman leave mailman" | |
264 | - mailman-owner: "|/var/lib/mailman/mail/mailman owner mailman" | |
265 | - mailman-request: "|/var/lib/mailman/mail/mailman request mailman" | |
266 | - mailman-subscribe: "|/var/lib/mailman/mail/mailman subscribe mailman" | |
267 | - mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman" | |
268 | - | |
269 | -Run: | |
270 | - | |
271 | -.. code-block:: | |
272 | - | |
273 | - sudo newaliases | |
274 | - | |
275 | -Now restart postfix and mailman: | |
276 | - | |
277 | -.. code-block:: | |
278 | - | |
279 | - sudo /etc/init.d/postfix restart | |
280 | - sudo /etc/init.d/mailman start | |
281 | - | |
282 | -Open /etc/nginx/sites-available/www.example.com.vhost and add the following part to the server {} container: | |
283 | - | |
284 | -.. code-block:: | |
285 | - | |
286 | - server { | |
287 | - [...] | |
288 | - location /cgi-bin/mailman { | |
289 | - root /usr/lib/; | |
290 | - fastcgi_split_path_info (^/cgi-bin/mailman/[^/]*)(.*)$; | |
291 | - include /etc/nginx/fastcgi_params; | |
292 | - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
293 | - fastcgi_param PATH_INFO $fastcgi_path_info; | |
294 | - fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
295 | - fastcgi_intercept_errors on; | |
296 | - fastcgi_pass unix:/var/run/fcgiwrap.socket; | |
297 | - } | |
298 | - location /images/mailman { | |
299 | - alias /usr/share/images/mailman; | |
300 | - } | |
301 | - location /pipermail { | |
302 | - alias /var/lib/mailman/archives/public; | |
303 | - autoindex on; | |
304 | - } | |
305 | - [...] | |
306 | - } | |
307 | - | |
308 | -Now create the fastcgi_params file and add the following: | |
309 | - | |
310 | -.. code-block:: | |
311 | - | |
312 | - fastcgi_param QUERY_STRING $query_string; | |
313 | - fastcgi_param REQUEST_METHOD $request_method; | |
314 | - fastcgi_param CONTENT_TYPE $content_type; | |
315 | - fastcgi_param CONTENT_LENGTH $content_length; | |
316 | - | |
317 | - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
318 | - fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
319 | - fastcgi_param REQUEST_URI $request_uri; | |
320 | - fastcgi_param DOCUMENT_URI $document_uri; | |
321 | - fastcgi_param DOCUMENT_ROOT $document_root; | |
322 | - fastcgi_param SERVER_PROTOCOL $server_protocol; | |
323 | - | |
324 | - fastcgi_param GATEWAY_INTERFACE CGI/1.1; | |
325 | - fastcgi_param SERVER_SOFTWARE nginx; | |
326 | - | |
327 | - fastcgi_param REMOTE_ADDR $remote_addr; | |
328 | - fastcgi_param REMOTE_PORT $remote_port; | |
329 | - fastcgi_param SERVER_ADDR $server_addr; | |
330 | - fastcgi_param SERVER_PORT $server_port; | |
331 | - fastcgi_param SERVER_NAME $server_name; | |
332 | - | |
333 | -Now open the mm_config.py file (sudo editor /etc/mailman/mm_config.py) and modify the lines below to: | |
334 | - | |
335 | -.. code-block:: | |
336 | - | |
337 | - DEFAULT_EMAIL_HOST = 'localhost' | |
338 | - DEFAULT_URL_HOST = 'localhost:8080' | |
339 | - | |
340 | -To these modifications have effect do the following: | |
341 | - | |
342 | -.. code-block:: | |
343 | - | |
344 | - sudo withlist -l -a -r fix_url | |
345 | - | |
346 | -Also tt's needed to add permission to mailman to access the name_of_the_list.mbox because it needs to archive the emails: | |
347 | - | |
348 | -.. code-block:: | |
349 | - | |
350 | - sudo chown -R root:list /var/lib/mailman/archives | |
351 | - sudo chown -R root:list /var/lib/mailman/data/aliases | |
352 | - sudo chown -R root:list /etc/aliases | |
353 | - sudo chmod -R u+rwX /var/lib/mailman/archives | |
354 | - | |
355 | -Now restart fcgi, mailman and nginx: | |
356 | - | |
357 | -.. code-block:: | |
358 | - | |
359 | - sudo /etc/init.d/fcgiwrap restart | |
360 | - sudo /etc/init.d/mailman restart | |
361 | - sudo /etc/init.d/nginx reload | |
362 | - | |
363 | -To see if it's working: | |
364 | - | |
365 | -.. code-block:: | |
366 | - | |
367 | - http://localhost:8080/cgi-bin/mailman/listinfo/mailman | |
368 | - | |
369 | -Setting up Colab | |
370 | -========================= | |
371 | - | |
372 | -You can exit the vagrant VM ('exit' inside the ssh shell) but for now leave it running Trac and start a new terminal tab | |
373 | - | |
374 | -Open the /src/colab/local_settings.py file | |
375 | - | |
376 | -Change COLAB_TRAC_URL to | |
377 | - | |
378 | -.. code-block:: | |
379 | - | |
380 | - COLAB_TRAC_URL = 'http://localhost:5000/trac/' | |
381 | - | |
382 | -Or the port you're using to Trac | |
383 | - | |
384 | -After this it's needed to import the e-mails from Mailman: | |
385 | - | |
386 | -.. code-block:: | |
387 | - | |
388 | - sudo python manage.py import_emails | |
389 | - | |
390 | -And also update Solr: | |
391 | - | |
392 | -.. code-block:: | |
393 | - | |
394 | - sudo python manage.py update_index | |
395 | - | |
396 | -Then, use fabric at colab's root to update the requirements to your VM | |
397 | - | |
398 | -.. code-block:: | |
399 | - | |
400 | - fabric runserver:update | |
401 | - | |
402 | -*NOTE:* | |
403 | - | |
404 | - The fabric installation on ubuntu through 'pip install' might not be added to the path so you'll need to find | |
405 | - where it was installed if thats your case | |
406 | - | |
407 | -Lastly, run fabric again to run the server (it'll also sync and migrate colab's database) and open new tabs to run trac and solr: | |
408 | - | |
409 | -.. code-block:: | |
410 | - | |
411 | - fab runserver | |
412 | - fab trac | |
413 | - fab solr | |
414 | - | |
415 | -You should be able to see colab with its cms service already working at port 8000(because of vagrant redirects) | |
416 | - | |
417 | -*NOTE* | |
418 | - | |
419 | - In case login doesn't work, change the SITE_URL in src/colab/local_settings.py and in src/colab/custom_settings.py the reflect the django's port | |
420 | - Also, add the following line riht bellow it | |
421 | - BROWSERID_AUDIENCES = [SITE_URL, SITE_URL.replace('https', 'http')] |