[ome-users] mod_wsgi Apache template broken?

Tjelvar Olsson (JIC) Tjelvar.Olsson at jic.ac.uk
Tue Nov 24 16:14:34 GMT 2015


Hi,

Trying to configure mod_wsgi for OMERO 5.2 turned out to be a bit painful. I ran into three issues (on
CentOS 7 using Apache/2.4.6).

1. The command to generate the Apache configuration file in the documentation did not work

https://www.openmicroscopy.org/site/support/omero5.1/sysadmins/unix/install-web/install-wsgi.html


$ bin/omero web config apache-wsgi

Should be:

$ bin/omero web config apache


2. The generated configuration FollowSymLinks option needed to be prefixed by a "+"

# systemctl start httpd.service
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.

# systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: failed (Result: exit-code) since Tue 2015-11-24 03:51:28 EST; 16s ago
  Process: 13634 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 13633 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 13633 (code=exited, status=1/FAILURE)
   CGroup: /system.slice/httpd.service

Nov 24 03:51:28 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Nov 24 03:51:28 localhost.localdomain httpd[13633]: AH00112: Warning: DocumentRoot [/home/omero/OMERO.server/lib/python/omeroweb] does not exist
Nov 24 03:51:28 localhost.localdomain httpd[13633]: AH00526: Syntax error on line 72 of /etc/httpd/conf.d/omero.conf:
Nov 24 03:51:28 localhost.localdomain httpd[13633]: Either all Options must start with + or -, or no Option may.
Nov 24 03:51:28 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Nov 24 03:51:28 localhost.localdomain kill[13634]: kill: cannot find process ""
Nov 24 03:51:28 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 24 03:51:28 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Nov 24 03:51:28 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.

The problem above was overcome by changing:


      Options -Indexes FollowSymLinks

To:

      Options -Indexes +FollowSymLinks


3. [authz_core:error] client denied by server configuration

Basically, the pages were 403-ing and the error above was reproted in:
/var/log/httpd/error_log

I found a fix for this in:
https://mikegriffin.ie/blog/20140130-authz-core-error-client-denied-by-server-configuration/

Basically I needed to replace:

  Order allow, deny
  Allow from all

With:

  Require all granted

Perhaps the script that generates the Apache template can be updated to incorporate these changes?
I have included my working omero.conf file below.

Cheers,

Tjelvar


<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.7/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">
      Require all granted
  </Directory>

  Alias /static /home/omero/OMERO.server/lib/python/omeroweb/static
  <Directory "/home/omero/OMERO.server/lib/python/omeroweb/static">
      Options -Indexes +FollowSymLinks
      Require all granted
  </Directory>

</VirtualHost>

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20151124/f63c9486/attachment.html>


More information about the ome-users mailing list