OS-X Leopard Apache starting up not behaving as expected

apache-2.2mac-osxosx-leopard

I am in the process of trying to get a PHP PDO MySQL driver up and running under Leopard and I am basically following ideas from Tom Gidden in forcing Apache to run as i386 instead of the Leopard default of x86_64.

As per Tom's ideas I have copied

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

to

/Library/LaunchDaemons/org.apache.httpd.plist 

And added a flag run Apache in 32 bit mode:

<string>arch</string>
<string>-i386</string>
<string>/usr/sbin/httpd</string>
<string>-D</string>
<string>FOREGROUND</string>

I have also confirmed from the Arch documentation that /Library/LaunchDemons should be processed before /System/Library/LaunchDaemons

When I reboot my mac and check the process by the Activity Monitor, the httpd process is flagged as "intel" – which is what I expect to see.

However if I open up the System Preferences->Sharing and restart Apache by Unchecking and rechecking the "Web Sharing" option, Apache starts up in 64 bit mode (as seen in Activity Monitor as an "Intel (64 bit)" process. This is not what I expected to see!

So my question are:

  • Why am I seeing that starting Apache via the System Preferences result in different behaviour than via a reboot?

  • Should I remove/rename the /System/Library/LaunchDaemons/org.apache.httpd.plist file, or is there a better way of doing things?

  • Or am I just doing things in a plain crazy manner?

Thanks for your help.

Anyone??

Best Answer

If you are looking to do things outside of the Apple setup and want consistent control, consider using Macports. It will allow you to have complete control over what version of Apache, MySQL and PHP you are using, etc.

One issue with relying on Apple's kit of Apache+PHP is that they can and will update it in a Software Update w/o much warning. And that can leave your your AMP stack broken :(