Page Contents

OMERO

Downloads
Feature List
Licensing

Previous topic

OMERO.web deployment

Next topic

OMERO.web FastCGI deployment (DEPRECATED)

This Page

OMERO.web WSGI deployment

WSGI Configuration (Unix/Linux)

If you have installed Nginx or Apache OMERO can automatically generate a configuration file for your web server, see Apache 2.2+ configuration (mod_wsgi) or Nginx Gunicorn configuration. The location of the file will depend on your system, please refer to your web server’s manual. See Customizing your OMERO.web installation for additional customization options.

Apache 2.2+ configuration (mod_wsgi)

Install mod_wsgi.

Set the following:

$bin/omero config set omero.web.application_server "wsgi"

To create a site configuration file for inclusion in the main Apache configuration redirect the output of the following command into a file:

$ bin/omero web config apache-wsgi
<VirtualHost _default_:80>

  DocumentRoot /home/omero/OMERO.server/lib/python/omeroweb

  WSGIDaemonProcess omeroweb processes=5 threads=1 display-name=%{GROUP} user=omero python-path=/usr/lib64/python2.6/site-packages/Ice:/home/omero/OMERO.server/lib/python:/home/omero/OMERO.server/lib/fallback:/home/omero/OMERO.server/lib/python/omeroweb
  
  WSGIProcessGroup omeroweb

  WSGIScriptAlias / /home/omero/OMERO.server/lib/python/omeroweb/wsgi.py

  <Directory /home/omero/OMERO.server/lib/python/omeroweb>
    Order allow,deny
    Allow from all
  </Directory>

  Alias /static /home/omero/OMERO.server/lib/python/omeroweb/static
  <Directory "/home/omero/OMERO.server/lib/python/omeroweb/static">
      Options -Indexes FollowSymLinks
      Order allow,deny
      Allow from all
  </Directory>

</VirtualHost>

# see https://code.google.com/p/modwsgi/wiki/ConfigurationIssues
WSGISocketPrefix run/wsgi
# WSGISocketPrefix /var/run/wsgi

To configure an HTTPS server follow the Apache documentation.

Then reload apache.

Nginx Gunicorn configuration

Set the following:

$bin/omero config set omero.web.application_server "wsgi-tcp"

To create a site configuration file for inclusion in a system-wide nginx configuration redirect the output of the following command into a file:

$ bin/omero web config nginx-wsgi
upstream omeroweb {
    server 127.0.0.1:4080 fail_timeout=0;
}

server {
    listen 80;
    server_name $hostname;

    sendfile on;
    client_max_body_size 0;

    # maintenance page serve from here
    location @maintenance {
        root /home/omero/OMERO.server/etc/templates/error;
        try_files $uri /maintainance.html =502;
    }

    # weblitz django apps serve media from here
    location /static {
        alias /home/omero/OMERO.server/lib/python/omeroweb/static;
    }

    location @proxy_to_app {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;

        proxy_pass http://omeroweb;
    }

    location / {

        error_page 502 @maintenance;
        # checks for static file, if not found proxy to app
        try_files $uri @proxy_to_app;
    }

}

Note

OMERO.web requires body_in_file_only adjusted in your default nginx config because nginx must buffer incoming data. Make sure you have that set to the following config:

http {
    ...
    sendfile on;
    send_timeout 60s;
    client_max_body_size 0;
    ...
}

To configure an HTTPS server follow the nginx documentation.

Start the Gunicorn worker processes running one thread listening on 127.0.0.1:4080:

$ bin/omero web start
... static files copied to '/usr/local/dev/openmicroscopy/dist/lib/python/omeroweb/static'.
Starting OMERO.web... [OK]

Additional settings can be configured from command line arguments:

--workers WORKERS

The number of worker processes for handling requests.

--worker-connections WORKER_CONNECTIONS

The maximum number of simultaneous clients.

--wsgi-args WSGI_ARGS

Additional arguments. For more details check Gunicorn Documentation.

The Gunicorn workers are managed separately from other OMERO.server processes. You can check their status or stop them using the following commands:

$ bin/omero web status
OMERO.web status... [RUNNING] (PID 59217)
$ bin/omero web stop
Stopping OMERO.web... [OK]
Django WSGI workers (PID 59217) killed.