Revision 6de88ee1 doc/source/install.rst
b/doc/source/install.rst | ||
---|---|---|
14 | 14 |
---------------------- |
15 | 15 |
|
16 | 16 |
.. note:: |
17 |
If PEER\_\*\_TABLE tables are set to FALSE in settings.py, you need to perform the south migrations per application::
|
|
18 |
|
|
17 |
If PEER\_\*\_TABLE tables are set to FALSE in settings.py, you need to perform the south migrations per application:: |
|
18 |
|
|
19 | 19 |
./manage.py migrate longerusername |
20 | 20 |
./manage.py migrate flowspec |
21 | 21 |
./manage.py migrate accounts |
22 |
|
|
23 |
|
|
22 |
|
|
23 |
|
|
24 | 24 |
|
25 | 25 |
If upgrading from flowspy version <1.1.x pay attention to settings.py changes. Also, do not forget to run if PEER\_\*\_TABLE tables are set to TRUE in settings.py:: |
26 |
|
|
27 |
./manage.py migrate
|
|
28 |
|
|
29 |
to catch-up with latest database changes.
|
|
26 |
|
|
27 |
./manage.py migrate |
|
28 |
|
|
29 |
to catch-up with latest database changes. |
|
30 | 30 |
|
31 | 31 |
Upgrading from v<1.0.x |
32 | 32 |
---------------------- |
33 | 33 |
If upgrading from flowspy version <1.0.x pay attention to settings.py changes. Also, do not forget to run:: |
34 |
|
|
34 |
|
|
35 | 35 |
./manage.py migrate |
36 |
|
|
36 |
|
|
37 | 37 |
to catch-up with latest database changes. |
38 | 38 |
|
39 | 39 |
Required system packages |
... | ... | |
44 | 44 |
apt-get upgrade |
45 | 45 |
apt-get install mysql-server apache2 memcached libapache2-mod-proxy-html gunicorn beanstalkd python-django python-django-south python-django-tinymce tinymce python-mysqldb python-yaml python-memcache python-django-registration python-ipaddr python-lxml mysql-client git python-django-celery python-paramiko python-gevent vim |
46 | 46 |
|
47 |
Also, django rest framework package is required. In debian Wheezy it is not available, but one can install it via pip. |
|
48 |
|
|
47 | 49 |
.. note:: |
48 | 50 |
Set username and password for mysql if used |
49 | 51 |
|
... | ... | |
85 | 87 |
Application configuration |
86 | 88 |
========================= |
87 | 89 |
Copy settings.py.dist to settings.py:: |
88 |
|
|
90 |
|
|
89 | 91 |
cd flowspy |
90 | 92 |
cp settings.py.dist settings.py |
91 | 93 |
|
... | ... | |
137 | 139 |
|
138 | 140 |
PEER_MANAGED_TABLE = True |
139 | 141 |
PEER_RANGE_MANAGED_TABLE = True |
140 |
PEER_TECHC_MANAGED_TABLE = True
|
|
142 |
PEER_TECHC_MANAGED_TABLE = True |
|
141 | 143 |
|
142 |
By doing that the corresponding tables as defined in peers/models will not be created. As noted above, you have to create the views that the tables will rely on.
|
|
144 |
By doing that the corresponding tables as defined in peers/models will not be created. As noted above, you have to create the views that the tables will rely on. |
|
143 | 145 |
|
144 | 146 |
.. note:: |
145 | 147 |
Soon we will release a version with django-registration as a means to add users and Shibboleth will become an alternative |
... | ... | |
225 | 227 |
# :Configuration file: /etc/default/celeryd |
226 | 228 |
# |
227 | 229 |
# See http://docs.celeryq.org/en/latest/cookbook/daemonizing.html#init-script-celeryd |
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
|
230 | 232 |
### BEGIN INIT INFO |
231 | 233 |
# Provides: celeryd |
232 | 234 |
# Required-Start: $network $local_fs $remote_fs |
... | ... | |
236 | 238 |
# Short-Description: celery task worker daemon |
237 | 239 |
# Description: Starts the Celery worker daemon for a single project. |
238 | 240 |
### END INIT INFO |
239 |
|
|
241 |
|
|
240 | 242 |
#set -e |
241 |
|
|
243 |
|
|
242 | 244 |
DEFAULT_PID_FILE="/var/run/celery/%n.pid" |
243 | 245 |
DEFAULT_LOG_FILE="/var/log/celery/%n.log" |
244 | 246 |
DEFAULT_LOG_LEVEL="INFO" |
245 | 247 |
DEFAULT_NODES="celery" |
246 | 248 |
DEFAULT_CELERYD="-m celery.bin.celeryd_detach" |
247 | 249 |
ENABLED="false" |
248 |
|
|
250 |
|
|
249 | 251 |
[ -r "$CELERY_DEFAULTS" ] && . "$CELERY_DEFAULTS" |
250 |
|
|
252 |
|
|
251 | 253 |
[ -r /etc/default/celeryd ] && . /etc/default/celeryd |
252 |
|
|
254 |
|
|
253 | 255 |
if [ "$ENABLED" != "true" ]; then |
254 | 256 |
echo "celery daemon disabled - see /etc/default/celeryd." |
255 | 257 |
exit 0 |
256 | 258 |
fi |
257 |
|
|
258 |
|
|
259 |
|
|
260 |
|
|
259 | 261 |
CELERYD_PID_FILE=${CELERYD_PID_FILE:-${CELERYD_PIDFILE:-$DEFAULT_PID_FILE}} |
260 | 262 |
CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-${CELERYD_LOGFILE:-$DEFAULT_LOG_FILE}} |
261 | 263 |
CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-${CELERYD_LOGLEVEL:-$DEFAULT_LOG_LEVEL}} |
... | ... | |
263 | 265 |
CELERYD=${CELERYD:-$DEFAULT_CELERYD} |
264 | 266 |
CELERYCTL=${CELERYCTL:="celeryctl"} |
265 | 267 |
CELERYD_NODES=${CELERYD_NODES:-$DEFAULT_NODES} |
266 |
|
|
268 |
|
|
267 | 269 |
export CELERY_LOADER |
268 |
|
|
270 |
|
|
269 | 271 |
if [ -n "$2" ]; then |
270 | 272 |
CELERYD_OPTS="$CELERYD_OPTS $2" |
271 | 273 |
fi |
272 |
|
|
274 |
|
|
273 | 275 |
CELERYD_LOG_DIR=`dirname $CELERYD_LOG_FILE` |
274 | 276 |
CELERYD_PID_DIR=`dirname $CELERYD_PID_FILE` |
275 | 277 |
if [ ! -d "$CELERYD_LOG_DIR" ]; then |
... | ... | |
278 | 280 |
if [ ! -d "$CELERYD_PID_DIR" ]; then |
279 | 281 |
mkdir -p $CELERYD_PID_DIR |
280 | 282 |
fi |
281 |
|
|
283 |
|
|
282 | 284 |
# Extra start-stop-daemon options, like user/group. |
283 | 285 |
if [ -n "$CELERYD_USER" ]; then |
284 | 286 |
DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERYD_USER" |
... | ... | |
288 | 290 |
DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERYD_GROUP" |
289 | 291 |
chgrp "$CELERYD_GROUP" $CELERYD_LOG_DIR $CELERYD_PID_DIR |
290 | 292 |
fi |
291 |
|
|
293 |
|
|
292 | 294 |
if [ -n "$CELERYD_CHDIR" ]; then |
293 | 295 |
DAEMON_OPTS="$DAEMON_OPTS --workdir=\"$CELERYD_CHDIR\"" |
294 | 296 |
fi |
295 |
|
|
296 |
|
|
297 |
|
|
298 |
|
|
297 | 299 |
check_dev_null() { |
298 | 300 |
if [ ! -c /dev/null ]; then |
299 | 301 |
echo "/dev/null is not a character device!" |
300 | 302 |
exit 1 |
301 | 303 |
fi |
302 | 304 |
} |
303 |
|
|
304 |
|
|
305 |
|
|
306 |
|
|
305 | 307 |
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" |
306 |
|
|
307 |
|
|
308 |
|
|
309 |
|
|
308 | 310 |
stop_workers () { |
309 | 311 |
$CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE" |
310 | 312 |
} |
311 |
|
|
312 |
|
|
313 |
|
|
314 |
|
|
313 | 315 |
start_workers () { |
314 | 316 |
$CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \ |
315 | 317 |
--pidfile="$CELERYD_PID_FILE" \ |
... | ... | |
318 | 320 |
--cmd="$CELERYD" \ |
319 | 321 |
$CELERYD_OPTS |
320 | 322 |
} |
321 |
|
|
322 |
|
|
323 |
|
|
324 |
|
|
323 | 325 |
restart_workers () { |
324 | 326 |
$CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \ |
325 | 327 |
--pidfile="$CELERYD_PID_FILE" \ |
... | ... | |
328 | 330 |
--cmd="$CELERYD" \ |
329 | 331 |
$CELERYD_OPTS |
330 | 332 |
} |
331 |
|
|
332 |
|
|
333 |
|
|
333 |
|
|
334 |
|
|
335 |
|
|
334 | 336 |
case "$1" in |
335 | 337 |
start) |
336 | 338 |
check_dev_null |
337 | 339 |
start_workers |
338 | 340 |
;; |
339 |
|
|
341 |
|
|
340 | 342 |
stop) |
341 | 343 |
check_dev_null |
342 | 344 |
stop_workers |
343 | 345 |
;; |
344 |
|
|
346 |
|
|
345 | 347 |
reload|force-reload) |
346 | 348 |
echo "Use restart" |
347 | 349 |
;; |
348 |
|
|
350 |
|
|
349 | 351 |
status) |
350 | 352 |
$CELERYCTL status $CELERYCTL_OPTS |
351 | 353 |
;; |
352 |
|
|
354 |
|
|
353 | 355 |
restart) |
354 | 356 |
check_dev_null |
355 | 357 |
restart_workers |
356 | 358 |
;; |
357 |
|
|
359 |
|
|
358 | 360 |
try-restart) |
359 | 361 |
check_dev_null |
360 | 362 |
restart_workers |
361 | 363 |
;; |
362 |
|
|
364 |
|
|
363 | 365 |
*) |
364 | 366 |
echo "Usage: /etc/init.d/celeryd {start|stop|restart|try-restart|kill}" |
365 | 367 |
exit 1 |
366 | 368 |
;; |
367 | 369 |
esac |
368 |
|
|
370 |
|
|
369 | 371 |
exit 0 |
370 | 372 |
|
371 | 373 |
celeryd configuration |
... | ... | |
379 | 381 |
|
380 | 382 |
# Default: false |
381 | 383 |
ENABLED="true" |
382 |
|
|
384 |
|
|
383 | 385 |
# Name of nodes to start, here we have a single node |
384 | 386 |
CELERYD_NODES="w1" |
385 | 387 |
# or we could have three nodes: |
386 | 388 |
#CELERYD_NODES="w1 w2 w3" |
387 |
|
|
389 |
|
|
388 | 390 |
# Where to chdir at start. |
389 | 391 |
CELERYD_CHDIR="/srv/flowspy" |
390 | 392 |
# How to call "manage.py celeryd_multi" |
391 | 393 |
CELERYD_MULTI="python $CELERYD_CHDIR/manage.py celeryd_multi" |
392 |
|
|
394 |
|
|
393 | 395 |
# How to call "manage.py celeryctl" |
394 | 396 |
CELERYCTL="python $CELERYD_CHDIR/manage.py celeryctl" |
395 |
|
|
397 |
|
|
396 | 398 |
# Extra arguments to celeryd |
397 | 399 |
#CELERYD_OPTS="--time-limit=300 --concurrency=8" |
398 | 400 |
CELERYD_OPTS="-E -B --schedule=/var/run/celery/celerybeat-schedule --concurrency=1 --soft-time-limit=180 --time-limit=1800" |
399 | 401 |
# Name of the celery config module. |
400 | 402 |
CELERY_CONFIG_MODULE="celeryconfig" |
401 |
|
|
403 |
|
|
402 | 404 |
# %n will be replaced with the nodename. |
403 | 405 |
CELERYD_LOG_FILE="/var/log/celery/fod_%n.log" |
404 | 406 |
CELERYD_PID_FILE="/var/run/celery/%n.pid" |
405 |
|
|
407 |
|
|
406 | 408 |
CELERYD_USER="root" |
407 | 409 |
CELERYD_GROUP="root" |
408 |
|
|
410 |
|
|
409 | 411 |
# Name of the projects settings module. |
410 | 412 |
export DJANGO_SETTINGS_MODULE="flowspy.settings" |
411 | 413 |
|
... | ... | |
421 | 423 |
ServerAdmin webmaster@localhost |
422 | 424 |
ServerName fod.example.com |
423 | 425 |
DocumentRoot /var/www |
424 |
|
|
426 |
|
|
425 | 427 |
ErrorLog ${APACHE_LOG_DIR}/fod_error.log |
426 |
|
|
428 |
|
|
427 | 429 |
# Possible values include: debug, info, notice, warn, error, crit, |
428 | 430 |
# alert, emerg. |
429 | 431 |
LogLevel debug |
430 |
|
|
432 |
|
|
431 | 433 |
CustomLog ${APACHE_LOG_DIR}/fod_access.log combined |
432 |
|
|
434 |
|
|
433 | 435 |
Alias /static /srv/flowspy/static |
434 | 436 |
RewriteEngine On |
435 | 437 |
RewriteCond %{HTTPS} off |
436 | 438 |
RewriteRule ^/(.*) https://fod.example.com/$1 [L,R] |
437 | 439 |
</VirtualHost> |
438 |
|
|
440 |
|
|
439 | 441 |
<VirtualHost *:443> |
440 | 442 |
ServerName fod.example.com |
441 | 443 |
ServerAdmin webmaster@localhost |
442 | 444 |
ServerSignature On |
443 |
|
|
445 |
|
|
444 | 446 |
SSLEngine on |
445 | 447 |
SSLCertificateFile /etc/ssl/certs/fod.example.com.crt |
446 | 448 |
SSLCertificateChainFile /etc/ssl/certs/example-chain.pem |
447 | 449 |
SSLCertificateKeyFile /etc/ssl/private/fod.example.com.key |
448 |
|
|
450 |
|
|
449 | 451 |
AddDefaultCharset UTF-8 |
450 | 452 |
IndexOptions +Charset=UTF-8 |
451 |
|
|
453 |
|
|
452 | 454 |
ShibConfig /etc/shibboleth/shibboleth2.xml |
453 | 455 |
Alias /shibboleth-sp /usr/share/shibboleth |
454 |
|
|
455 |
|
|
456 |
|
|
457 |
|
|
456 | 458 |
<Location /login> |
457 | 459 |
AuthType shibboleth |
458 | 460 |
ShibRequireSession On |
... | ... | |
460 | 462 |
ShibRequestSetting entityID https://idp.example.com/idp/shibboleth |
461 | 463 |
require valid-user |
462 | 464 |
</Location> |
463 |
|
|
465 |
|
|
464 | 466 |
# Shibboleth debugging CGI script |
465 | 467 |
ScriptAlias /shibboleth/test /usr/lib/cgi-bin/shibtest.cgi |
466 | 468 |
<Location /shibboleth/test> |
... | ... | |
469 | 471 |
ShibUseHeaders On |
470 | 472 |
require valid-user |
471 | 473 |
</Location> |
472 |
|
|
474 |
|
|
473 | 475 |
<Location /Shibboleth.sso> |
474 | 476 |
SetHandler shib |
475 | 477 |
</Location> |
476 |
|
|
478 |
|
|
477 | 479 |
# Shibboleth SP configuration |
478 |
|
|
480 |
|
|
479 | 481 |
#SetEnv proxy-sendchunked |
480 |
|
|
482 |
|
|
481 | 483 |
<Proxy *> |
482 | 484 |
Order allow,deny |
483 | 485 |
Allow from all |
484 | 486 |
</Proxy> |
485 |
|
|
487 |
|
|
486 | 488 |
SSLProxyEngine off |
487 | 489 |
ProxyErrorOverride off |
488 | 490 |
ProxyTimeout 28800 |
489 | 491 |
ProxyPass /static ! |
490 | 492 |
ProxyPass /shibboleth ! |
491 | 493 |
ProxyPass /Shibboleth.sso ! |
492 |
|
|
494 |
|
|
493 | 495 |
ProxyPass / http://localhost:8081/ retry=0 |
494 | 496 |
ProxyPassReverse / http://localhost:8081/ |
495 |
|
|
497 |
|
|
496 | 498 |
Alias /static /srv/flowspy/static |
497 |
|
|
499 |
|
|
498 | 500 |
LogLevel warn |
499 |
|
|
501 |
|
|
500 | 502 |
ErrorLog ${APACHE_LOG_DIR}/fod_error.log |
501 | 503 |
CustomLog ${APACHE_LOG_DIR}/fod_access.log combined |
502 |
|
|
504 |
|
|
503 | 505 |
</VirtualHost> |
504 | 506 |
|
505 | 507 |
Now, enable your site. You might want to disable the default site if fod is the only site you host on your server:: |
... | ... | |
515 | 517 |
python manage.py migrate flowspec |
516 | 518 |
python manage.py migrate djcelery |
517 | 519 |
python manage.py migrate accounts |
520 |
python manage.py migrate |
|
518 | 521 |
|
519 | 522 |
If you have not changed the values of the PEER\_\*\_TABLE variables to False and thus you are going for a default installation (that is PEER\_\*\_TABLE variables are set to True) , then run:: |
520 |
|
|
523 |
|
|
521 | 524 |
python manage.py migrate peers |
522 | 525 |
|
523 | 526 |
If however you have set the PEER\_\*\_TABLE variables to False and by accident you have ran the command above, then you have to cleanup you database manually by dropping the peer\* tables plus the techc_email table. For MySQL the command is:: |
524 |
|
|
525 |
DROP TABLE `peer`, `peer_networks`, `peer_range`, `peer_techc_emails`, techc_email;
|
|
527 |
|
|
528 |
DROP TABLE `peer`, `peer_networks`, `peer_range`, `peer_techc_emails`, techc_email; |
|
526 | 529 |
|
527 | 530 |
Restart, gunicorn and apache:: |
528 | 531 |
|
... | ... | |
531 | 534 |
|
532 | 535 |
Propagate the flatpages |
533 | 536 |
======================= |
534 |
Inside the initial_data/fixtures_manual.xml file we have placed 4 flatpages (2 for Greek, 2 for English) with Information and Terms of Service about the service.
|
|
537 |
Inside the initial_data/fixtures_manual.xml file we have placed 4 flatpages (2 for Greek, 2 for English) with Information and Terms of Service about the service. |
|
535 | 538 |
To import the flatpages, run from root folder:: |
536 | 539 |
|
537 | 540 |
python manage.py loaddata initial_data/fixtures_manual.xml |
Also available in: Unified diff