为什么我的 mod_wsgi 模块找不到 "libpython3.7m.so.1.0",即使它存在?
Why can't my mod_wsgi module find "libpython3.7m.so.1.0" even though it exists?
我正在使用 CentOS 7、Apache 2.4 和 Python 3.7 band mod_wsgi 4.6.5。我正在尝试使用 Apache 安装 mod_wsgi。我创建了文件 /etc/httpd/conf.modules.d/10-wsgi.conf,其中包含内容
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so
但是当我尝试加载 Apache 时,它因错误而终止
[myuser@server mod_wsgi-4.6.5]$ sudo apachectl configtest
httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.modules.d/10-wsgi.conf: Cannot load /usr/lib64/httpd/modules/mod_wsgi.so into server: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
[myuser@server mod_wsgi-4.6.5]$ cat /etc/httpd/conf.modules.d/10-wsgi.conf
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so
httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.modules.d/10-wsgi.conf: Cannot load /usr/lib64/httpd/modules/mod_wsgi.so into server: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
我已验证此文件存在于我的文件系统中
[myuser@server mod_wsgi-4.6.5]$ echo $LD_LIBRARY_PATH
/usr/local/lib
[myuser@server mod_wsgi-4.6.5]$ ls -al /usr/local/lib/libpython3.7m.so.1.0
-r-xr-xr-x 1 root root 13683680 Feb 27 18:01 /usr/local/lib/libpython3.7m.so.1.0
我不知道还要检查什么才能让我的系统相信一切都在那里。感谢您的帮助,-
是否启用了selinux?检查 selinux 是否在此处阻止访问:
grep "httpd" /var/log/audit/audit.log
我从来没有偶然发现这个问题的根本原因,但是当我添加这一行时
LoadFile /usr/local/lib/libpython3.7m.so.1.0
到我的 /etc/httpd/conf.modules.d/10-wsgi.conf 文件的顶部并重新启动我的服务器,一切正常。
我正在使用 CentOS 7、Apache 2.4 和 Python 3.7 band mod_wsgi 4.6.5。我正在尝试使用 Apache 安装 mod_wsgi。我创建了文件 /etc/httpd/conf.modules.d/10-wsgi.conf,其中包含内容
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so
但是当我尝试加载 Apache 时,它因错误而终止
[myuser@server mod_wsgi-4.6.5]$ sudo apachectl configtest
httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.modules.d/10-wsgi.conf: Cannot load /usr/lib64/httpd/modules/mod_wsgi.so into server: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
[myuser@server mod_wsgi-4.6.5]$ cat /etc/httpd/conf.modules.d/10-wsgi.conf
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so
httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.modules.d/10-wsgi.conf: Cannot load /usr/lib64/httpd/modules/mod_wsgi.so into server: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
我已验证此文件存在于我的文件系统中
[myuser@server mod_wsgi-4.6.5]$ echo $LD_LIBRARY_PATH
/usr/local/lib
[myuser@server mod_wsgi-4.6.5]$ ls -al /usr/local/lib/libpython3.7m.so.1.0
-r-xr-xr-x 1 root root 13683680 Feb 27 18:01 /usr/local/lib/libpython3.7m.so.1.0
我不知道还要检查什么才能让我的系统相信一切都在那里。感谢您的帮助,-
是否启用了selinux?检查 selinux 是否在此处阻止访问:
grep "httpd" /var/log/audit/audit.log
我从来没有偶然发现这个问题的根本原因,但是当我添加这一行时
LoadFile /usr/local/lib/libpython3.7m.so.1.0
到我的 /etc/httpd/conf.modules.d/10-wsgi.conf 文件的顶部并重新启动我的服务器,一切正常。