RunningDeepZoomServerOnApache
Pages 15
Clone this wiki locally
To install the deepzoom_server.py example server as a WSGI application in Apache:
-
Copy
deepzoom_server.pyand thestaticandtemplatesdirectories to a directory accessible by Apache. Createdeepzoom.wsgiwith 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.
-
Add the following to your Apache configuration, in
/etc/apache2/sites-available/or wherever your site configuration is located. If you have an existingVirtualHostconfiguration, you can copy the 3 WSGI lines into your existingVirtualHostsection.<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.
- Restart Apache.