Auto-tools/Projects/GrafxBot/Install

From MozillaWiki
Jump to navigation Jump to search

Installing GrafxBot servers

Prerequisites

Installation Steps

  1. Download the Django GrafxBot app:
 hg clone http://bitbucket.org/jonallengriffin/resultserv
  1. Edit resultserv/settings.py, and update DATABASE_USER, DATABASE_PASSWORD, and DATABASE_HOST as appropriate.
  2. Create a database named 'resultserv' in MySQL.
  3. In the resultserv directory, enter the following command; this should generate the necessary SQL tables. When prompted for a superuser, add one of your choice.
  python manage.py syncdb

5. Edit your web site's config to serve files for the /resultserv/ url. The way this is done varies depending on your webserver, for nginx this involes adding a block like this to your nginx.conf:

       location ~ ^/resultserv/media/(.*)$ {
         alias /path/to/resultserv/media/$1;
       }
       location /resultserv {
         fastcgi_pass 127.0.0.1:8090;
         fastcgi_param PATH_INFO $fastcgi_script_name;
         fastcgi_param REQUEST_METHOD $request_method;
         fastcgi_param QUERY_STRING $query_string;
         fastcgi_param CONTENT_TYPE $content_type;
         fastcgi_param SERVER_NAME $server_name;
         fastcgi_param SERVER_PORT $server_port;
         fastcgi_param SERVER_PROTOCOL $server_protocol;
         fastcgi_param CONTENT_LENGTH $content_length;
         fastcgi_pass_header Authorization;
         fastcgi_intercept_errors off;
       }

6. Start the Django GrafxBot server. The command used to do this varies on your website's configuration, but for nginx and the config block above, this might be:

 python manage.py runfcgi method=threaded host=127.0.0.1 port=8090

7. Start the GrafxBot data insertion daemon:

 python insert.py --pidfile=/usr/local/logs/insert.pid --logfile=/usr/local/logs/insert.log

updating the --pidfile and --logfile path as needed; make sure the specified paths exist.