Python home in log should not say /use/bin/python. That is very wrong. That would suggest you have a rouge WSGIPythonHome directive in your Apache config somewhere. Can you check.
Graham On 16/07/2012, at 10:25 AM, Alan Kesselmann <[email protected]> wrote: > > > On Monday, July 16, 2012 5:19:41 PM UTC+3, Graham Dumpleton wrote: > Lets summarise where believe things are up to. > > You have mod_wsgi.so correctly linking in the libpython2.6.so for your > own Python installation. > > This must be mistake (should probably say libpython2.7.so ) because both of > the python installations are 2.7. System python was/is 2.7.2 and new > installation is 2.7.3. > > Your virtual environment is constructed using your Python installation. > correct > > You believe you have removed mod_python from your Apache. > > i have ran sudo aptitude purge libapache2-mod-python. > > libapache2-mod-wsgi which was installed for initial python still remains. > > > Even though mod_python is not loaded, WSGIPythonHome seems to be > getting ignored. > > This is resulting in system wide Python system .py files to be used on > startup. > > The specific OS you are using doesn't use standard Python code base. > Instead they hack it to allow them to have parallel Python standard > and debug binaries. Part of this is that they hack the compiled in sys > module to have a pydebug flag. The system wide .py files are looking > for that flag, but because the libpython2.7.so that is being used is > actually from your installation it doesn't have it and fails. > > this went completely over my head :) > > Things to do: > > 1. Please verify this again using: > > httpd -M > > Hmm no such command for ubuntu... googled around and found that apache2ctl > command should work the same magic: > > root@alan:/home/alan# apache2ctl -M > apache2: Could not reliably determine the server's fully qualified domain > name, using 127.0.1.1 for ServerName > Loaded Modules: > core_module (static) > log_config_module (static) > logio_module (static) > mpm_prefork_module (static) > http_module (static) > so_module (static) > alias_module (shared) > auth_basic_module (shared) > authn_file_module (shared) > authz_default_module (shared) > authz_groupfile_module (shared) > authz_host_module (shared) > authz_user_module (shared) > autoindex_module (shared) > cgi_module (shared) > dav_module (shared) > dav_fs_module (shared) > deflate_module (shared) > dir_module (shared) > env_module (shared) > include_module (shared) > mime_module (shared) > negotiation_module (shared) > php5_module (shared) > reqtimeout_module (shared) > rewrite_module (shared) > ruby_module (shared) > setenvif_module (shared) > ssl_module (shared) > status_module (shared) > suexec_module (shared) > wsgi_module (shared) > Syntax OK > root@alan:/home/alan# > > > > > or by looking at the 'pldd' equivalent that mod_python is not being > loaded, as this prevents WSGIPythonHome from working. > > 2. Set LogLevel to 'debug' in Apache at global scope so that mod_wsgi > logs extra details. This extra detail should include when it is > overriding Python home based on WSGIPythonHome. > > Changed. i get more/different stuff in error.log now. Spam like this: > > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5052): Process 'pin' has > died, restarting. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5056): Starting process 'pin' > with uid=1000, gid=1000 and threads=1. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5056): Python home > /usr/bin/python. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5056): Initializing Python. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5053): Process 'pin' has > died, restarting. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5054): Process 'pin' has > died, restarting. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5059): Starting process 'pin' > with uid=1000, gid=1000 and threads=1. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5058): Starting process 'pin' > with uid=1000, gid=1000 and threads=1. > ImportError: No module named site > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5059): Python home > /usr/bin/python. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5058): Python home > /usr/bin/python. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5059): Initializing Python. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5058): Initializing Python. > ImportError: No module named site > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5057): Starting process 'pin' > with uid=1000, gid=1000 and threads=1. > ImportError: No module named site > ImportError: No module named site > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5057): Python home > /usr/bin/python. > [Mon Jul 16 20:14:10 2012] [info] mod_wsgi (pid=5057): Initializing Python. > ImportError: No module named site > > > 3. Try and set the environment variable: > > PYTHONVERBOSE=1 > export PYTHONVERBOSE > > in the 'envvars' file for Apache, or if that doesn't exist in same > directory as 'httpd' binary, use the init.d startup scripts to set it. > > This will result in Python logging lots of details about where it is > importing stuff from on startup. > > Even more spam in error.log now: > root@alan:/etc/apache2# cat /var/log/apache2/error.log | tail -100 > import zipimport # builtin > # installed zipimport hook > ImportError: No module named site > # clear __builtin__._ > # clear sys.path > # clear sys.argv > # clear sys.ps1 > # clear sys.ps2 > # clear sys.exitfunc > # clear sys.exc_type > # clear sys.exc_value > # clear sys.exc_traceback > # clear sys.last_type > # clear sys.last_value > # clear sys.last_traceback > # clear sys.path_hooks > # clear sys.path_importer_cache > # clear sys.meta_path > # clear sys.flags > # clear sys.float_info > # restore sys.stdin > # restore sys.stdout > # restore sys.stderr > # cleanup __main__ > # cleanup[1] zipimport > # cleanup[1] signal > # cleanup[1] exceptions > # cleanup[1] _warnings > # cleanup sys > # cleanup __builtin__ > # cleanup ints: 5 unfreed ints > # cleanup floats > [Mon Jul 16 20:19:31 2012] [info] mod_wsgi (pid=7728): Python home > /usr/bin/python. > [Mon Jul 16 20:19:31 2012] [info] mod_wsgi (pid=7728): Initializing Python. > # installing zipimport hook > import zipimport # builtin > # installed zipimport hook > ImportError: No module named site > # clear __builtin__._ > # clear sys.path > # clear sys.argv > # clear sys.ps1 > # clear sys.ps2 > # clear sys.exitfunc > # clear sys.exc_type > # clear sys.exc_value > # clear sys.exc_traceback > # clear sys.last_type > # clear sys.last_value > # clear sys.last_traceback > # clear sys.path_hooks > # clear sys.path_importer_cache > # clear sys.meta_path > # clear sys.flags > # clear sys.float_info > # restore sys.stdin > # restore sys.stdout > # restore sys.stderr > # cleanup __main__ > # cleanup[1] zipimport > # cleanup[1] signal > # cleanup[1] exceptions > # cleanup[1] _warnings > # cleanup sys > # cleanup __builtin__ > # cleanup ints: 5 unfreed ints > # cleanup floats > # installing zipimport hook > import zipimport # builtin > # installed zipimport hook > ImportError: No module named site > # clear __builtin__._ > # clear sys.path > # clear sys.argv > # clear sys.ps1 > # clear sys.ps2 > # clear sys.exitfunc > # clear sys.exc_type > # clear sys.exc_value > # clear sys.exc_traceback > # clear sys.last_type > # clear sys.last_value > # clear sys.last_traceback > # clear sys.path_hooks > # clear sys.path_importer_cache > # clear sys.meta_path > # clear sys.flags > # clear sys.float_info > # restore sys.stdin > # restore sys.stdout > # restore sys.stderr > # cleanup __main__ > # cleanup[1] zipimport > # cleanup[1] signal > # cleanup[1] exceptions > # cleanup[1] _warnings > # cleanup sys > # cleanup __builtin__ > # cleanup ints: 5 unfreed ints > # cleanup floats > root@alan:/etc/apache2# > > > Graham > alan > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/modwsgi/-/ZuKDdktwdhsJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
