]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
powerdns: Define a application variable when not invoked from Shell
authorWido den Hollander <wido@42on.com>
Tue, 5 Aug 2014 14:10:45 +0000 (16:10 +0200)
committerWido den Hollander <wido@42on.com>
Tue, 5 Aug 2014 14:33:03 +0000 (16:33 +0200)
This allows to be run directly using mod_wsgi behind Apache.

src/powerdns/README.md
src/powerdns/pdns-backend-rgw.py

index 7b4ce133478654b3e3cf4b8e1e139fc20ca1a5bb..cdae57e45ab0c1cdac6b54dff314c26facced88f 100644 (file)
@@ -48,4 +48,14 @@ Should return something like:
  ]
 }
 
-## WSGI
\ No newline at end of file
+## 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
\ No newline at end of file
index 382fe0ca57f4876eceebf14f6d3d1c7071887c04..a945052d98d1bf9528d8aa2e11c3b731fa50052d 100755 (executable)
@@ -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'])
\ No newline at end of file
+    app.run(host=config['listen']['addr'], port=config['listen']['port'])
+
+# Otherwise provide a variable called 'application' for mod_wsgi
+else:
+    application = app