无法将mod_wsgi加载到服务器中:

时间:2021-06-11 16:52:47

I want to install mod_wsgi-4.4.11 so that I can use Django and apache for local web development but I am unsuccessful. These are the steps/commands that I have taken in my attempts to install mod_wsgi-4.4.11. I am using the Apple system python version. I downloaded mod_wsgi-4.4.11 according to the quick instructions from code.google.com/p/modwsgi/wiki/QuickInstallationGuide. The steps/commands that used were as follows:

我想安装mod_wsgi-4.4.11以便我可以使用Django和apache进行本地Web开发但是我没有成功。这些是我在尝试安装mod_wsgi-4.4.11时采取的步骤/命令。我正在使用Apple系统python版本。我根据code.google.com/p/modwsgi/wiki/QuickInstallationGuide的快速说明下载了mod_wsgi-4.4.11。使用的步骤/命令如下:

1) Downloaded mod_wsgi as a zip, cd to the folder 2)./configure 3) make 4) sudo make install 4) added the line LoadModule wsgi_module /usr/libexec/apache2/mod_wsgi.so to the http.conf file, stopped and started apache server 5) httpd -t.

1)下载mod_wsgi作为zip,cd下载到文件夹2)./ configure 3)make 4)sudo make install 4)将行LoadModule wsgi_module /usr/libexec/apache2/mod_wsgi.so添加到http.conf文件中,停止并启动了apache服务器5)httpd -t。

I receive the following error.

我收到以下错误。

Syntax error on line 172 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_wsgi.so into server: dlopen(/usr/libexec/apache2/mod_wsgi.so, 10): Symbol not found: _PyBool_Type\n Referenced from: /usr/libexec/apache2/mod_wsgi.so\n Expected in: flat namespace\n in /usr/libexec/apache2/mod_wsgi.so

/private/etc/apache2/httpd.conf第172行的语法错误:无法将/usr/libexec/apache2/mod_wsgi.so加载到服务器:dlopen(/usr/libexec/apache2/mod_wsgi.so,10):符号不发现:_PyBool_Type \ n引自:/usr/libexec/apache2/mod_wsgi.so\n预期在:/ namespace / libmanc /apache2 / mod_wsgi.so中的平面命名空间\ n

I cd to /usr/libexec/apache2 and I run otool -L mod_wsgi.so and the output is:

我cd到/ usr / libexec / apache2,我运行otool -L mod_wsgi.so,输出是:

mod_wsgi.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0) Daniels-MacBook-Pro:apache2 Daniel$

mod_wsgi.so:/usr/lib/libSystem.B.dylib(兼容版本1.0.0,当前版本1213.0.0)/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation(兼容版本150.0.0,当前版本1153.18.0)Daniels-MacBook-Pro:apache2 Daniel $

Makefile when configure was run:

运行configure时的Makefile:

LDFLAGS = LDFLAGS = -L/Library/Frameworks/Python.framework/Versions/2.7/lib -L/Library/Frameworks/

LDFLAGS = LDFLAGS = -L / Library / Frameworks / Python.framework / Versions / 2.7 / lib -L ​​/ Library / Frameworks /

LDLIBS = -lpython2.7 -ldl -framework CoreFoundation

LDLIBS = -lpython2.7 -ldl -framework CoreFoundation

It was suggested that I use pip to install mod_wsgi. I followed the instructions from https://pypi.python.org/pypi/mod_wsgi/4.4.11. The commands/actions I took were as follows: 1) Upgraded pip to 6.1.1 2) pip install mod_wsgi (installed successfully) 3) ran mod_wsgi-express start-server 4) Received error: ValueError: unknown locale: UTF-8

有人建议我使用pip来安装mod_wsgi。我按照https://pypi.python.org/pypi/mod_wsgi/4.4.11的说明进行操作。我采取的命令/操作如下:1)升级到6.1.1 2)pip install mod_wsgi(已成功安装)3)运行mod_wsgi-express start-server 4)收到错误:ValueError:未知语言环境:UTF-8

When I run the locale command the LANG variable is assigned to nothing it looks like this: LANG =

当我运行locale命令时,LANG变量被赋值为nothing,如下所示:LANG =

1 个解决方案

#1


I restored the state of my system to a point before I installed IDLE, followed the installation instructions listed above and successfully installed and loaded the module. I then followed the instructions to configure the application (https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide) and successfully printed out hello world. Since the configuration guide was a bit confusing I used the google group (https://groups.google.com/forum/#!forum/modwsgi) which helped to answer my questions during this process. In case anyone has a similar problem.

我在安装IDLE之前将系统状态恢复到了一个点,按照上面列出的安装说明成功安装并加载了模块。然后我按照说明配置应用程序(https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide)并成功打印出hello world。由于配置指南有点令人困惑,我使用了谷歌组(https://groups.google.com/forum/#!forum/modwsgi),这有助于在此过程中回答我的问题。如果有人有类似的问题。

#1


I restored the state of my system to a point before I installed IDLE, followed the installation instructions listed above and successfully installed and loaded the module. I then followed the instructions to configure the application (https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide) and successfully printed out hello world. Since the configuration guide was a bit confusing I used the google group (https://groups.google.com/forum/#!forum/modwsgi) which helped to answer my questions during this process. In case anyone has a similar problem.

我在安装IDLE之前将系统状态恢复到了一个点,按照上面列出的安装说明成功安装并加载了模块。然后我按照说明配置应用程序(https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide)并成功打印出hello world。由于配置指南有点令人困惑,我使用了谷歌组(https://groups.google.com/forum/#!forum/modwsgi),这有助于在此过程中回答我的问题。如果有人有类似的问题。