It is odd that you need to force /usr/local/lib into LD_LIBRARY_PATH at run 
time. I thought that was a standard directory Linux systems would check. Looks 
like someone has mucked up the ld.so.cache.

> On 24 Jun 2022, at 3:53 am, Lou King <[email protected]> wrote:
> 
> Success!
> 
> Based on your blog post, I looked at how centos 7 python 3.6 was compiled, 
> removed all the switches about redhat build and host, and referencing 
> specific directories and used the remaining for my ./configure execution
> 
> $ diff python3.6-options.txt python3.6-options-shortened.txt
> 1,3d0
> < '--build=x86_64-redhat-linux-gnu'
> < '--host=x86_64-redhat-linux-gnu'
> < '--program-prefix='
> 5,17d1
> < '--prefix=/usr'
> < '--exec-prefix=/usr'
> < '--bindir=/usr/bin'
> < '--sbindir=/usr/sbin'
> < '--sysconfdir=/etc'
> < '--datadir=/usr/share'
> < '--includedir=/usr/include'
> < '--libdir=/usr/lib64'
> < '--libexecdir=/usr/libexec'
> < '--localstatedir=/var'
> < '--sharedstatedir=/var/lib'
> < '--mandir=/usr/share/man'
> < '--infodir=/usr/share/info'
> 29,30d12
> < 'build_alias=x86_64-redhat-linux-gnu'
> < 'host_alias=x86_64-redhat-linux-gnu'
> 
> so my resulting ./configure was as follows
> 
> ./configure '--disable-dependency-tracking' '--enable-ipv6' '--enable-shared' 
> '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' 
> '--with-system-expat' '--with-system-ffi' 
> '--enable-loadable-sqlite-extensions' '--with-dtrace' 
> '--with-ssl-default-suites=openssl' '--without-ensurepip' 
> '--enable-optimizations' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 
> -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 
> -grecord-gcc-switches   -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv  ' 
> 'LDFLAGS=-Wl,-z,relro  -g  ' 'CPPFLAGS= ' 
> 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
> 
> It turns out on centos 7  --disable-dependency-tracking and  
> --with-system-ffi were unneeded, but I left them in because I had other 
> issues I thought might have been caused by them and leaving them in seemed 
> benign. (apparently I had left some garbage from an interim build which 
> apparently wasn't cleaned up from make clean, so I had to start my build from 
> scratch, but this became apparent right after removing those switches)
> 
>     configure: WARNING: unrecognized options: --disable-dependency-tracking
>     configure: WARNING: --with(out)-system-ffi is ignored on this platform
> 
> Note for my configuration, I need 
> LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib so python3.9 can find the 
> shared library.
> On Saturday, June 18, 2022 at 5:25:55 PM UTC-4 Graham Dumpleton wrote:
> If you are building your own Python make sure you read:
> 
> * http://blog.dscpl.com.au/2015/06/installing-custom-python-version-into.html 
> <http://blog.dscpl.com.au/2015/06/installing-custom-python-version-into.html>
> 
> Ignore that it talks about docker.
> 
> In the past at least, Python out of the box with no configuration doesn't 
> build how you would want it to. Not sure if same is still the case.
> 
> Also be wary of using pyenv to create Python installations, it has a history 
> of not building things in a way that works with embedded systems.
> 
> 
>> On 19 Jun 2022, at 2:52 am, Lou King <[email protected] 
>> <applewebdata://C0E9C2E3-A494-4E33-AA3D-EAA8F0A64BF8>> wrote:
>> 
> 
>> On the off chance, I followed 
>> https://modwsgi.readthedocs.io/en/master/user-guides/installation-issues.html#undefined-forkpty-on-fedora-7
>>  
>> <https://modwsgi.readthedocs.io/en/master/user-guides/installation-issues.html#undefined-forkpty-on-fedora-7>
>>  and edited envvars as follows
>> 
>> LD_PRELOAD=/usr/lib64/libutil.so
>> export LD_PRELOAD
>> 
>> now I see 
>> 
>> $ sudo /etc/mod_wsgi-express/sandbox.routes.loutilities.com/apachectl 
>> <http://sandbox.routes.loutilities.com/apachectl> start
>> httpd (mod_wsgi-express): Syntax error on line 163 of 
>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/httpd.conf: 
>> <http://sandbox.routes.loutilities.com/httpd.conf:>Cannot load 
>> /var/www/sandbox.routes.loutilities.com/venv/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so
>>  
>> <http://sandbox.routes.loutilities.com/venv/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so>
>>  into server: 
>> /var/www/sandbox.routes.loutilities.com/venv/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so:
>>  
>> <http://sandbox.routes.loutilities.com/venv/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so:>
>>  undefined symbol: sincos
>> 
>> I see something at 
>> https://stackoverflow.com/questions/23719304/error-on-apache2-restart-using-mod-python-undefined-symbol-sincos
>>  
>> <https://stackoverflow.com/questions/23719304/error-on-apache2-restart-using-mod-python-undefined-symbol-sincos>
>>  and wondering if I should have done anything differently while building 
>> python?
>> On Saturday, June 18, 2022 at 12:27:25 PM UTC-4 Lou King wrote:
>> I built python 3.9.13, which uses the system openssl (same as apache, I 
>> assue). Now I see the following
>> 
>> $ sudo /etc/mod_wsgi-express/sandbox.routes.loutilities.com/apachectl 
>> <http://sandbox.routes.loutilities.com/apachectl> start
>> httpd (mod_wsgi-express): Syntax error on line 163 of 
>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/httpd.conf 
>> <http://sandbox.routes.loutilities.com/httpd.conf>: Cannot load 
>> /var/www/sandbox.routes.loutilities.com/venv/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so
>>  
>> <http://sandbox.routes.loutilities.com/venv/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so>
>>  into server: 
>> /var/www/sandbox.routes.loutilities.com/venv/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so
>>  
>> <http://sandbox.routes.loutilities.com/venv/lib/python3.9/site-packages/mod_wsgi/server/mod_wsgi-py39.cpython-39-x86_64-linux-gnu.so>:
>>  undefined symbol: forkpty
>> 
>> On Thursday, June 16, 2022 at 5:18:16 PM UTC-4 Lou King wrote:
>> Wow, thanks. This is great information.
>> 
>> I think this means I can't go to python 3.10 because as I understand, it 
>> requires an openssl upgrade. 
>> 
>> On Thu, Jun 16, 2022, 4:49 PM Graham Dumpleton <graham.d...@ <>gmail.com 
>> <http://gmail.com/>> wrote:
>> Your Apache installation and Python installations are compiled against 
>> different SSL library versions. You can't have this, they need to match. You 
>> would need to build any custom Python version against same system SSL 
>> libraries that system Apache is using.
>> 
>>> On 8 Jun 2022, at 3:50 am, Lou King <lous...@ <>gmail.com 
>>> <http://gmail.com/>> wrote:
>>> 
>>> FWIW, I tried rerunning mod_wsgi-express setup-server, and get the same 
>>> results
>>> 
>>> $ sudo LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/custom-openssl/lib 
>>> /root/bin/init-mod_wsgi-express runningroutes 
>>> sandbox.routes.loutilities.com <http://sandbox.routes.loutilities.com/> 
>>> routesmgr routesmgr 8002
>>> Server URL         : http://proxysvr.loutilities.com:8002/ 
>>> <http://proxysvr.loutilities.com:8002/>
>>> Server Root        : /etc/mod_wsgi-express/sandbox.routes.loutilities.com 
>>> <http://sandbox.routes.loutilities.com/>
>>> Server Conf        : 
>>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/httpd.conf 
>>> <http://sandbox.routes.loutilities.com/httpd.conf>
>>> Error Log File     : 
>>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/error_log 
>>> <http://sandbox.routes.loutilities.com/error_log> (warn)
>>> Rewrite Rules      : 
>>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/rewrite.conf 
>>> <http://sandbox.routes.loutilities.com/rewrite.conf>
>>> Environ Variables  : 
>>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/envvars 
>>> <http://sandbox.routes.loutilities.com/envvars>
>>> Control Script     : 
>>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/apachectl 
>>> <http://sandbox.routes.loutilities.com/apachectl>
>>> Operating Mode     : daemon
>>> Request Capacity   : 5 (1 process * 5 threads)
>>> Request Timeout    : 60 (seconds)
>>> Startup Timeout    : 15 (seconds)
>>> Queue Backlog      : 100 (connections)
>>> Queue Timeout      : 45 (seconds)
>>> Server Capacity    : 20 (event/worker), 20 (prefork)
>>> Server Backlog     : 500 (connections)
>>> Locale Setting     : en_US.UTF-8
>>> $ sudo /etc/mod_wsgi-express/sandbox.routes.loutilities.com/apachectl 
>>> <http://sandbox.routes.loutilities.com/apachectl> start
>>> httpd (mod_wsgi-express): Syntax error on line 163 of 
>>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/httpd.conf: 
>>> <http://sandbox.routes.loutilities.com/httpd.conf:>Cannot load 
>>> /var/www/sandbox.routes.loutilities.com/venv/lib/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so
>>>  
>>> <http://sandbox.routes.loutilities.com/venv/lib/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so>
>>>  into server: 
>>> /var/www/sandbox.routes.loutilities.com/venv/lib/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so:
>>>  
>>> <http://sandbox.routes.loutilities.com/venv/lib/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so:>
>>>  undefined symbol: GENERAL_NAME_free
>>> 
>>> where
>>> 
>>> $ sudo cat /root/bin/init-mod_wsgi-express
>>> #!/bin/bash
>>> if [[ $# -lt 5 ]] ; then
>>>    echo "usage:"
>>>    echo "    init-mod_wsgi-express project servername user group port"
>>>    exit 0
>>> fi
>>> 
>>> source /var/www/$2/venv/bin/activate
>>> mod_wsgi-express setup-server --server-name proxysvr.loutilities.com 
>>> <http://proxysvr.loutilities.com/> --port $5 --user $3 --group $4 
>>> /var/www/$2/$1/$1/$1.wsgi --working-directory /var/www/$2/$1/$1/ 
>>> --server-root /etc/mod_wsgi-express/$2
>>> deactivate
>>> 
>>> 
>>> 
>>> On Monday, June 6, 2022 at 6:43:46 AM UTC-4 Lou King wrote:
>>> I'm getting an error trying to start a service which uses mod_wsgi 4.9.1 in 
>>> a virtual environment.
>>> 
>>> On my centos 7 system, I compiled python 3.10, which is altinstalled to 
>>> /usr/local/bin/python3.10
>>> 
>>> I have a virtualenv, but may have initially built mod_wsgi with an earlier 
>>> version of python 3.10 (I was having trouble getting it to build 
>>> correctly). However, my last attempt I used 
>>> 
>>> pip install --ignore-installed --no-cache-dir mod_wsgi==4.9.1 --no-binary 
>>> mod_wsgi
>>> 
>>> to try to get it to build with the latest python3.10 (I tried several pip 
>>> installs, starting with just --no-cache-dir)
>>> 
>>> Note I am trying to upgrade several applications to python3.10, so for the 
>>> most part I have left the original files created by mod_wsgi-express 
>>> setup-serveralone under the centos7 yum installed python 3.6, mod_wsgi 4.7.0
>>> 
>>> I've hand-edited 
>>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/httpd.conf 
>>> <http://sandbox.routes.loutilities.com/httpd.conf> as follows
>>>     159c159
>>>     < LoadModule wsgi_module 
>>> '/var/www/sandbox.routes.loutilities.com/venv/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
>>>  
>>> <http://sandbox.routes.loutilities.com/venv/lib64/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so>'
>>>     ---
>>>     > LoadModule wsgi_module 
>>> '/var/www/sandbox.routes.loutilities.com/venv/lib64/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so
>>>  
>>> <http://sandbox.routes.loutilities.com/venv/lib64/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so>'
>>> 
>>> I'm not sure this is sufficient to "shift" to the new python version, but I 
>>> was hoping to touch as little as possible rather than setting everything up 
>>> again for 8 applications.
>>> I see the following in journalctl when I try to start the service.
>>> 
>>> Jun 05 08:55:02 loutility-server-digitalocean apachectl[23870]: httpd 
>>> (mod_wsgi-express): Syntax error on line 159 of 
>>> /etc/mod_wsgi-express/sandbox.routes.loutilities.com/httpd.conf 
>>> <http://sandbox.routes.loutilities.com/httpd.conf>: Cannot load 
>>> /var/www/sandbox.routes.loutilities.com/venv/lib64/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so
>>>  
>>> <http://sandbox.routes.loutilities.com/venv/lib64/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so>
>>>  into server: 
>>> /var/www/sandbox.routes.loutilities.com/venv/lib64/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so
>>>  
>>> <http://sandbox.routes.loutilities.com/venv/lib64/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so>:
>>>  undefined symbol: GENERAL_NAME_free
>>> 
>>> I notice the following from the build directory
>>> 
>>> Python-3.10.4]$ grep -R GENERAL_NAME_free . ./Modules/_ssl.c: 
>>> sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); 
>>> Binary file ./Modules/_ssl.o matches 
>>> Binary file ./python matches 
>>> Binary file ./libpython3.10.a matches Binary file ./Programs/_testembed 
>>> matches
>>> 
>>> and libpython3.10.a is in 
>>> /usr/local/lib/python3.10/config-3.10-x86_64-linux-gnu:
>>> 
>>> $ find /usr/local/lib -name libpython3.10.a
>>> /usr/local/lib/libpython3.10.a
>>> /usr/local/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.a
>>> 
>>> What other debugging steps should I take? Do I need to re-run 
>>> mod_wsgi-express? setup-server. Is mod_wsgi not being built correctly? Or 
>>> something else?
>>> 
>>> -- 
>>> 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 modwsgi+u...@ <>googlegroups.com <http://googlegroups.com/>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/modwsgi/ca6481d3-bded-4b98-9437-5d10992762ffn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/modwsgi/ca6481d3-bded-4b98-9437-5d10992762ffn%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> 
>> 
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "modwsgi" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/modwsgi/KZZQHpFclGA/unsubscribe 
>> <https://groups.google.com/d/topic/modwsgi/KZZQHpFclGA/unsubscribe>.
>> To unsubscribe from this group and all its topics, send an email to 
>> modwsgi+u...@ <>googlegroups.com <http://googlegroups.com/>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/modwsgi/29311AFA-71AC-4621-AE08-DA0DAC5C1219%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/modwsgi/29311AFA-71AC-4621-AE08-DA0DAC5C1219%40gmail.com?utm_medium=email&utm_source=footer>.
>> 
>> -- 
>> 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] 
>> <applewebdata://C0E9C2E3-A494-4E33-AA3D-EAA8F0A64BF8>.
> 
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/modwsgi/e5b4ffab-a80f-49da-a82a-c37e909af436n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/modwsgi/e5b4ffab-a80f-49da-a82a-c37e909af436n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/modwsgi/7610f31f-293b-421f-a5c5-013aaa241ea2n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/modwsgi/7610f31f-293b-421f-a5c5-013aaa241ea2n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/5EC3B7DC-33AD-4589-9CA0-F248CBC8B7E0%40gmail.com.

Reply via email to