Skip to content

Commit

Permalink
Fix spelling mistakes in configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga committed May 14, 2018
1 parent ee58546 commit 70aec36
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 44 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -2,4 +2,4 @@ blank:
@echo "Downloading ona core dependencies and running migrations for you (hopefully into a virtualenv)... \n (This will take a while, go grab a coffee or something.)\n\n"
python -m pip install -r requirements/base.pip
python manage.py migrate
@echo "Start the app with \`python` manage.py runserver --nothreading\`"
@echo "Start the app with \`python manage.py runserver --nothreading\`"
29 changes: 16 additions & 13 deletions docs/install.rst
Expand Up @@ -6,8 +6,16 @@ Get the code

.. code-block:: sh
# create onadata user account
useradd -m onadata -G www-data
git clone https://github.com/onaio/onadata.git
cd onadata
# move onadata to /srv/onadata and
# make sure onadata user has permissions
sudo mv onadata /srv/onadata
sudo chown -R onadata:www-data /srv/onadata/
cd /srv/onadata
Prepare OS
----------
Expand Down Expand Up @@ -38,20 +46,16 @@ Make sure you have a ``onadata/settings/local_settings.py`` file.

.. code-block:: sh
cp onadata/settings/default_settings.py and onadata/settings/local_settings.py
cp onadata/settings/default_settings.py onadata/settings/local_settings.py
# update the DATABASE and SECRET_KEY settings accordingly.
.. note::

This file is usually gitignored.

Set up and start your virtual environment or sandbox
----------------------------------------------------

.. code-block:: sh
virtualenv .venv
source .venv/bin/activate
virtualenv .virtualenv
source .virtualenv/bin/activate
Run make to set up onadata and for initial db setup
---------------------------------------------------
Expand Down Expand Up @@ -91,19 +95,18 @@ Setup uwsgi init script
.. code-block:: sh
pip install uwsgi
# edit uwsgi.ini and onadat.conf accrodingly, change paths and configurations accordingly.
sudo cp script/etc/init/onadata.conf /etc/init/onadata.conf
# edit uwsgi.ini and onadata.service accrodingly, change paths and configurations accordingly.
sudo cp script/etc/systemd/system/onadata.service /etc/systemd/system/onadata.service
# start the onadata service
sudo start onadata
sudo systemctl start onadata.servicea
# check that it started ok
# cat /path/to/onadata.log
sudo systemctl status onadata.servicea
Setup celery service
--------------------

.. code-block:: sh
sudo apt-get install rabbitmq-server
# edit script/etc/default/celeryd-ona with correct paths and user, group
sudo cp script/etc/default/celeryd-generic /etc/default/celeryd-onadata
sudo cp script/etc/default/celerybeat-generic /etc/default/celerybeat-onadata
Expand Down
3 changes: 3 additions & 0 deletions onadata/settings/default_settings.py
Expand Up @@ -9,6 +9,9 @@
# settings.py)
from staging_example import * # noqa


ALLOWED_HOSTS = ['*']

# # # now override the settings which came from staging # # # #
DATABASES = {
'default': {
Expand Down
8 changes: 4 additions & 4 deletions script/etc/default/celerybeat-generic
Expand Up @@ -18,10 +18,10 @@ CELERYBEAT_GROUP="onadata"
C_FORCE_ROOT=1
CELERY_CREATE_DIRS=1
CELERYBEAT_LOG_LEVEL="INFO"
CELERYBEAT_LOG_FILE="/var/log/onadata/celerybeat.log"
CELERYBEAT_SCHEDULE="/var/run/onadata/celerybeat-schedule"
CELERYBEAT_STATE_DIR="/var/run/onadata/celerybeat"
CELERYBEAT_PID_FILE="/var/run/onadata/celerybeat.pid"
CELERYBEAT_LOG_FILE="/var/log/celery-onadata/beat.log"
CELERYBEAT_SCHEDULE="/var/run/celery-onadata/beat-schedule"
CELERYBEAT_STATE_DIR="/var/run/celery-onadata/beat"
CELERYBEAT_PID_FILE="/var/run/celery-onadata/beat.pid"
# Name of the projects settings module.
# in this case is just settings and not the full path because it will change the dir to
# the project folder first.
Expand Down
8 changes: 4 additions & 4 deletions script/etc/default/celeryd-generic
Expand Up @@ -14,19 +14,19 @@ ENV_PYTHON="/srv/onadata/.virtualenv/bin/python"
#CELERYCTL="$ENV_PYTHON $CELERYD_CHDIR/manage.py celeryctl"
CELERY_BIN="/srv/onadata/.virtualenv/bin/celery"
# Extra arguments to celeryd
CELERYD_OPTS="-Ofair --concurrency=4 --autscalse=4,1 -Q:default celert -Q:export-node exports -Q:publish-xls-form-node publish_xlsform"
CELERYD_OPTS="-Ofair --concurrency=4 --autoscale=4,1 -Q:default celert -Q:export-node exports -Q:publish-xls-form-node publish_xlsform"

CELERY_APP="onadata.celery"
# Name of the celery config module, don't change this.
#CELERY_CONFIG_MODULE="celeryconfig"

# %n will be replaced with the nodename.
CELERYD_LOG_FILE="/var/log/onadata/celery-%n.log"
CELERYD_PID_FILE="/run/onadata/celery-%n.pid"
CELERYD_LOG_FILE="/var/log/celery-onadata/celery-%n.log"
CELERYD_PID_FILE="/run/celery-onadata/celery-%n.pid"

# Workers should run as an unprivileged user.
CELERYD_USER="onadata"
CELERYD_GROUP="onadata"
CELERYD_GROUP="www-data"

CELERY_CREATE_DIRS=1
C_FORCE_ROOT=1
Expand Down
19 changes: 0 additions & 19 deletions script/etc/init/onadata.conf

This file was deleted.

6 changes: 3 additions & 3 deletions script/etc/nginx/sites-available/onadata
Expand Up @@ -6,7 +6,7 @@ server {
# server block/virtual host name
server_name onadata.local;

access_log /var/log/onadata/nginx-access.log timed_combined;
access_log /var/log/onadata/nginx-access.log;
error_log /var/log/onadata/nginx-error.log;

# entity size
Expand All @@ -19,10 +19,10 @@ server {

location / {
# uwsgi backend
uwsgi_pass unix:///var/run/onadaya/onadata.sock;
uwsgi_pass unix:///var/run/onadata/onadata.sock;
include uwsgi_params;
proxy_read_timeout 300s;
uwsgi_read_timeout 300s};
uwsgi_read_timeout 300s;

# no redirects
proxy_redirect off;
Expand Down
15 changes: 15 additions & 0 deletions script/etc/systemd/system/onadata.service
@@ -0,0 +1,15 @@
[Unit]
Description=uWSGI onadata web app
After=network.target

[Service]
Type=notify
Restart=on-failure
RuntimeDirectory=onadata
WorkingDirectory=/srv/onadata
User=onadata
Group=www-data
ExecStart=/srv/onadata/.virtualenv/bin/uwsgi --ini /srv/onadata/uwsgi.ini --env DJANGO_SETTINGS_MODULE=onadata.settings.common --socket=/var/run/onadata/onadata.sock --pidfile=/var/run/onadata/onadata.pid --chmod-socket=664

[Install]
WantedBy=multi-user.target

0 comments on commit 70aec36

Please sign in to comment.