Server Setup - nicholasdavidson/pybit GitHub Wiki

To configure the pybit-web application:

Before you start

  • Double check that any dependencies are installed.
  • Make sure you have the hostnames and credentials of the RabbitMQ and PostreSQL servers to hand.

Configuring the database

  • Create a database and user on the database server.

Pybit currently only supports postgres, there are long term plans to support more database backends but for now here is a step-by-step set of instructions for deploying a postgres database on Debian/Ubuntu

  • Run the database install scripts - schema.sql and populate.sql
  • Edit configs/web.conf to use the appropriate values in the "db" section.

NOTE: You may need to do CREATE LANGUAGE plpgsql;

Configuring the server's options

  • Edit the "web" section of configs/web.conf as required.
  • For production, set "debug" to false, and specify the interface you want to listen on, and a port.
  • (For debugging on your workstation, 127.0.0.1:8080 with "debug" and "reloader" set to true is a good choice, whereas 0.0.0.0:80, with these options turned off, is a good, secure choice for production servers.)
  • Set the "hostname" field to your FQDN.

Configuring the controller

  • Edit the "controller" section of configs/web.conf as required - Enter the hostname and port of your rabbitmq server under "rabbit_url".
  • Note that the "webserver_url" field in the "controller" section must point to the hostname and port you set in the "web" section.

Deploying the server

  • If you want to use mod_wsgi to serve pages using apache, then modify the sample apache_config.txt with the appropriate values, and configure the virtual host. Also, make sure you have "WSGIPassAuthorization On", or basic authentication wont work.
  • You can set "jqueryurl" and "jqueryformurl" to point at where you want to get these resources from. If present in "/usr/share/javascript/jquery/" and "/usr/share/javascript/jquery-form/", these will be served on ~/resources/jquery.min.js and ~/resources/jquery.form.min.js