Blog-like notes

OMERO.web with Apache httpd 2.4

OMERO.web is a Django-based web application allowing to access the services of a OMERO server from a standard web navigator. OMERO.web is bundled with the OMERO server itself.

Unfortunately, the official documentation for configuring and running OMERO.web with the Apache web server deals only with Apache httpd 2.2.x. The proposed configuration is unusable with the latest 2.4 branch of the web server. The main problem is that the mod_fastcgi module does no longer work with Apache httpd 2.4—the suggested method for using FastCGI with the 2.4 branch is the mod_proxy_fcgi module, which comes with the standard distribution of the web server.

So how to get OMERO.web to work with that module instead of mod_fastcgi?

UPDATE (2015/04/03): OMERO 5.1.0, released on April 2nd, 2015, now supports deploying OMERO.web with Apache httpd 2.4 and the mod_proxy_fcgi module. If you’re using OMERO 5.1 or later, ignore this page. Just run the following command:

$ omero web config apache-fcgi

and insert the output in your Apache configuration file, as explained in OMERO documentation.

OMERO.web configuration

OMERO.web must be configured to use a TCP socket instead of a UNIX socket, as mod_proxy_fcgi is currently unable to relay requests to a UNIX socket (although that feature is incoming).

To use a TCP socket on port 4080 on the local machine, set the following OMERO properties:

$ omero config set omero.web.application_server fastcgi-tcp
$ omero config set omero.web.application_server.host localhost
$ omero config set omero.web.application_server.port 4080

Then you can start the FCGI workers by running

$ omero web start

Apache httpd configuration

Make sure the mod_rewrite, mod_proxy and mod_proxy_fcgi modules are loaded.

At this point, the OMERO documentation says to run the following command

$ omero web config apache

and to insert its output in the Apache httpd configuration file. However, omero web config is currently not aware of Apache httpd 2.4 and its mod_proxy_fcgi module, and it produces an inappropriate configuration.

Instead, add the following lines to your httpd.conf file (replace OMERO_HOME with the directory containing your OMERO installation):

RewriteEngine On
RewriteRule   ^/?$ /omero/ [R]

ProxyPass     /webclient fcgi://localhost:4080
ProxyPass     /webadmin  fcgi://localhost:4080

Alias /static OMERO_HOME/lib/python/omeroweb/static
<Directory "OMERO_HOME/lib/python/omeroweb/static">
    Options   -Indexes +FollowSymLinks
    Require   all granted
</Directory>

Now start your web server or reload its configuration. The main OMERO.web interface should be reachable on http://example.com/webclient/ and the administration interface on http://example.com/webadmin/.