We're Hiring!

Omero Web mod_python on osx 10.6

Having a problem deploying OMERO? Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

The OMERO.server installation documentation begins here and you can find OMERO.web deployment documentation here.

Omero Web mod_python on osx 10.6

Postby helmerj » Mon Sep 20, 2010 9:53 am

HI

I have a fresh installation of snow leopard and have been following the pdf guide for dependency installations provided by Janek Claus and Kenneth Arcieri from NIH. I then followed the server installation instruction for UNIX systems on the omero website. I was able to get the web interface of omero running using the build in django web server started under the newly created system user omero. I am able to login and use the system.
But since this is suppose to be a production system I would very much prefer the mod_python/apache approach:

1. I have installed and enabled mod_pyhton in /etc/apache/httpd.conf:
LoadModule python_module /usr/libexec/apache2/mod_python.so

2. I have installed the Omero app in /Library/Omero

3. I have created and made belong to new system user omero the data dir /OMERO

4. I have added the following to the ~/.profile of the new omero user:

export PATH=/Library/Ice/3.3/bin:$PATH
export PATH=/Library/PostgreSQL/8.4/bin:$PATH
export PYTHONPATH=/Library/Ice/3.3/python:$PYTHONPATH
export OMERO_TEMPDIR=/var/lib/omero/tmp

5. I have added the following location definition to /etc/apache/httpd.conf

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

</Location>

6. When I navigate to http://localhost/webadmin I get the following error:
MOD_PYTHON ERROR

ProcessId: 506
Interpreter: 'kentridge.local'

ServerName: 'kentridge.local'
DocumentRoot: '/Library/WebServer/Documents'

URI: '/webadmin'
Location: '/'
Directory: None
Filename: '/Library/WebServer/Documents/webadmin'
PathInfo: ''

Phase: 'PythonHandler'
Handler: 'django.core.handlers.modpython'

Traceback (most recent call last):

File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)

File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1229, in _process_target
result = _execute_target(config, req, object, arg)

File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1128, in _execute_target
result = object(arg)

File "/Library/Omero/lib/python/django/core/handlers/modpython.py", line 228, in handler
return ModPythonHandler()(req)

File "/Library/Omero/lib/python/django/core/handlers/modpython.py", line 191, in __call__
self.load_middleware()

File "/Library/Omero/lib/python/django/core/handlers/base.py", line 33, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:

File "/Library/Omero/lib/python/django/utils/functional.py", line 269, in __getattr__
self._setup()

File "/Library/Omero/lib/python/django/conf/__init__.py", line 40, in _setup
self._wrapped = Settings(settings_module)

File "/Library/Omero/lib/python/django/conf/__init__.py", line 75, in __init__
raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)

ImportError: Could not import settings 'omeroweb.settings' (Is it on sys.path? Does it have syntax errors?): No module named Ice


So it seems that the webserver does not know where to find the Ice python module, isn't it? I specifically set this in ~/.profile when starting the internal django server as system user omero. How can I let apache know about the Ice location on my system?

Any help would be greatly appreciated.
Cheers Juergen
User avatar
helmerj
 
Posts: 41
Joined: Mon Sep 20, 2010 9:39 am
Location: Berlin, Germany

Re: Omero Web mod_python on osx 10.6

Postby atarkowska » Thu Sep 23, 2010 3:25 pm

Hi Juergen

The mod_python configuration seems to be correct.
This error is mixing two common problems.

ImportError: Could not import settings 'omeroweb.settings' (Is it on sys.path? Does it have syntax errors?): No module named Ice


Could you please try to add to .profile

Code: Select all
export DYLD_LIBRARY_PATH=/Library/Ice/3.3/lib
export ICE_HOME=/Library/Ice/3.3


and check if permissions on omero/var/ and omero/var/lib are enough for apache user?
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: Omero Web mod_python on osx 10.6

Postby atarkowska » Thu Sep 23, 2010 3:42 pm

If it still not working, please restart apache, and then go to omero and send me the output of:

Code: Select all
bin/omero admin diagnostics
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: Omero Web mod_python on osx 10.6

Postby helmerj » Tue Sep 28, 2010 11:22 am

Hi,

thanks for helping me solving that problem and for your suggestions.

1. I have added the following to .profile for the omero user that is running the omero server.

export DYLD_LIBRARY_PATH=/Library/Ice/3.3/lib
export ICE_HOME=/Library/Ice/3.3

2. I have checked the permission for the /Library/Omero/var and its lib subfolder. The owner is omero, needed to start the omero server in the first place and the group is set to _www which is the group, the apache server is running under. The permission are set for the u to read, write and execute and for the group to read and write.

kentridge:Omero omero$ ls -l /Library/Omero/var/
total 0
drwxrwxr-x 4 omero _www 136 Sep 20 11:12 lib
drwxrwxr-x 12 omero _www 408 Sep 20 11:12 log
drwxrwxr-x 6 omero _www 204 Sep 20 11:11 master


3. This is the output I get from the bin/omero admin diagnostics command:


kentridge:Omero omero$ bin/omero admin diagnostics

================================================================================
OMERO Diagnostics Beta-4.2.0-r7571-b29
================================================================================

Commands: java -version 1.6.0 (/usr/bin/java)
Commands: python -V 2.6.1 (/usr/bin/python)
Commands: icegridnode --version 3.3.1 (/Library/Ice/3.3/bin/icegridnode)
Commands: icegridadmin --version 3.3.1 (/Library/Ice/3.3/bin/icegridadmin)
Commands: psql --version 8.4.4 (/Library/PostgreSQL/8.4/bin/psql)

Server: icegridnode running
Server: Blitz-0 active (pid = 7169, enabled)
Server: DropBox active (pid = 7170, enabled)
Server: FileServer active (pid = 7171, enabled)
Server: Indexer-0 active (pid = 7172, enabled)
Server: MonitorServer active (pid = 7173, enabled)
Server: OMERO.Glacier2 active (pid = 7174, enabled)
Server: OMERO.IceStorm active (pid = 7175, enabled)
Server: Processor-0 active (pid = 7176, enabled)
Server: Repository-1 error: node `repo' couldn't be reached:
the node is not active
Server: Tables-0 active (pid = 7177, enabled)
Server: TestDropBox inactive (enabled)

Log dir: /Library/Omero/var/log exists

Log files: Blitz-0.log 4.0 MB errors=4 warnings=25
Log files: DropBox.log 6.0 KB errors=2 warnings=7
Log files: FileServer.log 0.0 KB
Log files: Indexer-0.log 85.0 KB errors=1 warnings=9
Log files: MonitorServer.log 3.0 KB errors=2 warnings=4
Log files: OMEROweb.log 6.0 KB errors=17 warnings=0
Log files: Processor-0.log 2.0 KB errors=0 warnings=2
Log files: Tables-0.log 2.0 KB errors=0 warnings=2
Log files: TestDropBox.log n/a
Log files: master.err 0.0 KB
Log files: master.out 0.0 KB
Log files: Total size 4.94 MB

Parsing Blitz-0.log:[line:69] => Server restarted <=
Parsing Blitz-0.log:[line:35092] => Server restarted <=

Environment:OMERO_HOME=(unset)
Environment:OMERO_NODE=(unset)
Environment:OMERO_MASTER=(unset)
Environment:PATH=/Library/PostgreSQL/8.4/bin:/Library/Ice/3.3/bin:/Library/PostgreSQL/8.4/bin:/Library/Ice/3.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Environment:ICE_HOME=/Library/Ice/3.3
Environment:LD_LIBRARY_PATH=(unset)
Environment:DYLD_LIBRARY_PATH=/Library/Ice/3.3/lib


Thanks J.
User avatar
helmerj
 
Posts: 41
Joined: Mon Sep 20, 2010 9:39 am
Location: Berlin, Germany

Re: Omero Web mod_python on osx 10.6

Postby atarkowska » Thu Sep 30, 2010 1:32 pm

Once you modified your .profile, restarted omero, apache, etc. is the error still the same? Could you please provide me with the new logfile?
Alternatively, could you try to login by OMERO.insight or OMERO.importer and check if it allows you to go in?
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: Omero Web mod_python on osx 10.6

Postby helmerj » Thu Sep 30, 2010 3:54 pm

Hi!

Yes, I can log in using InSight and Importer just fine so the omero server itself is up an running. I still get the same error in the browser window when trying to connect to the webserver that I have setup as described above using mod_python and apache. BTW the mod_python seems to be working as I was adding a little Hell World test using mod_python and that worked like a charm.

So this is the error I do get in the apache error.log:


[Thu Sep 30 17:44:44 2010] [error] [client ::1] mod_python (pid=15751, interpreter='kentridge.local', phase='PythonHandler', handler='django.core.handlers.modpython'): Application error
[Thu Sep 30 17:44:44 2010] [error] [client ::1] ServerName: 'kentridge.local'
[Thu Sep 30 17:44:44 2010] [error] [client ::1] DocumentRoot: '/Library/WebServer/Documents'
[Thu Sep 30 17:44:44 2010] [error] [client ::1] URI: '/'
[Thu Sep 30 17:44:44 2010] [error] [client ::1] Location: '/'
[Thu Sep 30 17:44:44 2010] [error] [client ::1] Directory: None
[Thu Sep 30 17:44:44 2010] [error] [client ::1] Filename: '/Library/WebServer/Documents/'
[Thu Sep 30 17:44:44 2010] [error] [client ::1] PathInfo: ''
[Thu Sep 30 17:44:44 2010] [error] [client ::1] Traceback (most recent call last):
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n default=default_handler, arg=req, silent=hlist.silent)
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1229, in _process_target\n result = _execute_target(config, req, object, arg)
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1128, in _execute_target\n result = object(arg)
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/core/handlers/modpython.py", line 228, in handler\n return ModPythonHandler()(req)
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/core/handlers/modpython.py", line 191, in __call__\n self.load_middleware()
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/core/handlers/base.py", line 33, in load_middleware\n for middleware_path in settings.MIDDLEWARE_CLASSES:
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/utils/functional.py", line 269, in __getattr__\n self._setup()
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/conf/__init__.py", line 40, in _setup\n self._wrapped = Settings(settings_module)
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/conf/__init__.py", line 75, in __init__\n raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
[Thu Sep 30 17:44:44 2010] [error] [client ::1] ImportError: Could not import settings 'omeroweb.settings' (Is it on sys.path? Does it have syntax errors?): No module named Ice
[Thu Sep 30 17:44:44 2010] [error] [client ::1] mod_python (pid=15750, interpreter='kentridge.local', phase='PythonHandler', handler='django.core.handlers.modpython'): Application error, referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] ServerName: 'kentridge.local', referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] DocumentRoot: '/Library/WebServer/Documents', referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] URI: '/favicon.ico', referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] Location: '/', referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] Directory: None, referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] Filename: '/Library/WebServer/Documents/favicon.ico', referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] PathInfo: '', referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] Traceback (most recent call last):, referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch\n default=default_handler, arg=req, silent=hlist.silent), referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1229, in _process_target\n result = _execute_target(config, req, object, arg), referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Python/2.6/site-packages/mod_python/importer.py", line 1128, in _execute_target\n result = object(arg), referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/core/handlers/modpython.py", line 228, in handler\n return ModPythonHandler()(req), referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/core/handlers/modpython.py", line 191, in __call__\n self.load_middleware(), referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/core/handlers/base.py", line 33, in load_middleware\n for middleware_path in settings.MIDDLEWARE_CLASSES:, referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/utils/functional.py", line 269, in __getattr__\n self._setup(), referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/conf/__init__.py", line 40, in _setup\n self._wrapped = Settings(settings_module), referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] File "/Library/Omero/lib/python/django/conf/__init__.py", line 75, in __init__\n raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e), referer: http://localhost/
[Thu Sep 30 17:44:44 2010] [error] [client ::1] ImportError: Could not import settings 'omeroweb.settings' (Is it on sys.path? Does it have syntax errors?): No module named Ice, referer: http://localhost/

Hope this helps.
Thanks for your help. it is truly appreciated.

Cheers J.
User avatar
helmerj
 
Posts: 41
Joined: Mon Sep 20, 2010 9:39 am
Location: Berlin, Germany


Return to Installation and Deployment

Who is online

Users browsing this forum: No registered users and 1 guest