Re: Looking for documention on deploying roundup with mod_wsgi

Thomas Arendsen Hein <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
* John P. Rouillard <[email protected]> [20191002 23:50]:
> It looks like mod_wsgi is a suitable replacement however:
>
>   https://issues.roundup-tracker.org/issue2550566
>
> points out we have no documention to use mod_wsgi. Does anybody have
> directions similar to:
>
>   http://roundup-tracker.org/docs/installation.html#apache-http-server-with-mod-python
>
> that they can share to get some docs set up for mod_wsgi?

Not with so much detail, but here are some snippets that might be
useful:

On Debian install apache2 with libapache2-mod-wsgi

/etc/apache2/sites-available/roundup:

    ServerAdmin [email protected]
    ErrorLog /var/log/apache2/error.log

    LogLevel notice

    DocumentRoot /var/www/

    <VirtualHost *:80>
            CustomLog /var/log/apache2/access.log vhost_combined

            Alias /doc/ /home/roundup/install/share/doc/roundup/html/

            Alias /foo/@@file/ /srv/roundup/foo/html/
            RedirectMatch permanent ^/(foo)$ /$1/
            WSGIDaemonProcess roundup-foo display-name=roundup-foo user=roundup-foo group=roundup-foo threads=25
            WSGIScriptAlias /foo /srv/roundup/foo/roundup.wsgi
            <Location /foo>
                    WSGIProcessGroup roundup-foo
            </Location>
    </VirtualHost>

(https can be configured here, too, but we do this elsewhere)

Use "a2ensite roundup" and "a2dissite default" to enable only the
roundup configuration.

Install roundup as user "roundup":

  python setup.py build_doc
  python setup.py sdist --manifest-only
  python setup.py install --home="/home/roundup/install" --force

User "roundup-foo" has the following things in /home/roundup-foo/:
- directory "db" (roundup data)
- symlink "instance" pointing to /srv/roundup/foo

Instances are created as user "roundup" below /srv/roundup/

/srv/roundup/foo/ contains the Roundup instance and the file
roundup.wsgi:

    import sys, os
    sys.stdout = sys.stderr

    enabled = True

    if enabled:
        sys.path.insert(0, '/home/roundup/install/lib/python')
        # obtain the WSGI request dispatcher
        from roundup.cgi.wsgi_handler import RequestDispatcher
        tracker_home = os.path.join(os.getcwd(), 'instance')
        application = RequestDispatcher(tracker_home)
    else:
        def application(environ, start_response):
            status = '503 Service Unavailable'
            output = 'service is down for maintenance'
            response_headers = [('Content-type', 'text/plain'),
                                ('Content-Length', str(len(output)))]
            start_response(status, response_headers)
            return [output]

(you can temporarily disable the tracker by setting "enabled = False",
 apache will automatically detect the changed wsgi file and reload it)

You can have additional users+trackers on the same system, e.g.
roundup-bar and roundup-baz, sharing the same roundup installation
but separate directories for data and instance.

Regards,

Thomas

-- 
Thomas Arendsen Hein <[email protected]>
OpenPGP key: https://intevation.de/~thomas/thomas_pgp.asc (0xD45DE28FF3A2250C)
Intevation GmbH, Neuer Graben 17, 49074 Osnabrueck - AG Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.