强制Apache HTTPD以32位运行

时间:2021-12-24 20:47:34

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.

通过从二进制文件(以及ppc部分)中删除32位架构,我一直在64位模式下运行Apache HTTPD。我这样做是为了使它与python和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.

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

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

我的选择仅限于剥离它,或者是否有我不了解的启动选择。

3 个解决方案

#1


3  

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(1)命令更改使用的体系结构。这将首先尝试Intel 32位,然后尝试32位PPC:

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

#2


3  

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:

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

First, create the 32-bit version of httpd:

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

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":

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

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

Lastly, restart Apache:

最后,重启Apache:

sudo apachectl restart

#3


0  

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.

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

#1


3  

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(1)命令更改使用的体系结构。这将首先尝试Intel 32位,然后尝试32位PPC:

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

#2


3  

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:

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

First, create the 32-bit version of httpd:

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

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":

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

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

Lastly, restart Apache:

最后,重启Apache:

sudo apachectl restart

#3


0  

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.

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