powerdns: Define a application variable when not invoked from Shell

This allows to be run directly using mod_wsgi behind Apache.
This commit is contained in:
Wido den Hollander 2014-08-05 16:10:45 +02:00
parent 541006c83d
commit f773b24e25
2 changed files with 16 additions and 2 deletions

View File

@ -48,4 +48,14 @@ Should return something like:
]
}
## WSGI
## WSGI
You can run this backend directly behind an Apache server with mod_wsgi
WSGIScriptAlias / /var/www/pdns-backend-rgw.py
Placing that in your virtualhost should be sufficient.
Afterwards point PowerDNS to localhost on port 80:
launch=remote
remote-connection-string=http:url=http://localhost/dns

View File

@ -276,4 +276,8 @@ app.debug = config['debug']
# Only run the App if this script is invoked from a Shell
if __name__ == '__main__':
app.run(host=config['listen']['addr'], port=config['listen']['port'])
app.run(host=config['listen']['addr'], port=config['listen']['port'])
# Otherwise provide a variable called 'application' for mod_wsgi
else:
application = app