[ome-users] Problems setting up production OMERO using 'mod_wsgi'

Aleksandra Tarkowska aleksandrat at lifesci.dundee.ac.uk
Thu Aug 5 09:16:16 BST 2010


Hi Todd

On 4 Aug 2010, at 21:09, Todd H. Stokes wrote:

> Hello,
>
> I demo'ed OMERO 4.2 for a week or so by connecting to the packaged  
> Django demo server on port 8000 per the instructions on the site.  
> The OMERO distribution was unzipped into a folder on my user desktop  
> on our server. I created a lot of data in the database, which I  
> would like to preserve through the process of "upgrading" to a  
> production web server.
>
> I figured out how to host python code in apache using mod_wsgi  
> (which is recommended to replace mod_python and is pretty similar).  
> Then I figured out where to change permissions on all the  
> directories and where to set various path variables so that the  
> apache user would find the right versions of all the dependencies  
> (hint: "universal settings" in /etc/profile doesn't seem to apply to  
> apache).
>
> Finally, I commented out the "sys.exit(1)" line of code in:
> omero-dist/lib/python/omeroweb/settings.py
> because even though my settings were in place, it always executed  
> the exit when calling through the WSGI interface. (I don't know how  
> to verify that the settings were successfully loaded, though).

I suspect that means that omero_sti/var/lib/custom_settings.py is not  
in your PYTHONPATH. It usually happes becuase of the permissions on  
the var or var/lib directory. You apache_user must be able to read/ 
write there. I do not recommend you to comment it. Could you please  
send the error message you got?

> At this point, I can see the login screen, but none of the  
> credentials that worked on my demo server are working.
>
> This web server is running a number of other web services, so my  
> WSGI config looks like this:
> WSGIScriptAlias /omero /home/tstokes/Desktop/SRM_tcga/OME/omero/wsgi- 
> scripts/django.wsgi
> and my application host variable is set up like this:
> APPLICATION_HOST='http://hermes.bme.gatech.edu/omero'
>
> A typical authentication error from the OMEROweb.log is attached. In  
> other cases, I don't get the password checked error in the log or  
> the "Error: Client version does not match server, please contact  
> administrator" on the page. Instead the page simply refreshes  
> despite the log showing no error (second attachment). I think this  
> may indicate that the pages redirects are confused. The third  
> attachment shows the apache error log, with requests being generated  
> to both appmedia and webclient URLs without the necessary '/omero'  
> part of the path.
>

Unfortunately OMERO.web does not support mod_python "mount" paths.
A reasonable half-way solution would be to use a different virtual  
host to house your mod_python configuration. Would that work in your  
use case?

Could you please send me attachment to private? Nothing was attached  
to this email.

> One major point of confusion for me is in the instructions at:
> http://www.openmicroscopy.org.uk/site/support/omero4/server/ 
> install_web
> there is a sample mod_python configuration code snip that includes  
> the line:
> SetEnv DJANGO_SETTINGS_MODULE omeroweb.settings
> mod_wsgi uses a similar instruction, but I can't find any guide to  
> what the file 'omeroweb.settings' should contain. For now, I copied  
> my custom_settings.py file to this file name.

SetEnv DJANGO_SETTINGS_MODULE omeroweb.settings is Python import path  
to OMERO.web Django project's settings file stored in omero_dist/lib/ 
python/omeroweb/settings.py. Exactly as it is show in documentation:

<Location "/">
     SetHandler python-program
     PythonHandler django.core.handlers.modpython
     SetEnv DJANGO_SETTINGS_MODULE omeroweb.settings
     PythonDebug On
     PythonPath "['/home/omero/omero_dist/lib/python', '/home/omero/ 
omero_dist/var/lib', '/home/omero/omero_dist/lib/python/omeroweb'] +  
sys.path"

</Location>

You do not need to change anything there beside PythonPath.
More details about Django and mod_python you can find on http://docs.djangoproject.com/en/1.1/howto/deployment/modpython/

> If I can get the setup working, I would like to move the omero  
> distribution folder out of my home directory (where it must be open  
> to access by the apache user) and into the directory of a new  
> 'omero' user. I've started this process in parallel, but I am  
> running into the same authentication issue on that instance, also.
>
> If necessary, I can document more completely the steps that I've  
> taken. They might be helpful in generating new documentation that  
> addresses this mod_wsgi case.
>
> Thanks!
> Todd

Thanks
Ola




More information about the ome-users mailing list