{% if APACHE_PORT != 80 %}Listen {{ APACHE_PORT }}{% endif %}

<VirtualHost {{ SERVER_IP }}:{{ APACHE_PORT }}>
    ServerName {{ SERVER_NAME }}  
    ServerAdmin {{ APACHE_SERVER_ADMIN }}

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

#    WSGIRestrictEmebedded On #Invalid command 'WSGIRestrictEmebedded', perhaps misspelled or defined by a module not included in the server configuration

    WSGIApplicationGroup %{GLOBAL}
    WSGIDaemonProcess {{ APACHE_CONF_NAME }} user={{ APACHE_WSGI_USER }} threads=10 maximum-requests=10000
    WSGIScriptAlias / {{ ROOT_PATH }}/gpexe/wsgi.py
    WSGIProcessGroup {{ APACHE_CONF_NAME }}
    Alias /media/ {{ ROOT_PATH }}/gpexe/media/
    Alias /static/ {{ ROOT_PATH }}/gpexe/static/

    <Directory {{ ROOT_PATH }}/gpexe/media>
        Order allow,deny
        Allow from all
        Options -Indexes
    </Directory>

    <Directory {{ ROOT_PATH }}/gpexe/static>
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>
