Skip to content

Debian installation

Jonathan Beliën edited this page Oct 8, 2016 · 2 revisions

Small steps on how I install it on Debian Jessie 8.0

Requirements

sudo apt-get install git 
sudo apt-get install python-pip python-dev python-virtualenv
sudo apt-get install postgresql-9.5 postgresql-9.5-postgis-2.2 postgresql-server-dev-9.5

Installation

git clone --recursive git://github.com/hotosm/osm-tasking-manager2.git
cd osm-tasking-manager2
virtualenv --no-site-packages env
./env/bin/pip install -r requirements.txt
sudo -u postgres createuser -SDRP www-data
sudo -u postgres createdb -T template0 osmtm -E UTF8 -O www-data
sudo -u postgres psql -d osmtm -c "CREATE EXTENSION postgis;"
nano local.ini

Enter those following lines in local.ini file (do not forget to edit PASSWORD) :

[app:main]
sqlalchemy.url = postgresql://www-data:PASSWORD@localhost/osmtm
default_comment_prefix = #yourinstancename-project
./env/bin/initialize_osmtm_db

Testing installation

./env/bin/pserve --reload development.ini

You will see messages, hopefully including a line like serving on http://0.0.0.0:6543. Visit that address in your web browser - you should see your local Tasking Manager!

Serve Task Manager "behind" Apache HTTP server

sudo apt-get install apache2 libapache2-mod-wsgi

Configuration file

WSGIDaemonProcess OSMTM_process user=admin group=admin processes=1 \
        threads=4 \
        python-path=/home/admin/osm-tasking-manager2:/home/admin/osm-tasking-manager2/env/lib/python2.7/site-packages
WSGIRestrictStdin Off

<VirtualHost *:80>
        ServerName example.org
        # Use only 1 Python sub-interpreter.  Multiple sub-interpreters
        # play badly with C extensions.
        WSGIPassAuthorization On
        WSGIScriptAlias /osmtm /home/admin/osm-tasking-manager2/production.wsgi

        <Location />
            WSGIProcessGroup OSMTM_process
            WSGIApplicationGroup %{GLOBAL}
        </Location>

        <Directory /home/admin/osm-tasking-manager2>
            <Files production.wsgi>
                Require all granted
            </Files>
            Order allow,deny
            Allow from all
        </Directory>

        LogLevel warn

        CustomLog /var/log/apache2/osmtm-access.log combined
        ErrorLog /var/log/apache2/osmtm-error.log
</VirtualHost>

Warning: You also will have to "fix" the path to production.ini in production.wsgi file. This production.ini file is supposed to be next to production.wsgi file in osm-tasking-manager2 folder.