I have now changed the Makefile to use python3.3m instead of python3.3, and 
also used LD_RUN_PATH and it's working just fine.

The application itself is running as well, but I have not tested it 
extensively yet. But I believe that all remaining problems (if any) are 
most likely related to the application code and not mod_wsgi.

Thanks anyway for the swift and helpful reply! :)

On Saturday, 14 December 2013 19:59:43 UTC+1, Michel Albert wrote:
>
> I did indeed see a python3.3m.so lying around. When I get back to the 
> office on Monday I'll try out your ideas.
>
> Thanks!
>
> On Saturday, 14 December 2013 11:03:04 UTC+1, Graham Dumpleton wrote:
>>
>> What is in:
>>
>> /opt/python3.3/lib
>>
>> Provide 'ls -las' output for that directory.
>>
>> The Python library is not usually called libpython3.so. It always has the 
>> minor version in it.
>>
>> On some platforms it can be libpython3.3m.so and the latest tar ball 
>> release of mod_wsgi doesn't cope with that from memory and so it would have 
>> been necessary to use -lpython3.3m. I can't remember if other suffixes are 
>> used.
>>
>> As to not finding the library at run time, LD_LIBRARY_PATH would need to 
>> have been set and exported in the Apache startup scripts, or envvars file 
>> if distro supported it. A better way though is to set and export just while 
>> compiling mod_wsgi:
>>
>> LD_RUN_PATH=/opt/python3.3/lib
>>
>> This will embed the path in mod_wsgi.so file and nothing would need to be 
>> set at run time.
>>
>> Make sure you are doing a 'make distclean' between builds and rerun 
>> configure for mod_wsgi when setting this to make sure not using cached 
>> build results.
>>
>> Graham
>>
>> On 14/12/2013, at 1:28 AM, Michel Albert <[email protected]> wrote:
>>
>> Hi,
>>
>>
>> We are in the process of migrating to Python 3. So far, everything works 
>> fine, and our first application is ready to be deployed on our staging box. 
>> Unfortunately, this still runs mod_wsgi on Python 2.7, and the code is 
>> deliberately not *yet* back-ported to Py2.
>>
>> In the process, we also want to switch from mpm-prefork to mpm-worker. 
>> There is one major problem though. The server still runs one legacy PHP 
>> application, and, as I understood it, PHP only runs on prefork. And indeed, 
>> trying to install mpm-worker in Ubuntu complains about this.
>>
>> Because of this, we decided to run a second apache instance, on a 
>> different port. To avoid conflicts with the system's packaging system we 
>> recompiled python3, apache, and also mod_wsgi from source. All is compiled 
>> with a different prefix to avoid collisions with existing files. The ``
>> --configure`` lines are:
>>
>> python3:   $ ./configure --prefix=/opt/python3.3 --enable-shared 
>> --with-threads
>> apache2:   $ ./configure --prefix=/opt/apache2-python3
>> mod_wsgi:  $ ./configure --with-apxs=/usr/src/httpd-2.4.7/support/apxs 
>> --with-python=/opt/python3.3/bin/python3
>>
>>
>> Apache2 and Python3 work fine. But the compilation of mod_wsgi caused 
>> problems. The Makefile generated from the configure script contained the 
>> following line:
>>
>> LDLIBS =  -lpython3.3 -lpthread -ldl  -lutil -lm
>>
>>
>> which gave the following compilation error:
>>
>> /usr/bin/ld: cannot find -lpython3.3
>> collect2: ld returned 1 exit status
>> apxs:Error: Command failed with rc=65536
>>
>>
>> ... and I solved it by hand-editing the Makefile, removing the ".3" file 
>> suffix:
>>
>> LDLIBS =  -lpython3 -lpthread -ldl  -lutil -lm
>>
>>
>> running make on mod_wsgi, created the mod_wsgi.so file. We moved this 
>> over to the apache2 modules folder and added the LoadModule. But then, 
>> running apache gave us this:
>>
>> /opt/apache2-python3/bin/apachectl -e debug -DFOREGROUND
>> [Fri Dec 13 15:25:37.066959 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module authn_file_module from 
>> /opt/apache2-python3/modules/mod_authn_file.so
>> [Fri Dec 13 15:25:37.067480 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module authn_core_module from 
>> /opt/apache2-python3/modules/mod_authn_core.so
>> [Fri Dec 13 15:25:37.067795 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module authz_host_module from 
>> /opt/apache2-python3/modules/mod_authz_host.so
>> [Fri Dec 13 15:25:37.068121 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module authz_groupfile_module from 
>> /opt/apache2-python3/modules/mod_authz_groupfile.so
>> [Fri Dec 13 15:25:37.068427 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module authz_user_module from 
>> /opt/apache2-python3/modules/mod_authz_user.so
>> [Fri Dec 13 15:25:37.068783 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module authz_core_module from 
>> /opt/apache2-python3/modules/mod_authz_core.so
>> [Fri Dec 13 15:25:37.069129 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module access_compat_module from 
>> /opt/apache2-python3/modules/mod_access_compat.so
>> [Fri Dec 13 15:25:37.069454 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module auth_basic_module from 
>> /opt/apache2-python3/modules/mod_auth_basic.so
>> [Fri Dec 13 15:25:37.069796 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module reqtimeout_module from 
>> /opt/apache2-python3/modules/mod_reqtimeout.so
>> [Fri Dec 13 15:25:37.070172 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module filter_module from 
>> /opt/apache2-python3/modules/mod_filter.so
>> [Fri Dec 13 15:25:37.070652 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module mime_module from 
>> /opt/apache2-python3/modules/mod_mime.so
>> [Fri Dec 13 15:25:37.071010 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module log_config_module from 
>> /opt/apache2-python3/modules/mod_log_config.so
>> [Fri Dec 13 15:25:37.071358 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module env_module from 
>> /opt/apache2-python3/modules/mod_env.so
>> [Fri Dec 13 15:25:37.071689 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module headers_module from 
>> /opt/apache2-python3/modules/mod_headers.so
>> [Fri Dec 13 15:25:37.072052 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module setenvif_module from 
>> /opt/apache2-python3/modules/mod_setenvif.so
>> [Fri Dec 13 15:25:37.072442 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module version_module from 
>> /opt/apache2-python3/modules/mod_version.so
>> [Fri Dec 13 15:25:37.072780 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module unixd_module from 
>> /opt/apache2-python3/modules/mod_unixd.so
>> [Fri Dec 13 15:25:37.073105 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module status_module from 
>> /opt/apache2-python3/modules/mod_status.so
>> [Fri Dec 13 15:25:37.073449 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module autoindex_module from 
>> /opt/apache2-python3/modules/mod_autoindex.so
>> [Fri Dec 13 15:25:37.073799 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module dir_module from 
>> /opt/apache2-python3/modules/mod_dir.so
>> [Fri Dec 13 15:25:37.074149 2013] [so:debug] [pid 23049:tid 3074689344] 
>> mod_so.c(266): AH01575: loaded module alias_module from 
>> /opt/apache2-python3/modules/mod_alias.so
>> httpd: Syntax error on line 151 of /opt/apache2-python3/conf/httpd.conf: 
>> Cannot load modules/mod_wsgi.so into server: 
>> /opt/apache2-python3/modules/mod_wsgi.so: undefined symbol: PyExc_SystemExit
>>
>>
>> I also tried to prefix various commands with "
>> LD_LIBRARY_PATH=/opt/python3.3/lib" which did not help very much :(
>>
>>
>> Any ideas what we could have missed?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "modwsgi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/modwsgi.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to