====== Running Pootle on Apache ======
===== Pootle 2.0: mod_python or mod_wsgi =====
Running Pootle under Apache requires [[http://www.modpython.org/|mod_python]] or [[http://code.google.com/p/modwsgi/|mod_wsgi]]. ''mod_wsgi'' is recommended.
You need to extract Pootle in a directory accessible to the apache user.
Make sure Apache has read access to all of Pootle's files and write access to the ''dbs'' and ''po'' subdirectories.
Depending on which apache module you'll use to deploy pootle, you need to add the relevant portion to your apache's configuration.
==== mod_wsgi ====
# point at the wsgi loader script
WSGIScriptAlias /pootle /var/www/Pootle/wsgi.py
# directly serve static files like css and images, no need to go through mod_wsgi and django
Alias /pootle/html /var/www/Pootle/html
Order deny,allow
Allow from all
# Allow downloading translation files directly
Alias /pootle/export /var/www/Pootle/po
Order deny,allow
Allow from all
[[http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/|more info]]
==== mod_python ====
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE pootle.settings
PythonOption django.root /pootle
PythonPath "['/var/www/Pootle', '/var/www/Pootle/local_apps', '/var/www/Pootle/external_apps'] + sys.path"
PythonInterpreter pootle
PythonDebug On
SetHandler None
Order deny,allow
Allow from all
[[http://docs.djangoproject.com/en/1.0/howto/deployment/modpython/|more info]] regarding Django on mod_python.
**Note:** If you run Pootle at the root of your web server, do **not** set ''PythonOption django.root'' to ''/''. Rather, do not set that option at all (comment out or delete the entire line from the config).
===== Pootle 1.2: mod_proxy =====
**This is the preferred way to run Pootle 1.2. Keep in mind that this is not the only way to run Pootle.**
A Pootle Web-translation server is made up of static and dynamic content. By default Pootle serves all content, for low-latency purposes it is better to get Apache to serve the content that does not change, the static content. It is just the issue of low latency and making the translation experience more interactive that calls you to proxy through Apache. The following steps show you how to setup Pootle to proxy through Apache.
Most of the documentation below assumes that you are using Apache 2 and that your configuration is stored in ///etc/apache2// with the configuration as is common in Debian based systems. Furthermore it assumes that the Pootle server is running on the same host as Apache and is listening on port 8080. On other systems, the configuration might be in ///etc/httpd/// with module configuration in ///etc/httpd/modules.d/// or similar.
To begin with, you might need to enable mod_proxy on Apache. First ensure that mod_proxy is available by checking for the file ///etc/apache2/mods-available/proxy.conf//. To ensure that all the modules are enabled, make sure that the necessary proxy modules are linked from ///etc/apache2/mods-enabled///. You will probably need the following modules:
* proxy.conf
* proxy.load
* proxy_http.load
Now authorise proxy requests in proxy.conf otherwise you could end up with an unreachable web site and messages such as ''client denied by server configuration: proxy:http://localhost:8080/'' in your log files:
Order Allow,Deny
Allow from localhost
Here is an example //httpd.conf// to create a virtual host for Pootle and also proxy through from Apache to the Pootle port. This might be suitable for putting in ///etc/apache2/sites-available///, ///etc/httpd/conf/vhosts.d/// or similar.
ServerName pootle.locamotion.org
ServerAlias pootle.sjsoft.com
ServerAlias www.wordforge.org
ServerAlias wordforge.org
ProxyPass /images !
ProxyPass /js !
ProxyPass /pootle.css !
ProxyPass /favicon.ico !
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
Order deny,allow
Allow from all
ErrorLog logs/pootle-error_log
CustomLog logs/pootle-access_log common
# Fallback for static html content
DocumentRoot "/usr/lib/python2.4/site-packages/Pootle/html/"
Order deny,allow
Allow from all
With Apache 1.3, the ProxyPass directive does not support !. You must replace these ! by a url (e.g. %%Proxypass /images http://localhost/pootle/images%%).