WSGIRestrictEmbedded On
WSGIPythonOptimize 1

<VirtualHost *:80>
    # Domain for the Pootle server. Use 'localhost' for local deployments.
    #
    # If you want to deploy on example.com/your-pootle/ rather than in
    # my-pootle.example.com/ you will have to do the following changes to
    # this sample Apache configuration:
    #
    # - Change the ServerName directive to:
    #   ServerName example.com
    # - Change the WSGIScriptAlias directive to (note that /your-pootle must
    #   not end with a slash):
    #   WSGIScriptAlias /your-pootle /var/www/pootle/wsgi.py
    # - Change the Alias and Location directives for 'export', and the Alias
    #   directive for 'assets' to include the '/your-pootle'.
    # - Include the following setting in your custom Pootle settings:
    #   STATIC_URL = '/your-pootle/assets/'
    ServerName my-pootle.example.com

    # Set the 'POOTLE_SETTINGS' environment variable pointing at your custom
    # Pootle settings file.
    #
    # If you don't know which settings to include in this file you can use
    # the file '90-local.conf.sample' as a starting point. This file can be
    # found at '/var/www/pootle/env/lib/python2.7/site-packages/pootle/settings/'.
    #
    # Another way to specify your custom settings is to comment this
    # directive and add a new '90-local.conf' file (by copying the file
    # '90-local.conf.sample' and changing the desired settings) in
    # '/var/www/pootle/env/lib/python2.7/site-packages/pootle/settings/'
    # (default location for a pip-installed Pootle, having Python 2.7).
    #
    # This might require enabling the 'env' module.
    SetEnv POOTLE_SETTINGS /var/www/pootle/your_custom_settings.conf


    # The following two optional lines enable the "daemon mode" which
    # limits the number of processes and therefore also keeps memory use
    # more predictable.
    WSGIDaemonProcess pootle processes=2 threads=3 stack-size=1048576 maximum-requests=500 inactivity-timeout=300 display-name=%{GROUP} python-path=/var/www/pootle/env/lib/python2.7/site-packages
    WSGIProcessGroup pootle

    # Point to the WSGI loader script.
    WSGIScriptAlias / /var/www/pootle/wsgi.py

    # Turn off directory listing by default.
    Options -Indexes

    # Compress before being sent to the client over the network.
    # This might require enabling the 'deflate' module.
    SetOutputFilter DEFLATE
    AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript

    # Set expiration for some types of files.
    # This might require enabling the 'expires' module.
    ExpiresActive On

    ExpiresByType image/jpg "access plus 10 years"
    ExpiresByType image/png "access plus 10 years"
    ExpiresByType text/css "access plus 10 years"
    ExpiresByType application/x-javascript "access plus 10 years"

    # Optimal caching by proxies.
    # This might require enabling the 'headers' module.
    Header set Cache-Control "public"

    # Directly serve static files like css and images, no need to go
    # through mod_wsgi and Django. For high performance consider having a
    # separate server.
    Alias /assets /var/www/pootle/env/lib/python2.7/site-packages/pootle/assets
    <Directory /var/www/pootle/env/lib/python2.7/site-packages/pootle/assets>
        Order deny,allow
        Allow from all
    </Directory>

    # Allow downloading translation files directly.
    # This location must be the same in the Pootle 'PODIRECTORY' setting.
    Alias /export /var/www/pootle/env/lib/python2.7/site-packages/pootle/po
    <Directory /var/www/pootle/env/lib/python2.7/site-packages/pootle/po>
        Order deny,allow
        Allow from all
    </Directory>

    <Location /export>
        # Compress before being sent to the client over the network.
        # This might require enabling the 'deflate' module.
        SetOutputFilter DEFLATE

        # Enable directory listing.
        Options Indexes
    </Location>

</VirtualHost>
