[mod_python] Apache wont load/start...

Graham Dumpleton graham.dumpleton at gmail.com
Wed Aug 15 18:19:16 EDT 2007


On 16/08/07, Colin Bean <ccbean at gmail.com> wrote:
> Try following the links from this message, they seem to address the
> same problem:
>
> http://www.modpython.org/pipermail/mod_python/2007-June/023861.html

Actually, possibly don't pay too much attention to that post about
adding site-packages as it isn't meant to be listed in the registry
entries to begin with. The site-packages directory is only added when
the Python site.py file has been loaded. This was only brought to my
attention recently when working out Windows issues with mod_wsgi.

Thus, if mod_python code modules not being found, more likely to be
that correct site.py file isn't being found at startup. This can occur
because of access permissions on files if Apache is run as a service
and thus a different user. Thus, very important to install
Apache/Python/mod_python as administrator so file permissions are
okay, DLLs are in system directories and so registry entries setup for
machine and not just user.

Problems can also arise where you have installed multiple versions of
Python and the first one found in PATH is not the same version that
mod_python requires. This can occur from installing multiple Python
versions explicitly, or can be done inadvertently as there are now a
number of Windows applications which provide their own copy of Python.
If the Python version from such an application is found in PATH first
it can screw everything up. If this Python version was found first
when installing mod_python, can also mean that mod_python Python code
files were installed in wrong location and not where Python used by
Apache is looking. There can also be a problem where real Python was
installed as administrator and the application version as normal user,
as the application version may put entries in user registry entries
and shadow those for machine.

I stress though what has already been said, it is vitally important to
see what is being logged in the Apache error logs so the reason can be
determined.

As to not seeing solutions to previous posts, it is generally because
people having problems don't explain problems very well and in enough
detail. As a consequence we repeat all the commonly suspected issues,
such as above. The OP somehow then solves his problem and then doesn't
bother responding to say what the problem was and how they fixed it.
As a consequence we never learn anything about what the actual problem
was and are never able to improve our troubleshooting suggestions.

So, please provide details about log messages and help us by feeding
back whatever information seems pertinent and how you may have solved
the problem.

Thanks.

Graham

> Past that I'm probably not going to be of much help as I don't use
> mod_python on windows...
> Just to clarify, you are using the installer compiled for apache
> 2.0.x, correct?  I'm guessing so, as I doubt you would have gotten
> this far otherwise.
>
> Take care,
> Colin
>
> On 8/15/07, Jacob Carlsson <jagge_90 at hotmail.com> wrote:
> > Hey!
> >
> > Thank you for your fast answer!
> >
> > There was no errors in the log. Thats why it was so weird. While i waited
> > for an answer i downgraded my apache to 2.0.59 again and entered my python
> > installation path in the PATH variable. And when i restarted my computer it
> > started up fine despite i had entered "LoadModule python_module ...". But
> > still it dont work and gives me alot of errors. I'll post my log:
> >
> >
> >
> > [Wed Aug 15 21:00:47 2007] [notice] Apache/2.0.59 (Win32) DAV/2 SVN/1.4.4
> > configured -- resuming normal operations
> > [Wed Aug 15 21:00:47 2007] [notice] Server built: Jul 27 2006 15:55:03
> > [Wed Aug 15 21:00:47 2007] [notice] Parent: Created child process 4852
> > [Wed Aug 15 21:00:48 2007] [error] python_init: Python version mismatch,
> > expected '2.4.3', found '2.4.4'.
> > [Wed Aug 15 21:00:48 2007] [error] python_init: Python executable found
> > 'H:\\install\\Apache2\\bin\\Apache.exe'.
> > [Wed Aug 15 21:00:48 2007] [error] python_init: Python path being used
> > 'H:\\install\\Python24\\python24.zip;.\\DLLs;.\\lib;.\\lib\\plat-win;.\\lib\\lib-tk;H:\\install\\Apache2\\bin'.
> > [Wed Aug 15 21:00:48 2007] [notice] mod_python: Creating 8 session mutexes
> > based on 0 max processes and 250 max threads.
> > [Wed Aug 15 21:00:48 2007] [notice] Child 4852: Child process is running
> > [Wed Aug 15 21:00:48 2007] [notice] Child 4852: Acquired the start mutex.
> > [Wed Aug 15 21:00:48 2007] [notice] Child 4852: Starting 250 worker threads.
> > [Wed Aug 15 21:00:51 2007] [error] make_obcallback: could not import
> > mod_python.apache.\n
> > [Wed Aug 15 21:00:51 2007] [error] make_obcallback: Python path being used
> > "['H:\\\\install\\\\Python24\\\\python24.zip', '.\\\\DLLs', '.\\\\lib',
> > '.\\\\lib\\\\plat-win', '.\\\\lib\\\\lib-tk',
> > 'H:\\\\install\\\\Apache2\\\\bin']".
> > [Wed Aug 15 21:00:51 2007] [error] get_interpreter: no interpreter callback
> > found.
> > [Wed Aug 15 21:00:51 2007] [error] [client 127.0.0.1] python_handler: Can't
> > get/create interpreter.
> >
> >
> > These last errors comes when i try accessing the following:
> >
> > <Location /mpinfo>
> >    SetHandler mod_python
> >    PythonInterpreter main_interpreter
> >    PythonHandler mod_python.testhandler
> > </Location>
> >
> > Like what does it mean with "Python version mismatch, expected '2.4.3',
> > found '2.4.4'.", expected 2.4.3? How could it expect something else?
> >
> > Also i tried entering some more paths into the PATH variable like
> > "Lib,lib-tk,DLLs" but it doesent seem enough...
> >
> > Best Regards Jacob Carlsson
> >
> > >From: "Colin Bean" <ccbean at gmail.com>
> > >To: "Jacob Carlsson" <jagge_90 at hotmail.com>
> > >CC: mod_python at modpython.org
> > >Subject: Re: [mod_python] Apache wont load/start...
> > >Date: Wed, 15 Aug 2007 11:08:19 -0700
> > >
> > >Please post the contents from your Apache error log when you try to
> > >start the server, can't really tell what the problem is from the
> > >information you've given.
> > >
> > >On 8/15/07, Jacob Carlsson <jagge_90 at hotmail.com> wrote:
> > > > Hello!
> > > >
> > > > Im using Windows XP.
> > > >
> > > > I have tried to get apache (both 2.2.4 and 2.0.59 to work with
> > >mod_python).
> > > > I have python 2.4 and I have tried using
> > > > "mod_python-3.2.10.win32-py2.4-apache2.2" &
> > > > "mod_python-3.3.1.win32-py2.4-Apache2.2" and also some other different
> > > > versions when I tested with apache 2.0.59.
> > > >
> > > > My problem is that apache simply wont load when i enter "LoadModule
> > > > python_module modules/mod_python.so" in httpd.conf.
> > > > Now I have tried fixing this in many various ways for hours and not
> > >succeded
> > > > at all.
> > > > For example I have searched google and your page for answers and i found
> > >out
> > > > that some people had the same problem as I but some of their solutions
> > >didnt
> > > > work out for me.
> > > > For example I tried adding python to my "PATH" variable but that didnt
> > >help
> > > > much.. Maybe i did it incorrect? I added "C:\Python24" (thats simply
> > >where I
> > > > installed python)
> > > > Also many that have the same problem didnt get an answer that i could
> > >read.
> > > >
> > > > So i would appreciate any help so i finally can solve this really
> > >annoying
> > > > problem!
> > > >
> > > > Best Regards Jacob Carlsson
> > > >
> > > > _________________________________________________________________
> > > > Luspank? Tjäna pengar på auktion http://tradera.msn.se/
> > > >
> > > > _______________________________________________
> > > > Mod_python mailing list
> > > > Mod_python at modpython.org
> > > > http://mailman.modpython.org/mailman/listinfo/mod_python
> > > >
> >
> > _________________________________________________________________
> > Spela roliga Worms'07 i mobilen
> > http://msn.cellus.se/?page=game_order&itemId=878908
> >
> >
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>



More information about the Mod_python mailing list