我正在使用CentOS 7,Apache 2.4和Python 3.7频段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
我不知道还需要检查什么以说服我的系统。感谢您的帮助-
答案 0 :(得分:0)
selinux是否启用?检查selinux在这里是否没有阻止访问:
grep "httpd" /var/log/audit/audit.log
答案 1 :(得分:0)
我从来没有偶然发现过这个问题的根本原因,但是当我添加这一行时
LoadFile /usr/local/lib/libpython3.7m.so.1.0
在我的/etc/httpd/conf.modules.d/10-wsgi.conf文件的顶部并重新启动服务器,一切正常。