Browse Source

Fix wsgi documentation

tags/nilmdb-1.4.4^0
Jim Paris 11 years ago
parent
commit
e01813f29d
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      docs/wsgi.md

+ 7
- 4
docs/wsgi.md View File

@@ -5,19 +5,22 @@ Install `apache2` and `libapache2-mod-wsgi`

We'll set up the database server at URL `http://myhost.com/nilmdb`.
The database will be stored in `/home/nilm/db`, and the process will
run as user `nilm`.
run as user `nilm`, group `nilm`.

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

import nilmdb.server
application = nilmdb.server.wsgi_application("/home/nilm/db")
application = nilmdb.server.wsgi_application("/home/nilm/db", "/nilmdb")

The first parameter is the local filesystem path, and the second
parameter is the path part of the URL.

Then, set up Apache with a configuration like:

<VirtualHost>
WSGIScriptAlias /nilmdb /home/nilm/nilmdb.wsgi
WSGIProcessGroup nilmdb
WSGIDaemonProcess nilmdb threads=32 user=nilm
WSGIProcessGroup nilmdb-server
WSGIDaemonProcess nilmdb-server threads=32 user=nilm group=nilm

# Access control example:
<Location /nilmdb>


Loading…
Cancel
Save