<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,<br>
<br>
Trying to configure mod_wsgi for OMERO 5.2 turned out to be a bit painful. I ran into three issues (on<br>
CentOS 7 using Apache/2.4.6).<br>
<br>
1. The command to generate the Apache configuration file in the documentation did not work<br>
<br>
<a href="https://www.openmicroscopy.org/site/support/omero5.1/sysadmins/unix/install-web/install-wsgi.html" target="_blank">https://www.openmicroscopy.org/site/support/omero5.1/sysadmins/unix/install-web/install-wsgi.html</a><br>
<br>
<pre>$ bin/omero web config apache-wsgi<br><br>Should be:<br><br>$ bin/omero web config apache<br><br><br>2. The generated configuration FollowSymLinks option needed to be prefixed by a "+"<br></pre>
# systemctl start httpd.service<br>
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.<br>
<br>
# systemctl status httpd.service<br>
httpd.service - The Apache HTTP Server<br>
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)<br>
   Active: failed (Result: exit-code) since Tue 2015-11-24 03:51:28 EST; 16s ago<br>
  Process: 13634 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)<br>
  Process: 13633 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)<br>
 Main PID: 13633 (code=exited, status=1/FAILURE)<br>
   CGroup: /system.slice/httpd.service<br>
<br>
Nov 24 03:51:28 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...<br>
Nov 24 03:51:28 localhost.localdomain httpd[13633]: AH00112: Warning: DocumentRoot [/home/omero/OMERO.server/lib/python/omeroweb] does not exist<br>
Nov 24 03:51:28 localhost.localdomain httpd[13633]: AH00526: Syntax error on line 72 of /etc/httpd/conf.d/omero.conf:<br>
Nov 24 03:51:28 localhost.localdomain httpd[13633]: Either all Options must start with + or -, or no Option may.<br>
Nov 24 03:51:28 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE<br>
Nov 24 03:51:28 localhost.localdomain kill[13634]: kill: cannot find process ""<br>
Nov 24 03:51:28 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1<br>
Nov 24 03:51:28 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.<br>
Nov 24 03:51:28 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.<br>
<br>
The problem above was overcome by changing:<br>
<br>
<pre>      Options -Indexes FollowSymLinks<br><br>To:<br><br>      Options -Indexes +FollowSymLinks<br><br><br>3. [authz_core:error] client denied by server configuration<br><br>Basically, the pages were 403-ing and the error above was reproted in:<br>/var/log/httpd/error_log<br><br>I found a fix for this in:<br><a href="https://mikegriffin.ie/blog/20140130-authz-core-error-client-denied-by-server-configuration/" target="_blank">https://mikegriffin.ie/blog/20140130-authz-core-error-client-denied-by-server-configuration/</a><br><br>Basically I needed to replace:<br><br><code class="yaml">  <span class="l-Scalar-Plain">Order allow, deny</span>
  <span class="l-Scalar-Plain">Allow from all<br><br>With:<br></span></code></pre>
<pre><code class="yaml">  <span class="l-Scalar-Plain">Require all granted</span></code></pre>
<br>
Perhaps the script that generates the Apache template can be updated to incorporate these changes?<br>
I have included my working omero.conf file below.<br>
<br>
Cheers,<br>
<br>
Tjelvar<br>
<br>
<br>
<VirtualHost _default_:80><br>
<br>
  DocumentRoot /home/omero/OMERO.server/lib/python/omeroweb<br>
<br>
  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<br>
  <br>
  WSGIProcessGroup omeroweb<br>
<br>
  WSGIScriptAlias / /home/omero/OMERO.server/lib/python/omeroweb/wsgi.py<br>
<br>
  <Directory "/home/omero/OMERO.server/lib/python/omeroweb"><br>
      Require all granted<br>
  </Directory><br>
<br>
  Alias /static /home/omero/OMERO.server/lib/python/omeroweb/static<br>
  <Directory "/home/omero/OMERO.server/lib/python/omeroweb/static"><br>
      Options -Indexes +FollowSymLinks<br>
      Require all granted<br>
  </Directory><br>
<br>
</VirtualHost><br>
<br>
# see https://code.google.com/p/modwsgi/wiki/ConfigurationIssues<br>
WSGISocketPrefix run/wsgi<br>
# WSGISocketPrefix /var/run/wsgi<br>
<br>
</div>
</body>
</html>