- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我使用 Zend Studio/Zend Server 开发基于 PHP 的网站,但现在我正在学习 Python 类(class),并且我想学习 Django。
我有一台 Windows 7 AMD-64 机器,我使用的是 64 位 Python 2.6(类(class)要求 2.6 版),这部分工作正常。
我的问题是尝试将 mod_wsgi 添加到我的 Zend Server 的 32 位 Apache 安装中。我已经为 Python 2.6 下载了几个版本的 mod_wsgi 32 位 Windows 二进制文件,并将它们复制到 C:Program Files (x86)\Zend\Apache2\modules 目录,编辑 httpd.conf 并添加:
LoadModule wsgi_module modules/mod_wsgi.so
重新启动 Apached2.2-Zend,然后测试 mod_wsgi 是否在命令提示符下加载:
httpd -t -M
但是,mod_wsgi 不会出现在已加载模块的列表中。
我最终认为这可能行不通,因为我无法将 64 位 Python 2.6 与 32 位 ZendServer Apache2.2 混合搭配。
所以这是我的问题的核心:
我可以安装 64 位版本的 Apache 2.2 并与 ZendServer Apache2.2 同时运行吗(但是配置 64 位版本,这样它就不会监听与我的 ZendSever Apache2.2 相同的端口) 所以我所有的本地 PHP 虚拟主机仍然有效?也许我会更幸运地让 mod_wsgi 加载这个 Apache?
或者,安装 32 位版本的 Python 会更好吗(可能是像 Python 2.8 这样的更高版本,因为我的类(class)作业只需要 Python 2.6,而且我正在尝试让 Django 只为我自己的网站工作网站开发)?这会允许我的 ZendServer Apache2.2 加载 mod_wsgi 吗?另外,如果我的 Windows 7 机器上安装了这两个 Python,Apache 如何确定它应该使用哪个 Python 安装?
最佳答案
Can I install a 64-bit version of Apache 2.2 and run that at the same time as ZendServer Apache2.2 (but configure the 64-bit version so it doesn't listen on the same ports as my ZendSever Apache2.2)
是的,你可以。
您已经考虑过最困难的问题:它不能在相同的端口上监听。
一个相关的问题是有些人的网络不允许他们建立到端口 8080 的传出连接;如果你想处理这个问题,你需要设置你的 ZendServer 作为其他服务器的转发代理。但仅此而已。
唯一的另一个问题是您需要确保您的两个 Apache 副本不会尝试共享相同的配置文件等(您可能也不希望它们都在您的 PATH 中)。
Or, would it be better to install a 32-bit version of Python (probably a higher version like Python 2.8
没有 2.8,也永远不会有。最后一个 2.x 版本是 2.7(尽管它继续得到错误修复,并且最高为 2.7.5)。如果你想要更高的东西,你必须去 3.x。如果您需要的一切都在 3.3 上运行(Django 1.5+ 也可以),并且您愿意了解这些小的变化,那么您应该考虑这一点。但是,如果您想坚持使用已知的知识,请获取 2.7.5。
Would that allow my ZendServer Apache2.2 to load mod_wsgi?
好吧,如果您使用 Python 2.6 的 mod_wsgi
并安装 Python 2.7 或 3.3...或者使用原生 Python 的 mod_wsgi
并安装 Cygwin Python ……等等。但我怀疑您已经知道了(鉴于“我已经下载了几个版本的 mod_wsgi 32 位 Windows 二进制文件,适用于 Python 2.6”)。
除此之外,是的。只要一切都正确构建和配置,它就会工作。 (我不知道你下载并安装了哪些特定的软件包,所以我当然不能保证它们是否有效。)
Also, how does Apache figure out which installation of Python it should be using if I have both on my Windows 7 machine?
这是可配置的。我相信默认是使用它首先在您的 PATH
上找到的任何内容,或者使用在您的注册表设置中显示为“默认 python 2.x”的任何内容,如 Python 命令行启动器所使用的在 PEP 397 中描述. (当然,如果该 Python 不是它的构建对象,它将无法启动。)
关于python - Apache mod_wsgi 32 位/64 位 Python 兼容性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16660305/
大中型 python WSGI 应用,Apache + mod_wsgi 还是 Nginx + mod_wsgi 用什么? 哪种组合需要更多的内存和 CPU 时间? 哪个更快? 哪个以比另一个更稳定而
我通过 python CGI 脚本 (Apache2.4) 继承了在 AWS EC2 Windows 实例和 WAMP 服务器上运行的 Web 应用程序。我希望将 Web 应用程序转换为 Flask,
当我输入: [root@lts5 /]# ldd /usr/lib64/httpd/modules/mod_wsgi.so libpython2.5.so.1.0 => /root/epd-5
我正在尝试在 Ubuntu 16.04.6 服务器上部署带有 Apache2 和 mod_wsgi 的 Django 应用程序,但我正在努力让 mod_wsgi 使用正确的 python 版本。 我从
介绍 我有一个用 python 3 编写的 Web API,它使用 flask 。当我从终端运行 Web API 时,代码运行良好,它托管在代码的以下行中。 if __name__ == '__mai
我的 Django 项目中的 MemoryError 有一个奇怪的问题。 Ubuntu 11 Apache 2 Nginx mod_wsgi python2.7 我有一个使用 PIL 调整图像大小的模
在这里撕扯我的头发试图弄清楚为什么我的两个 Django 项目没有被分开提供......似乎首先访问的静态文件成为两个项目的事实上的静态文件,或者类似的东西。 我试图通过同一个 IP 地址的两个域名为
我正在通过发出一个需要 30 多分钟才能完成的请求来测试在 Apache Web 服务器上运行的 Python Flask Web 应用程序的限制。该请求需要向 MySQL 数据库发送数千个数据库请求
有谁知道如何制作mod_wsgi当任何模块更改时自动重新加载 Flask 应用程序?我试过WSGIScriptReloading On ,但没有运气。 official documentation有点
使用 mod_wsgi 部署应用程序时出现以下错误 [Thu Apr 07 11:23:32 2011] [error] [client localhost] IOError: [Errno 13]
我有用 Django 开发的普通内容管理网站。我的客户有一个具有 256 MB RAM 的服务器。他想以 wsgi 模式部署此站点。 256 MB RAM 是否足够?我对服务器 RAM 要求等一无所知
我对 Python 和 Python Web 应用程序开发比较陌生。目前我正在使用 mod_wsgi 在 Python 中创建一个 hello world 应用程序 这是我的配置。 Apache 配置
我有一个 wsgi 应用程序作为 mod_wsgi 守护进程(在守护进程模式下)运行。我的设置是每个守护进程在 1000 个请求后重新启动,如 mod_wsgi 配置指南中所示: http://cod
我在centos系统上安装了Postgres、mod_wsgi和python3.5。我已经测试了连接,它在交互式 Python shell 和开发应用程序中都运行良好(它是一个 Pyramid 应用程
我在 Centos 6 服务器上使用 Python Flask,mod_wsgi 突然不能工作了。 这是错误信息。 mod_wsgi (pid=6206): Target WSGI script '/
我一直在研究在运行 Python/mod_wsgi 的网络场中创建快速缓存的不同系统。 Memcache 和其他是选项......但我想知道: 因为我不需要跨机器共享数据,希望每台机器都维护一个本地缓
我在 apache2 上运行 mod_wsgi。它正在运行 Django,出于某种原因,在我更改代码后,旧版本有时会与新代码一起显示。 例如,在创建一个仅返回带“Hi”的 Http 响应的 View
当我尝试安装 mod_wsgi 时遇到以下错误 ./configure checking for apxs2... no checking for apxs... /usr/sbin/apxs che
我正在使用 Hostgator 开发 Linux Centos 虚拟主机。我使用的是 httpd 版本 2.2.15。 我使用标签 --with-python=/usr/local/bin/pytho
我使用 CherryPy、Apache 和 mod_wsgi 构建了一个网站,除了一个问题之外,一切都很好。当用户操作要求自动发送电子邮件时,我有时会使用 os.fork ,以便父进程可以立即返回并向
我是一名优秀的程序员,十分优秀!