Omero Web mod_python on osx 10.6
Posted: 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
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