Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

linuxfoundation/foss-barcode

Repository files navigation

Using foss-barcode with apache/mod_wsgi
7/23/2010 Stew Benedict <stewb@linuxfoundation.org>

Instead of the built in django server, you can use apache and mod_wsgi fairly easily.

1) Put the foss-barcode tree under DocumentRoot (or anywhere accessible to apache, in the 
   example we use /var/www/html)

2) Edit settings.py and add the working directory to project_root_paths:

    project_root_paths = [ ".", "..", "/var/www/html/foss-barcode" ]

3) Edit http.conf or possibly a seperate conf for mod_wsgi (/etc/httpd/modules.d/B23_mod_wsgi.conf
   on this system):

    WSGIScriptAlias / /var/www/html/foss-barcode/fossbarcode/apache/django.wsgi

   The above line is required. The referenced file is provided by foss-barcode. There are 2
   sys.path.append entries you may need to modify for your setup.

   Some older versions of mod_wsgi will not work for applications using stdout (which foss-barcode
   does to communicate with the task-manager). If your version has this issue, you will want to
   add the following directive:

    WSGIRestrictStdout Off

   If you find performance to be slow, you may want to run wsgi in daemon mode:

    WSGIDaemonProcess example.com threads=25
    WSGIProcessGroup example.com

   More info on mod_wsgi configuration can be found here:

    http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

4) The sqlite database fossbarcode/barcode.sqlite must be writable by the user account running apache
   (apache on this system). The fossbarcode directory must also be writable by this user for both
   database journal and the task.log file used by the task manager.

Documentation for setting up django with mod_wsgi mentions serving the static media files by 
apache or another server, although in my experiments things seemed to work leaving things as they
are currently setup.