Skip to content
Snippets Groups Projects
Commit 30fd5393 authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Update installation docs and version

parent 7aa06e71
No related branches found
No related tags found
No related merge requests found
VERSION = '0.9.8' VERSION = '0.9.9'
if __name__ == "__main__": if __name__ == "__main__":
print VERSION print VERSION
...@@ -26,13 +26,14 @@ Note: Set username and password for mysql if used ...@@ -26,13 +26,14 @@ Note: Set username and password for mysql if used
Note: If you wish to deploy an outgoing mail server, now it is time to do Note: If you wish to deploy an outgoing mail server, now it is time to do
it. Otherwise you could set FoD to send out mails via a third party it. Otherwise you could set FoD to send out mails via a third party
account account
Create a database Create a database
----------------- -----------------
If you are using mysql, you should create a database: If you are using mysql, you should create a database:
mysql -u root -p -e 'create database fod' mysql -u root -p -e 'create database fod'
Required application packages Required application packages
...@@ -191,159 +192,164 @@ manner so that locks are avoided on the flowspec capable device. In ...@@ -191,159 +192,164 @@ manner so that locks are avoided on the flowspec capable device. In
our setup celery runs via django. That is why the python-django-celery our setup celery runs via django. That is why the python-django-celery
package was installed. package was installed.
Create the celeryd daemon at /etc/init.d/celeryd:: Create the celeryd daemon at /etc/init.d/celeryd:
#!/bin/sh -e
# ============================================ vim /etc/init.d/celeryd
# celeryd - Starts the Celery worker daemon.
# ============================================ The configuration should be:
#
# :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status} #!/bin/sh -e
# :Configuration file: /etc/default/celeryd # ============================================
# # celeryd - Starts the Celery worker daemon.
# See http://docs.celeryq.org/en/latest/cookbook/daemonizing.html#init-script-celeryd # ============================================
#
# :Usage: /etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status}
### BEGIN INIT INFO # :Configuration file: /etc/default/celeryd
# Provides: celeryd #
# Required-Start: $network $local_fs $remote_fs # See http://docs.celeryq.org/en/latest/cookbook/daemonizing.html#init-script-celeryd
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6 ### BEGIN INIT INFO
# Short-Description: celery task worker daemon # Provides: celeryd
### END INIT INFO # Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
#set -e # Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
DEFAULT_PID_FILE="/var/run/celeryd@%n.pid" # Short-Description: celery task worker daemon
DEFAULT_LOG_FILE="/var/log/celeryd@%n.log" ### END INIT INFO
DEFAULT_LOG_LEVEL="INFO"
DEFAULT_NODES="celery" #set -e
DEFAULT_CELERYD="-m celery.bin.celeryd_detach"
DEFAULT_PID_FILE="/var/run/celeryd@%n.pid"
# /etc/init.d/celeryd: start and stop the celery task worker daemon. DEFAULT_LOG_FILE="/var/log/celeryd@%n.log"
DEFAULT_LOG_LEVEL="INFO"
CELERY_DEFAULTS=${CELERY_DEFAULTS:-"/etc/default/celeryd"} DEFAULT_NODES="celery"
DEFAULT_CELERYD="-m celery.bin.celeryd_detach"
test -f "$CELERY_DEFAULTS" && . "$CELERY_DEFAULTS"
if [ -f "/etc/default/celeryd" ]; then # /etc/init.d/celeryd: start and stop the celery task worker daemon.
. /etc/default/celeryd
fi CELERY_DEFAULTS=${CELERY_DEFAULTS:-"/etc/default/celeryd"}
CELERYD_PID_FILE=${CELERYD_PID_FILE:-${CELERYD_PIDFILE:-$DEFAULT_PID_FILE}} test -f "$CELERY_DEFAULTS" && . "$CELERY_DEFAULTS"
CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-${CELERYD_LOGFILE:-$DEFAULT_LOG_FILE}} if [ -f "/etc/default/celeryd" ]; then
CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-${CELERYD_LOGLEVEL:-$DEFAULT_LOG_LEVEL}} . /etc/default/celeryd
CELERYD_MULTI=${CELERYD_MULTI:-"celeryd-multi"} fi
CELERYD=${CELERYD:-$DEFAULT_CELERYD}
CELERYCTL=${CELERYCTL:="celeryctl"} CELERYD_PID_FILE=${CELERYD_PID_FILE:-${CELERYD_PIDFILE:-$DEFAULT_PID_FILE}}
CELERYD_NODES=${CELERYD_NODES:-$DEFAULT_NODES} CELERYD_LOG_FILE=${CELERYD_LOG_FILE:-${CELERYD_LOGFILE:-$DEFAULT_LOG_FILE}}
CELERYD_LOG_LEVEL=${CELERYD_LOG_LEVEL:-${CELERYD_LOGLEVEL:-$DEFAULT_LOG_LEVEL}}
export CELERY_LOADER CELERYD_MULTI=${CELERYD_MULTI:-"celeryd-multi"}
CELERYD=${CELERYD:-$DEFAULT_CELERYD}
if [ -n "$2" ]; then CELERYCTL=${CELERYCTL:="celeryctl"}
CELERYD_OPTS="$CELERYD_OPTS $2" CELERYD_NODES=${CELERYD_NODES:-$DEFAULT_NODES}
fi
export CELERY_LOADER
CELERYD_LOG_DIR=`dirname $CELERYD_LOG_FILE`
CELERYD_PID_DIR=`dirname $CELERYD_PID_FILE` if [ -n "$2" ]; then
if [ ! -d "$CELERYD_LOG_DIR" ]; then CELERYD_OPTS="$CELERYD_OPTS $2"
mkdir -p $CELERYD_LOG_DIR fi
fi
if [ ! -d "$CELERYD_PID_DIR" ]; then CELERYD_LOG_DIR=`dirname $CELERYD_LOG_FILE`
mkdir -p $CELERYD_PID_DIR CELERYD_PID_DIR=`dirname $CELERYD_PID_FILE`
fi if [ ! -d "$CELERYD_LOG_DIR" ]; then
mkdir -p $CELERYD_LOG_DIR
# Extra start-stop-daemon options, like user/group. fi
if [ -n "$CELERYD_USER" ]; then if [ ! -d "$CELERYD_PID_DIR" ]; then
DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERYD_USER" mkdir -p $CELERYD_PID_DIR
chown "$CELERYD_USER" $CELERYD_LOG_DIR $CELERYD_PID_DIR fi
fi
if [ -n "$CELERYD_GROUP" ]; then # Extra start-stop-daemon options, like user/group.
DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERYD_GROUP" if [ -n "$CELERYD_USER" ]; then
chgrp "$CELERYD_GROUP" $CELERYD_LOG_DIR $CELERYD_PID_DIR DAEMON_OPTS="$DAEMON_OPTS --uid=$CELERYD_USER"
fi chown "$CELERYD_USER" $CELERYD_LOG_DIR $CELERYD_PID_DIR
fi
if [ -n "$CELERYD_CHDIR" ]; then if [ -n "$CELERYD_GROUP" ]; then
DAEMON_OPTS="$DAEMON_OPTS --workdir=\"$CELERYD_CHDIR\"" DAEMON_OPTS="$DAEMON_OPTS --gid=$CELERYD_GROUP"
fi chgrp "$CELERYD_GROUP" $CELERYD_LOG_DIR $CELERYD_PID_DIR
fi
check_dev_null() { if [ -n "$CELERYD_CHDIR" ]; then
if [ ! -c /dev/null ]; then DAEMON_OPTS="$DAEMON_OPTS --workdir=\"$CELERYD_CHDIR\""
echo "/dev/null is not a character device!" fi
exit 1
fi
} check_dev_null() {
if [ ! -c /dev/null ]; then
echo "/dev/null is not a character device!"
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" exit 1
fi
}
stop_workers () {
$CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE"
}
start_workers () {
$CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
--pidfile="$CELERYD_PID_FILE" \
--logfile="$CELERYD_LOG_FILE" \
--loglevel="$CELERYD_LOG_LEVEL" \
--cmd="$CELERYD" \
$CELERYD_OPTS
}
restart_workers () {
$CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
--pidfile="$CELERYD_PID_FILE" \
--logfile="$CELERYD_LOG_FILE" \
--loglevel="$CELERYD_LOG_LEVEL" \
--cmd="$CELERYD" \
$CELERYD_OPTS
}
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
case "$1" in
start)
check_dev_null
start_workers
;;
stop)
check_dev_null
stop_workers
;;
reload|force-reload) stop_workers () {
echo "Use restart" $CELERYD_MULTI stop $CELERYD_NODES --pidfile="$CELERYD_PID_FILE"
;; }
status) start_workers () {
$CELERYCTL status $CELERYCTL_OPTS $CELERYD_MULTI start $CELERYD_NODES $DAEMON_OPTS \
;; --pidfile="$CELERYD_PID_FILE" \
--logfile="$CELERYD_LOG_FILE" \
--loglevel="$CELERYD_LOG_LEVEL" \
--cmd="$CELERYD" \
$CELERYD_OPTS
}
restart_workers () {
$CELERYD_MULTI restart $CELERYD_NODES $DAEMON_OPTS \
--pidfile="$CELERYD_PID_FILE" \
--logfile="$CELERYD_LOG_FILE" \
--loglevel="$CELERYD_LOG_LEVEL" \
--cmd="$CELERYD" \
$CELERYD_OPTS
}
restart)
check_dev_null
restart_workers
;;
try-restart)
check_dev_null
restart_workers
;;
*) case "$1" in
echo "Usage: /etc/init.d/celeryd {start|stop|restart|try-restart|kill}" start)
exit 1 check_dev_null
;; start_workers
esac ;;
exit 0 stop)
check_dev_null
stop_workers
;;
and make it executable:: reload|force-reload)
echo "Use restart"
;;
chmod +x /etc/init.d/celeryd status)
$CELERYCTL status $CELERYCTL_OPTS
;;
restart)
check_dev_null
restart_workers
;;
try-restart)
check_dev_null
restart_workers
;;
*)
echo "Usage: /etc/init.d/celeryd {start|stop|restart|try-restart|kill}"
exit 1
;;
esac
exit 0
and make it executable:
chmod +x /etc/init.d/celeryd
celeryd requires a /etc/default/celeryd file to be in place. Thus we celeryd requires a /etc/default/celeryd file to be in place. Thus we
are going to create this file (/etc/default/celeryd): are going to create this file (/etc/default/celeryd):
...@@ -522,6 +528,12 @@ be: ...@@ -522,6 +528,12 @@ be:
</VirtualHost> </VirtualHost>
Now, enable your site. You might want to disable the default site if
fod is the only site you host on your server:
a2dissite default
a2ensite fod
You are not far away from deploying FoD. When asked for a super user, You are not far away from deploying FoD. When asked for a super user,
create one: create one:
...@@ -544,10 +556,10 @@ AS: 16503, tag: TEST and move the network you have crteated from ...@@ -544,10 +556,10 @@ AS: 16503, tag: TEST and move the network you have crteated from
Avalable to Chosen. From the admin front, go to User, and edit your Avalable to Chosen. From the admin front, go to User, and edit your
user. From the bottom of the page, select the TEST peer and save. Last user. From the bottom of the page, select the TEST peer and save. Last
but not least, modify as required the existing (example.com) Site but not least, modify as required the existing (example.com) Site
instance. You are done. As you are logged-n via the admin, there is no instance (admin home->Sites). You are done. As you are logged-in via
need for Shibboleth. Go to https://<your ip>/fod/ and create a new the admin, there is no need for Shibboleth. Go to https://<your
rule. Your rule should be applied on the flowspec capable device after ip>/fod/ and create a new rule. Your rule should be applied on the
aprox. 10 seconds. flowspec capable device after aprox. 10 seconds.
Branding Branding
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment