强制 Apache HTTPD 以 32 位运行

发布于 2024-07-08 20:53:14 字数 223 浏览 9 评论 0原文

我通过从二进制文件(以及 ppc 部分)中剥离 32 位架构,以 64 位模式运行 Apache HTTPD。 我这样做是为了使其与 python 和 mysql 更加兼容。

然而,我有另一台机器需要它以 32 位模式运行(它仍然包含所有四种原始架构)。 是否可以确保它在 32 位模式下运行,并且针对它编译的任何内容都使用所述模式。

我的选择仅限于剥离它,还是有我不知道的启动选项。

I have been running Apache HTTPD in 64bit mode by stripping out the 32bit architecture from the binary (along with the ppc parts). I did this to make it more compatible for python and mysql.

However I have another machine that needs it to be run in 32bit mode (it has all four original architectures still in it). Is it possible to make sure that it is running in 32 bit mode and that anything compiled against it uses said mode.

Are my options limited to stripping it, or are there start up optiosn that I do not know about.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

叹梦 2024-07-15 20:53:14

您可以使用 arch(1)< /code>命令更改使用的架构。 这将首先尝试 Intel 32 位,然后尝试 PPC 32 位:

% arch -i386 -ppc /usr/sbin/httpd

You can use the arch(1) command to change the which architecture is used. This will try Intel 32-bit first and then PPC 32-bit:

% arch -i386 -ppc /usr/sbin/httpd
愛放△進行李 2024-07-15 20:53:14

此方法将复制 Apache 二进制文件并确保 apachectl(以及正常的操作系统配置)能够正确启动 32 位版本:

首先,创建 httpd 的 32 位版本:

sudo lipo -thin i386 /usr/sbin/httpd -output /usr/sbin/httpd.i386

其次,编辑系统配置,以便它使用新版本而不是默认版本。 将“/usr/sbin/httpd”更改为“/usr/sbin/httpd.i386”:

sudo vi /System/Library/LaunchDaemons/org.apache.httpd.plist

最后,重新启动 Apache:

sudo apachectl restart

This method will make a copy of the Apache binary and ensure that apachectl (and hence, the normal OS config) will properly start the 32-bit version:

First, create the 32-bit version of httpd:

sudo lipo -thin i386 /usr/sbin/httpd -output /usr/sbin/httpd.i386

Second, edit the system configuration so it uses the new version instead of the default. Change "/usr/sbin/httpd" to "/usr/sbin/httpd.i386":

sudo vi /System/Library/LaunchDaemons/org.apache.httpd.plist

Lastly, restart Apache:

sudo apachectl restart
南烟 2024-07-15 20:53:14

请注意,这样做将阻止 apache 加载任何 64 位共享模块 - 例如,如果您使用 EntropyPHP,这可能是一个问题。

Note that doing so will prevent apache from loading any 64bit shared modules - if you're using EntropyPHP, for instance, this can be a problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文