Force Apache HTTPD to run in 32bit

◇◆丶佛笑我妖孽 提交于 2019-12-08 02:41: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.

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.


回答1:


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



回答2:


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



回答3:


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.



来源:https://stackoverflow.com/questions/261927/force-apache-httpd-to-run-in-32bit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!