RunningDeepZoomServerOnApache

Benjamin Gilbert edited this page Jan 13, 2014 · 2 revisions

To install the deepzoom_server.py example server as a WSGI application in Apache:

  1. Copy deepzoom_server.py and the static and templates directories to a directory accessible by Apache. Create deepzoom.wsgi with these contents:

     import os, sys
     from deepzoom_server import app as application
     application.config.update({
         'DEEPZOOM_SLIDE': '/full/path/to/slide',
     })
    

Set DEEPZOOM_SLIDE to the path to your slide file.

  1. Add the following to your Apache configuration, in /etc/apache2/sites-available/ or wherever your site configuration is located. If you have an existing VirtualHost configuration, you can copy the 3 WSGI lines into your existing VirtualHost section.

     <VirtualHost *>
         WSGIDaemonProcess application threads=5 python-path=</path/to/directory/containing/deepzoom_server.py> user=<specify> group=<specify>
         WSGIProcessGroup application
         WSGIScriptAlias / </path/to/deepzoom.wsgi>
     </VirtualHost>
    

Edit the above configuration to set the paths to deepzoom.wsgi and deepzoom_server.py. Also set the user and group under which the daemon will run, or remove the user and group directives to run the daemon under the Apache user account (e.g. www-data). Ensure the slide file is readable by the selected user.

If you don't want the slide to appear at the root of the virtual server, you can modify the WSGIScriptAlias directive. For example, change / to /some/path/ to publish the slide viewer at http://www.example.com/some/path/.

You can also customize the number of worker threads.

  1. Restart Apache.