Python 烧瓶、apache 和 mod_wsgi 应用程序不工作

Posted

技术标签:

【中文标题】Python 烧瓶、apache 和 mod_wsgi 应用程序不工作【英文标题】:Python flask, apache and mod_wsgi application not working 【发布时间】:2018-10-06 22:31:58 【问题描述】:

我正在尝试在 python 中构建一个可以从 XAMPP 的 Apache 运行的应用程序,因此我安装了 flask ($ pip install flask) 并按照以下说明安装 mod_wsgi http://modwsgi.readthedocs.io/en/develop/user-guides/quick-installation-guide.html。 我正在使用来自 XAMPP 的 Apache,版本 2.4.29 和来自 anaconda 的 python 3.6.4。我通过从https://github.com/GrahamDumpleton/mod_wsgi/releases 下载并使用以下命令构建了 mod_wsgi 文件(版本 4.6.4):

$ ./configure --with-apxs=/Applications/XAMPP/xamppfiles/bin/apxs --with-python=/Users/pauline/anaconda3/bin/python3.6 --disable-framework

紧随其后的是makesudo make install。我也尝试过使用和不使用--disable-framework。安装后,我检查了otool -L mod_wsgi.so,它给了我(看起来正确):

SCARLET10siMac4:modules pauline$ otool -L mod_wsgi.so mod_wsgi.so: @rpath/libpython3.6m.dylib (compatibility version 3.6.0, current version 3.6.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1452.23.0)

此外,当检查 Apache 加载的模块时(通过运行此命令:/Applications/XAMPP/xamppfiles/bin/httpd -M),它也会显示wsgi_module (shared)sys.prefix 的输出是 /Users/pauline/anaconda3 和 sys.version 的输出是 3.6.4

我的应用程序 (image_download.py) 有以下简单代码:

from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
    return 'Index Page'

@app.route('/hello')
def hello():
   return 'Hello, World'

if __name__ == "__main__":
   app.run()

还有我的wsgi文件(image_download.wsgi)如下:

 import sys
 sys.path.insert(0,"/Users/pauline/Documents/Code/platform_projects/image_download/image_download")
 from image_download import app as application

最后,我的 http.conf 虚拟主机部分是:

 WSGIPythonHome /Users/pauline/anaconda3
 <VirtualHost *:80>
 DocumentRoot "/Users/pauline/Documents/Code/platform_projects/image_download"
 ServerName imageDownload.localhost
 ServerAlias imageDownload.localhost
 WSGIDaemonProcess image_download user=daemon group=daemon threads=5     home=/Users/pauline/Documents/Code/platform_projects/image_download python-path=/Users/pauline/Documents/Code/platform_projects/image_download:/Users/pauline/anaconda3/lib/python3.6/site-packages
 WSGIScriptAlias / /Users/pauline/Documents/Code/platform_projects/image_download/image_download.wsgi
 <Directory /Users/pauline/Documents/Code/platform_projects/image_download>
 WSGIProcessGroup image_download
 WSGIApplicationGroup %GLOBAL
 Require all granted
 </Directory>
 </VirtualHost>

当我作为本地主机运行我的应用程序时,它给了我一个服务器错误!错误 500,当我检查 apache 错误日志时,它显示以下内容:

 [wsgi:error] [pid 6011] [remote ::1:50865] mod_wsgi (pid=6011): Target WSGI script '/Users/pauline/Documents/Code/platform_projects/image_download/image_download.wsgi' cannot be loaded as Python module.
 [wsgi:error] [pid 6011] [remote ::1:50865] mod_wsgi (pid=6011): Exception occurred processing WSGI script '/Users/pauline/Documents/Code/platform_projects/image_download/image_download.wsgi'. 
 [wsgi:error] [pid 6011] [remote ::1:50865] Traceback (most recent call last):
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/anaconda3/lib/python3.6/site-packages/werkzeug/http.py", line 27, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     from urllib.request import parse_http_list as _parse_list_header
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/anaconda3/lib/python3.6/urllib/request.py", line 2585, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     from _scproxy import _get_proxy_settings, _get_proxies
 [wsgi:error] [pid 6011] [remote ::1:50865] ImportError: dlopen(/Users/pauline/anaconda3/lib/python3.6/lib-dynload/_scproxy.cpython-36m-darwin.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
 [wsgi:error] [pid 6011] [remote ::1:50865]   Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
 [wsgi:error] [pid 6011] [remote ::1:50865]   Expected in: /Applications/XAMPP/xamppfiles/lib/libjpeg.8.dylib
 [wsgi:error] [pid 6011] [remote ::1:50865]  in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
 [wsgi:error] [pid 6011] [remote ::1:50865] 
 [wsgi:error] [pid 6011] [remote ::1:50865] During handling of the above exception, another exception occurred:
 [wsgi:error] [pid 6011] [remote ::1:50865] 
 [wsgi:error] [pid 6011] [remote ::1:50865] Traceback (most recent call last):
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/Documents/Code/platform_projects/image_download/image_download.wsgi", line 13, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     from image_download import app as application
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/Documents/Code/platform_projects/image_download/image_download.py", line 9, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     from flask import Flask
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/anaconda3/lib/python3.6/site-packages/flask/__init__.py", line 17, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     from werkzeug.exceptions import abort
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/anaconda3/lib/python3.6/site-packages/werkzeug/__init__.py", line 151, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     __import__('werkzeug.exceptions')
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/anaconda3/lib/python3.6/site-packages/werkzeug/exceptions.py", line 71, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     from werkzeug.wrappers import Response
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/anaconda3/lib/python3.6/site-packages/werkzeug/wrappers.py", line 27, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     from werkzeug.http import HTTP_STATUS_CODES, \\
 [wsgi:error] [pid 6011] [remote ::1:50865]   File "/Users/pauline/anaconda3/lib/python3.6/site-packages/werkzeug/http.py", line 30, in <module>
 [wsgi:error] [pid 6011] [remote ::1:50865]     from urllib2 import parse_http_list as _parse_list_header, \\
 [wsgi:error] [pid 6011] [remote ::1:50865] ModuleNotFoundError: No module named 'urllib2'

当我通过 Flask 运行程序时,它运行得非常好。但是,当通过 apache localhost 运行它时,它会显示服务器错误。因此,我主要怀疑问题来自于错误安装mod_wsgi.so,但是,我无法调试它,尽管安装步骤(上面提到的)似乎是正确的。

【问题讨论】:

您是否也将 php 模块加载到 Apache 中? Anaconda Python 附带了许多库的自己的版本。如果您还加载了 PHP,它可能正在导入系统版本的库,并且这些库的优先级高于 Python 发行版中的那些,因此针对 Python 发行版构建的 Python 包将失败。 我还建议不要对 mod_wsgi 使用 configure/make/make install 安装方法。使用pip install 方法,如pypi.org/project/mod_wsgi 中所述,安装后,使用mod_wsgi-express module-config 生成您应该添加到Apache 以加载mod_wsgi 模块的配置。它应该生成一个LoadFile 指令以确保正确加载 Anaconda Python 库。 我用pip install方法尝试了第二种方法,得到了完全相同的错误。实际上 PHP 模块也是从 Apache 加载的,我能做些什么呢? 其实可能不是PHP,而是XAMPP本身。 ls -las /Applications/XAMPP/xamppfiles/lib 得到什么? 不能使用XAMPP 分发吗?这是导致这里问题的原因是在使用 mod_wsgi 时无法与 Anaconda Python 甚至 System Python 一起使用。他们为所有东西运送自己的库会引起冲突。 【参考方案1】:

ls -las /Applications/XAMPP/xamppfiles/lib 的输出如下:

    0 drwxr-xr-x  273 root  admin      9282 Feb  6 17:18 .
    0 drwxrwxr-x   38 root  admin      1292 Apr 23 10:29 ..
    8 -rw-r--r--    1 root  admin         8 Feb  6 17:18 VERSION
    0 drwxr-xr-x   14 root  admin       476 Feb  6 17:18 apr-util-1
   24 -rw-r--r--    1 root  admin      9278 Jan 17 01:24 apr.exp
   16 -rw-r--r--    1 root  admin      5549 Jan 17 01:24 aprutil.exp
 5632 -rw-r--r--    1 root  admin   2879936 Jan 17 01:22 c-client.a
    8 -rw-r--r--    1 root  admin       637 Jan 17 01:10 charset.alias
    0 drwxr-xr-x    3 root  admin       102 Feb  6 17:17 cmake
    0 drwxr-xr-x   14 root  admin       476 Feb  6 17:17 engines
    0 drwxr-xr-x    6 root  admin       204 Feb  6 17:17 gettext
    0 drwxr-xr-x    6 root  admin       204 Feb  6 17:18 icu
    8 lrwxr-xr-x    1 root  admin        24 Feb  6 17:18 instantclient -> instantclient-11.2.0.3.0
    0 drwxr-xr-x   29 root  admin       986 Feb  6 17:18 instantclient-11.2.0.3.0
  432 -rwxr-xr-x    1 root  admin    218856 Jan 17 01:24 libapr-1.0.dylib
  640 -rw-r--r--    1 root  admin    323944 Jan 17 01:24 libapr-1.a
    8 lrwxr-xr-x    1 root  admin        16 Feb  6 17:18 libapr-1.dylib -> libapr-1.0.dylib
    8 -rwxr-xr-x    1 root  admin      1016 Jan 17 01:24 libapr-1.la
  128 -rwxr-xr-x    1 root  admin     64604 Jan 17 03:22 libapreq2.3.7.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libapreq2.3.dylib -> libapreq2.3.7.1.dylib
  152 -rw-r--r--    1 root  admin     75992 Jan 17 03:22 libapreq2.a
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libapreq2.dylib -> libapreq2.3.7.1.dylib
    8 -rwxr-xr-x    1 root  admin      1127 Jan 17 03:22 libapreq2.la
  352 -rwxr-xr-x    1 root  admin    178408 Jan 17 01:24 libaprutil-1.0.dylib
  488 -rw-r--r--    1 root  admin    248320 Jan 17 01:24 libaprutil-1.a
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libaprutil-1.dylib -> libaprutil-1.0.dylib
    8 -rwxr-xr-x    1 root  admin      1181 Jan 17 01:24 libaprutil-1.la
   24 -rwxr-xr-x    1 root  admin      9716 Jan 17 01:10 libasprintf.0.dylib
   16 -rw-r--r--    1 root  admin      5256 Jan 17 01:10 libasprintf.a
    8 lrwxr-xr-x    1 root  admin        19 Feb  6 17:18 libasprintf.dylib -> libasprintf.0.dylib
    8 -rwxr-xr-x    1 root  admin       993 Jan 17 01:10 libasprintf.la
  152 -rwxr-xr-x    1 root  admin     73884 Jan 17 01:15 libbz2.1.0.6.dylib
    8 lrwxr-xr-x    1 root  admin        18 Feb  6 17:18 libbz2.1.0.dylib -> libbz2.1.0.6.dylib
  392 -rw-r--r--    1 root  admin    198264 Jan 17 01:15 libbz2.a
    8 lrwxr-xr-x    1 root  admin        18 Feb  6 17:18 libbz2.dylib -> libbz2.1.0.6.dylib
    8 lrwxr-xr-x    1 root  admin        10 Feb  6 17:18 libc-client.a -> c-client.a
   24 -rw-r--r--    1 root  admin      9176 Jan 17 01:07 libcharset.1.dylib
    8 -rw-r--r--    1 root  admin      3848 Jan 17 01:07 libcharset.a
    8 lrwxr-xr-x    1 root  admin        18 Feb  6 17:18 libcharset.dylib -> libcharset.1.dylib
    8 -rw-r--r--    1 root  admin       983 Jan 17 01:07 libcharset.la
 4352 -rwxr-xr-x    1 root  admin   2225252 Jan 17 01:19 libcrypto.1.0.0.dylib
 6952 -rw-r--r--    1 root  admin   3557720 Jan 17 01:19 libcrypto.a
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libcrypto.dylib -> libcrypto.1.0.0.dylib
  744 -rwxr-xr-x    1 root  admin    378648 Jan 17 01:29 libct.4.dylib
 1064 -rw-r--r--    1 root  admin    541464 Jan 17 01:29 libct.a
    8 lrwxr-xr-x    1 root  admin        13 Feb  6 17:18 libct.dylib -> libct.4.dylib
    8 -rwxr-xr-x    1 root  admin      1038 Jan 17 01:29 libct.la
  928 -rwxr-xr-x    1 root  admin    471072 Jan 17 01:22 libcurl.4.dylib
 1368 -rw-r--r--    1 root  admin    699384 Jan 17 01:22 libcurl.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libcurl.dylib -> libcurl.4.dylib
    8 -rwxr-xr-x    1 root  admin      1146 Jan 17 01:22 libcurl.la
  392 -rwxr-xr-x    1 root  admin    197976 Jan 17 01:22 libexpat.1.5.2.dylib
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libexpat.1.dylib -> libexpat.1.5.2.dylib
  440 -rw-r--r--    1 root  admin    224560 Jan 17 01:22 libexpat.a
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libexpat.dylib -> libexpat.1.5.2.dylib
    8 -rwxr-xr-x    1 root  admin       868 Jan 17 01:22 libexpat.la
  176 -rwxr-xr-x    1 root  admin     88448 Jan 17 01:23 libexslt.0.dylib
  216 -rw-r--r--    1 root  admin    108784 Jan 17 01:23 libexslt.a
    8 lrwxr-xr-x    1 root  admin        16 Feb  6 17:18 libexslt.dylib -> libexslt.0.dylib
    8 -rwxr-xr-x    1 root  admin      1163 Jan 17 01:23 libexslt.la
    8 -rw-r--r--    1 root  admin      1472 Jan 17 01:14 libfl.a
  152 -rwxr-xr-x    1 root  admin     76976 Jan 17 03:19 libform.5.dylib
  232 -rw-r--r--    1 root  admin    115440 Jan 17 03:19 libform.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libform.dylib -> libform.5.dylib
 1152 -rw-r--r--    1 root  admin    586624 Jan 17 03:19 libform_g.a
 1336 -rwxr-xr-x    1 root  admin    681372 Jan 17 01:16 libfreetype.6.dylib
 1632 -rw-r--r--    1 root  admin    833640 Jan 17 01:16 libfreetype.a
    8 lrwxr-xr-x    1 root  admin        19 Feb  6 17:18 libfreetype.dylib -> libfreetype.6.dylib
    8 -rwxr-xr-x    1 root  admin      1000 Jan 17 01:16 libfreetype.la
  552 -rwxr-xr-x    1 root  admin    279420 Jan 17 01:16 libgd.2.0.0.dylib
    8 lrwxr-xr-x    1 root  admin        17 Feb  6 17:18 libgd.2.dylib -> libgd.2.0.0.dylib
  632 -rw-r--r--    1 root  admin    322120 Jan 17 01:16 libgd.a
    8 lrwxr-xr-x    1 root  admin        17 Feb  6 17:18 libgd.dylib -> libgd.2.0.0.dylib
    8 -rwxr-xr-x    1 root  admin      1082 Jan 17 01:16 libgd.la
   56 -rwxr-xr-x    1 root  admin     27700 Jan 17 03:03 libgdbm.3.0.0.dylib
    8 lrwxr-xr-x    1 root  admin        19 Feb  6 17:18 libgdbm.3.dylib -> libgdbm.3.0.0.dylib
   72 -rw-r--r--    1 root  admin     36312 Jan 17 03:03 libgdbm.a
    8 lrwxr-xr-x    1 root  admin        19 Feb  6 17:18 libgdbm.dylib -> libgdbm.3.0.0.dylib
    8 -rwxr-xr-x    1 root  admin       737 Jan 17 03:03 libgdbm.la
 1704 -rwxr-xr-x    1 root  admin    872004 Jan 17 01:10 libgettextlib-0.18.1.dylib
 2248 -rw-r--r--    1 root  admin   1149000 Jan 17 01:10 libgettextlib.a
    8 lrwxr-xr-x    1 root  admin        26 Feb  6 17:18 libgettextlib.dylib -> libgettextlib-0.18.1.dylib
    8 -rwxr-xr-x    1 root  admin      1166 Jan 17 01:10 libgettextlib.la
  648 -rwxr-xr-x    1 root  admin    328412 Jan 17 01:10 libgettextpo.0.dylib
  992 -rw-r--r--    1 root  admin    505072 Jan 17 01:10 libgettextpo.a
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libgettextpo.dylib -> libgettextpo.0.dylib
    8 -rwxr-xr-x    1 root  admin      1133 Jan 17 01:10 libgettextpo.la
  552 -rwxr-xr-x    1 root  admin    282404 Jan 17 01:10 libgettextsrc-0.18.1.dylib
  808 -rw-r--r--    1 root  admin    410824 Jan 17 01:10 libgettextsrc.a
    8 lrwxr-xr-x    1 root  admin        26 Feb  6 17:18 libgettextsrc.dylib -> libgettextsrc-0.18.1.dylib
    8 -rwxr-xr-x    1 root  admin      1218 Jan 17 01:10 libgettextsrc.la
 1912 -rw-r--r--    1 root  admin    977048 Jan 17 01:07 libiconv.2.dylib
    8 lrwxr-xr-x    1 root  admin        16 Feb  6 17:18 libiconv.dylib -> libiconv.2.dylib
    8 -rw-r--r--    1 root  admin       961 Jan 17 01:07 libiconv.la
35712 -rw-r--r--    1 root  admin  18280536 Jan 17 01:29 libicudata.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libicudata.48.dylib -> libicudata.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libicudata.dylib -> libicudata.48.1.1.dylib
 4472 -rwxr-xr-x    1 root  admin   2286488 Jan 17 01:29 libicui18n.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libicui18n.48.dylib -> libicui18n.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libicui18n.dylib -> libicui18n.48.1.1.dylib
  112 -rwxr-xr-x    1 root  admin     55384 Jan 17 01:29 libicuio.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libicuio.48.dylib -> libicuio.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libicuio.dylib -> libicuio.48.1.1.dylib
  536 -rwxr-xr-x    1 root  admin    270572 Jan 17 01:29 libicule.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libicule.48.dylib -> libicule.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libicule.dylib -> libicule.48.1.1.dylib
  112 -rwxr-xr-x    1 root  admin     53944 Jan 17 01:29 libiculx.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libiculx.48.dylib -> libiculx.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libiculx.dylib -> libiculx.48.1.1.dylib
  136 -rwxr-xr-x    1 root  admin     68560 Jan 17 01:29 libicutest.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libicutest.48.dylib -> libicutest.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libicutest.dylib -> libicutest.48.1.1.dylib
  312 -rwxr-xr-x    1 root  admin    157120 Jan 17 01:29 libicutu.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libicutu.48.dylib -> libicutu.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libicutu.dylib -> libicutu.48.1.1.dylib
 3032 -rwxr-xr-x    1 root  admin   1552160 Jan 17 01:29 libicuuc.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libicuuc.48.dylib -> libicuuc.48.1.1.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libicuuc.dylib -> libicuuc.48.1.1.dylib
  120 -rw-r--r--    1 root  admin     58192 Jan 17 01:10 libintl.8.dylib
  160 -rw-r--r--    1 root  admin     81504 Jan 17 01:10 libintl.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libintl.dylib -> libintl.8.dylib
    8 -rw-r--r--    1 root  admin      1057 Jan 17 01:10 libintl.la
  576 -rwxr-xr-x    1 root  admin    291624 Jan 17 01:15 libjpeg.8.dylib
  688 -rw-r--r--    1 root  admin    348544 Jan 17 01:15 libjpeg.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libjpeg.dylib -> libjpeg.8.dylib
    8 -rwxr-xr-x    1 root  admin       968 Jan 17 01:15 libjpeg.la
  144 -rw-r--r--    1 root  admin     69848 Jan 17 01:20 liblber-2.4.2.5.4.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 liblber-2.4.2.dylib -> liblber-2.4.2.5.4.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 liblber.dylib -> liblber-2.4.2.5.4.dylib
    8 -rw-r--r--    1 root  admin       915 Jan 17 01:21 liblber.la
  632 -rw-r--r--    1 root  admin    321228 Jan 17 01:21 libldap-2.4.2.5.4.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libldap-2.4.2.dylib -> libldap-2.4.2.5.4.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libldap.dylib -> libldap-2.4.2.5.4.dylib
    8 -rw-r--r--    1 root  admin       984 Jan 17 01:21 libldap.la
  680 -rw-r--r--    1 root  admin    347212 Jan 17 01:21 libldap_r-2.4.2.5.4.dylib
    8 lrwxr-xr-x    1 root  admin        25 Feb  6 17:18 libldap_r-2.4.2.dylib -> libldap_r-2.4.2.5.4.dylib
    8 lrwxr-xr-x    1 root  admin        25 Feb  6 17:18 libldap_r.dylib -> libldap_r-2.4.2.5.4.dylib
    8 -rw-r--r--    1 root  admin       996 Jan 17 01:21 libldap_r.la
   72 -rwxr-xr-x    1 root  admin     33864 Jan 17 01:06 libltdl.3.1.0.dylib
    8 lrwxr-xr-x    1 root  admin        19 Feb  6 17:18 libltdl.3.dylib -> libltdl.3.1.0.dylib
   72 -rw-r--r--    1 root  admin     35792 Jan 17 01:06 libltdl.a
    8 lrwxr-xr-x    1 root  admin        19 Feb  6 17:18 libltdl.dylib -> libltdl.3.1.0.dylib
    8 -rwxr-xr-x    1 root  admin       903 Jan 17 01:06 libltdl.la
    0 drwxr-xr-x    2 root  admin        68 Feb  6 17:17 libmcrypt
  528 -rwxr-xr-x    1 root  admin    266900 Jan 17 01:21 libmcrypt.4.4.8.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libmcrypt.4.dylib -> libmcrypt.4.4.8.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libmcrypt.dylib -> libmcrypt.4.4.8.dylib
    8 -rwxr-xr-x    1 root  admin       897 Jan 17 01:21 libmcrypt.la
   72 -rwxr-xr-x    1 root  admin     34372 Jan 17 03:19 libmenu.5.dylib
  104 -rw-r--r--    1 root  admin     49896 Jan 17 03:19 libmenu.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libmenu.dylib -> libmenu.5.dylib
  584 -rw-r--r--    1 root  admin    296992 Jan 17 03:19 libmenu_g.a
  408 -rwxr-xr-x    1 root  admin    207980 Jan 17 03:24 libmhash.2.0.1.dylib
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libmhash.2.dylib -> libmhash.2.0.1.dylib
  456 -rw-r--r--    1 root  admin    230920 Jan 17 03:24 libmhash.a
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libmhash.dylib -> libmhash.2.0.1.dylib
    8 -rwxr-xr-x    1 root  admin       884 Jan 17 03:24 libmhash.la
  992 -rwxr-xr-x    1 root  admin    506748 Jan 17 03:19 libming.1.dylib
 1520 -rw-r--r--    1 root  admin    775992 Jan 17 03:19 libming.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libming.dylib -> libming.1.dylib
    8 -rwxr-xr-x    1 root  admin      1122 Jan 17 03:19 libming.la
 7744 -rwxr-xr-x    1 root  admin   3964748 Jan 17 03:01 libmysqlclient.18.dylib
18776 -rw-r--r--    1 root  admin   9609408 Jan 17 03:01 libmysqlclient.a
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libmysqlclient.dylib -> libmysqlclient.18.dylib
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libmysqlclient_r.18.dylib -> libmysqlclient.dylib
    8 lrwxr-xr-x    1 root  admin        16 Feb  6 17:18 libmysqlclient_r.a -> libmysqlclient.a
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libmysqlclient_r.dylib -> libmysqlclient.dylib
   88 -rw-r--r--    1 root  admin     43928 Jan 17 03:01 libmysqlservices.a
  272 -rw-r--r--    1 root  admin    135528 Jan 17 03:20 libncurses++.a
  632 -rwxr-xr-x    1 root  admin    322584 Jan 17 03:19 libncurses.5.dylib
 1048 -rw-r--r--    1 root  admin    533552 Jan 17 03:19 libncurses.a
    8 lrwxr-xr-x    1 root  admin        18 Feb  6 17:18 libncurses.dylib -> libncurses.5.dylib
 4512 -rw-r--r--    1 root  admin   2309112 Jan 17 03:19 libncurses_g.a
  360 -rwxr-xr-x    1 root  admin    181020 Jan 17 01:25 libnghttp2.14.dylib
  520 -rw-r--r--    1 root  admin    263784 Jan 17 01:25 libnghttp2.a
    8 lrwxr-xr-x    1 root  admin        19 Feb  6 17:18 libnghttp2.dylib -> libnghttp2.14.dylib
    8 -rwxr-xr-x    1 root  admin      1036 Jan 17 01:25 libnghttp2.la
   32 -rwxr-xr-x    1 root  admin     13508 Jan 17 03:19 libpanel.5.dylib
   32 -rw-r--r--    1 root  admin     16320 Jan 17 03:19 libpanel.a
    8 lrwxr-xr-x    1 root  admin        16 Feb  6 17:18 libpanel.dylib -> libpanel.5.dylib
  200 -rw-r--r--    1 root  admin     98784 Jan 17 03:19 libpanel_g.a
  576 -rwxr-xr-x    1 root  admin    292028 Jan 17 01:07 libpcre.1.dylib
  608 -rw-r--r--    1 root  admin    308592 Jan 17 01:07 libpcre.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libpcre.dylib -> libpcre.1.dylib
    8 -rwxr-xr-x    1 root  admin       966 Jan 17 01:07 libpcre.la
   24 -rwxr-xr-x    1 root  admin      8948 Jan 17 01:07 libpcreposix.0.dylib
   16 -rw-r--r--    1 root  admin      4432 Jan 17 01:07 libpcreposix.a
    8 lrwxr-xr-x    1 root  admin        20 Feb  6 17:18 libpcreposix.dylib -> libpcreposix.0.dylib
    8 -rwxr-xr-x    1 root  admin      1042 Jan 17 01:07 libpcreposix.la
    8 lrwxr-xr-x    1 root  admin        10 Feb  6 17:18 libpng.a -> libpng15.a
    8 lrwxr-xr-x    1 root  admin        14 Feb  6 17:18 libpng.dylib -> libpng15.dylib
    8 lrwxr-xr-x    1 root  admin        11 Feb  6 17:18 libpng.la -> libpng15.la
  384 -rwxr-xr-x    1 root  admin    193508 Jan 17 01:15 libpng15.15.dylib
  520 -rw-r--r--    1 root  admin    265128 Jan 17 01:15 libpng15.a
    8 lrwxr-xr-x    1 root  admin        17 Feb  6 17:18 libpng15.dylib -> libpng15.15.dylib
    8 -rwxr-xr-x    1 root  admin       980 Jan 17 01:15 libpng15.la
  360 -rwxr-xr-x    1 root  admin    182820 Jan 17 01:32 libpq.5.5.dylib
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libpq.5.dylib -> libpq.5.5.dylib
  512 -rw-r--r--    1 root  admin    259176 Jan 17 01:32 libpq.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libpq.dylib -> libpq.5.5.dylib
 1912 -rwxr-xr-x    1 root  admin    976728 Jan 17 03:03 libsablot.0.100.3.dylib
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libsablot.0.dylib -> libsablot.0.100.3.dylib
 2776 -rw-r--r--    1 root  admin   1419176 Jan 17 03:03 libsablot.a
    8 lrwxr-xr-x    1 root  admin        23 Feb  6 17:18 libsablot.dylib -> libsablot.0.100.3.dylib
    8 -rwxr-xr-x    1 root  admin       912 Jan 17 03:03 libsablot.la
  848 -rwxr-xr-x    1 root  admin    430984 Jan 17 03:49 libsqlite.0.8.6.dylib
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libsqlite.0.dylib -> libsqlite.0.8.6.dylib
 1160 -rw-r--r--    1 root  admin    590648 Jan 17 03:49 libsqlite.a
    8 lrwxr-xr-x    1 root  admin        21 Feb  6 17:18 libsqlite.dylib -> libsqlite.0.8.6.dylib
    8 -rwxr-xr-x    1 root  admin       887 Jan 17 03:49 libsqlite.la
 2448 -rwxr-xr-x    1 root  admin   1251080 Jan 17 01:31 libsqlite3.0.8.6.dylib
    8 lrwxr-xr-x    1 root  admin        22 Feb  6 17:18 libsqlite3.0.dylib -> libsqlite3.0.8.6.dylib
 2864 -rw-r--r--    1 root  admin   1462768 Jan 17 01:31 libsqlite3.a
    8 lrwxr-xr-x    1 root  admin        22 Feb  6 17:18 libsqlite3.dylib -> libsqlite3.0.8.6.dylib
    8 -rwxr-xr-x    1 root  admin       915 Jan 17 01:31 libsqlite3.la
  928 -rwxr-xr-x    1 root  admin    471064 Jan 17 01:19 libssl.1.0.0.dylib
 1232 -rw-r--r--    1 root  admin    626736 Jan 17 01:19 libssl.a
    8 lrwxr-xr-x    1 root  admin        18 Feb  6 17:18 libssl.dylib -> libssl.1.0.0.dylib
  896 -rwxr-xr-x    1 root  admin    458128 Jan 17 01:29 libsybdb.5.dylib
 1256 -rw-r--r--    1 root  admin    642648 Jan 17 01:29 libsybdb.a
    8 lrwxr-xr-x    1 root  admin        16 Feb  6 17:18 libsybdb.dylib -> libsybdb.5.dylib
    8 -rwxr-xr-x    1 root  admin      1056 Jan 17 01:29 libsybdb.la
  848 -rwxr-xr-x    1 root  admin    431448 Jan 17 01:29 libtdsodbc.0.so
 1200 -rw-r--r--    1 root  admin    612936 Jan 17 01:29 libtdsodbc.a
    8 -rwxr-xr-x    1 root  admin      1072 Jan 17 01:29 libtdsodbc.la
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libtdsodbc.so -> libtdsodbc.0.so
  832 -rwxr-xr-x    1 root  admin    423052 Jan 17 01:15 libtiff.5.dylib
 1056 -rw-r--r--    1 root  admin    540008 Jan 17 01:15 libtiff.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libtiff.dylib -> libtiff.5.dylib
    8 -rwxr-xr-x    1 root  admin       975 Jan 17 01:15 libtiff.la
   32 -rwxr-xr-x    1 root  admin     14968 Jan 17 01:15 libtiffxx.5.dylib
   24 -rw-r--r--    1 root  admin      8648 Jan 17 01:15 libtiffxx.a
    8 lrwxr-xr-x    1 root  admin        17 Feb  6 17:18 libtiffxx.dylib -> libtiffxx.5.dylib
    8 -rwxr-xr-x    1 root  admin      1033 Jan 17 01:15 libtiffxx.la
 3432 -rwxr-xr-x    1 root  admin   1755940 Jan 17 01:23 libxml2.2.dylib
 4648 -rw-r--r--    1 root  admin   2379096 Jan 17 01:23 libxml2.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libxml2.dylib -> libxml2.2.dylib
    8 -rwxr-xr-x    1 root  admin      1065 Jan 17 01:23 libxml2.la
    0 drwxr-xr-x    2 root  admin        68 Feb  6 17:17 libxslt-plugins
  504 -rwxr-xr-x    1 root  admin    254616 Jan 17 01:23 libxslt.1.dylib
  696 -rw-r--r--    1 root  admin    356296 Jan 17 01:23 libxslt.a
    8 lrwxr-xr-x    1 root  admin        15 Feb  6 17:18 libxslt.dylib -> libxslt.1.dylib
    8 -rwxr-xr-x    1 root  admin      1111 Jan 17 01:23 libxslt.la
    8 -rw-r--r--    1 root  admin      1808 Jan 17 01:14 liby.a
  184 -rwxr-xr-x    1 root  admin     91968 Jan 17 01:07 libz.1.2.8.dylib
    8 lrwxr-xr-x    1 root  admin        16 Feb  6 17:18 libz.1.dylib -> libz.1.2.8.dylib
  216 -rw-r--r--    1 root  admin    107520 Jan 17 01:07 libz.a
    8 lrwxr-xr-x    1 root  admin        16 Feb  6 17:18 libz.dylib -> libz.1.2.8.dylib
   64 -rwxr-xr-x    1 root  admin     30332 Jan 17 03:23 libzzip-0.13.dylib
   72 -rw-r--r--    1 root  admin     35248 Jan 17 03:23 libzzip.a
    8 lrwxr-xr-x    1 root  admin        18 Feb  6 17:18 libzzip.dylib -> libzzip-0.13.dylib
    8 -rwxr-xr-x    1 root  admin      1014 Jan 17 03:23 libzzip.la
   32 -rwxr-xr-x    1 root  admin     13952 Jan 17 03:23 libzzipfseeko-0.13.dylib
   24 -rw-r--r--    1 root  admin      9176 Jan 17 03:23 libzzipfseeko.a
    8 lrwxr-xr-x    1 root  admin        24 Feb  6 17:18 libzzipfseeko.dylib -> libzzipfseeko-0.13.dylib
    8 -rwxr-xr-x    1 root  admin      1050 Jan 17 03:23 libzzipfseeko.la
   40 -rwxr-xr-x    1 root  admin     19692 Jan 17 03:23 libzzipmmapped-0.13.dylib
   40 -rw-r--r--    1 root  admin     18960 Jan 17 03:23 libzzipmmapped.a
    8 lrwxr-xr-x    1 root  admin        25 Feb  6 17:18 libzzipmmapped.dylib -> libzzipmmapped-0.13.dylib
    8 -rwxr-xr-x    1 root  admin      1056 Jan 17 03:23 libzzipmmapped.la
   24 -rwxr-xr-x    1 root  admin      9288 Jan 17 03:23 libzzipwrap-0.13.dylib
    8 -rw-r--r--    1 root  admin      3648 Jan 17 03:23 libzzipwrap.a
    8 lrwxr-xr-x    1 root  admin        22 Feb  6 17:18 libzzipwrap.dylib -> libzzipwrap-0.13.dylib
    8 -rwxr-xr-x    1 root  admin      1084 Jan 17 03:23 libzzipwrap.la
    0 drwxr-xr-x    3 root  admin       102 Feb  6 17:17 mysql
    0 drwxr-xr-x    4 root  admin       136 Feb  6 17:17 perl5
    0 drwxr-xr-x   71 root  admin      2414 Feb  6 17:17 php
    0 drwxr-xr-x   33 root  admin      1122 Feb  6 17:18 pkgconfig
    0 drwxr-xr-x    2 root  admin        68 Feb  6 17:17 proftpd
    0 drwxr-xr-x    3 root  admin       102 Feb  6 17:17 python2.6
    8 lrwxr-xr-x    1 root  admin        17 Feb  6 17:18 terminfo -> ../share/terminfo
    8 -rw-r--r--    1 root  admin       269 Jan 17 01:23 xml2Conf.sh
    8 -rw-r--r--    1 root  admin       283 Jan 17 01:23 xsltConf.sh

【讨论】:

以上是关于Python 烧瓶、apache 和 mod_wsgi 应用程序不工作的主要内容,如果未能解决你的问题,请参考以下文章

Windows10下Apache2.4配置Django

如何在 apache windows 10 中使用烧瓶修复错误 500

apache_conf 烧瓶,发送电子邮件,163

无法使用 pymssql 烧瓶连接到 ms sql 服务器

在 Apache 服务器上部署烧瓶应用程序的问题

在 apache(centos 7)上运行烧瓶应用程序时被禁止 403