Studio as a WSGI

6 views
Skip to first unread message

fruitwerks

unread,
Mar 10, 2011, 10:12:08 AM3/10/11
to studio-discuss
I would like to contribute a WSGI configuration in case anyone has trouble. Feel free to comment and improve.

This a working configuration under Apache2 and Plesk10, studio is installed in "http-root"/mfs/

// Vhost Config

<Directory "/var/www/vhosts/domain.tld/httpdocs/mfs/">
    WSGIProcessGroup gvnmfs #this value must match the one on the last line and be unique system wide
    Order allow,deny
    Allow from all
// optional compression options
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
// eo
// optional Expires tags
    <FilesMatch "\.(js|css|jpg|jpeg|png|gif)$">
      ExpiresActive On
      ExpiresDefault "access plus 1 week"
    </FilesMatch>
// eo
</Directory>
WSGIScriptAlias /mfs /var/www/vhosts/domain.tld/httpdocs/studio.wsgi
WSGIDaemonProcess gvnmfs threads=25 python-path=/var/www/vhosts/domain.tld/httpdocs/mfs/env/bin/python

// studio.wsgi

import site
import os, sys

site.addsitedir('/var/www/vhosts/domain.tld/httpdocs/mfs/env/lib/python2.6/site-packages')

sys.path.append('/var/www/vhosts/domain.tld/httpdocs/mfs/')
os.environ['PYTHON_EGG_CACHE'] = '/var/www/vhosts/domain.tld/.python-eggs'

from paste.deploy import loadapp
application = loadapp('config:/var/www/vhosts/domain.tld/httpdocs/mfs/my_studio.ini')

Eric Lemoine

unread,
Mar 11, 2011, 2:45:47 AM3/11/11
to studio-...@googlegroups.com

Thanks a lot for sharing this. I think it'd be good to have a "Run
Studio in Apache" section in the Installation Guide. If you're
familiar with Github we'd be very happy to receive a Pull Request for
that!

--
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.l...@camptocamp.com
http://www.camptocamp.com

CoreyC

unread,
Mar 12, 2011, 11:53:15 PM3/12/11
to Studio
I have yet to find the patience to battle Github - Those who do can
feel free to add this in. :)

On Mar 10, 11:45 pm, Eric Lemoine <eric.lemo...@camptocamp.com> wrote:
> Mail : eric.lemo...@camptocamp.comhttp://www.camptocamp.com

Eric Lemoine

unread,
Mar 13, 2011, 6:33:44 PM3/13/11
to studio-...@googlegroups.com, CoreyC
On Sun, Mar 13, 2011 at 5:53 AM, CoreyC <fruit...@gmail.com> wrote:
> I have yet to find the patience to battle Github - Those who do can
> feel free to add this in. :)

FYI, I just added an Apache section to the installation guide. Any
idea to improve this section is welcome.


--
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96

Mail : eric.l...@camptocamp.com
http://www.camptocamp.com

Reply all
Reply to author
Forward
0 new messages