You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.0 KiB

WSGI Application in Apache

Install apache2 and libapache2-mod-wsgi

We’ll set up the server at URL The process will run as user nilm, group nilm.

First, create a WSGI script /home/nilm/nilmrun.wsgi containing:

import nilmrun.server
application = nilmrun.server.wsgi_application("/nilmrun")

The first parameter is the path part of the URL.

Then, set up Apache with a configuration like below. SSL and access control/authentication are strongly recommended since this can execute arbitrary commands.

<VirtualHost *:443>
    SSLEngine On

    WSGIScriptAlias /nilmrun /home/nilm/nilmrun.wsgi
    WSGIDaemonProcess nilmrun-procgroup threads=32 user=nilm group=nilm
    <Location /nilmrun>
        WSGIProcessGroup nilmrun-procgroup
        WSGIApplicationGroup nilmrun-appgroup

        # Access control example:
        Order deny,allow
        Deny from all
        Allow from