Apache config being re-generated when using OSX Server?

1

I recently installed OSX Server on a clean install of Yosemite 10.10.3, and wanted to customise the apache config to change the version of PHP being used by the server. I installed php using homebrew and made the changes to the apache config file. This worked fine, until the next day when I noticed that apache had reverted back to using the default version of PHP that ships with Yosemite.

After playing around for a bit I realised that the apache config file I was editing (/Library/Server/Web/Config/apache2/httpd_server_app.conf) is being re-generated every time the OSX Server application is re-started, reverting it back to the default version of PHP that ships with Yosemite.

Is there a default httpd.conf that OSX Sever generates it's httpd_server_app.conf from?

UPDATE:

I did a little more digging. When I added the LoadModule call to the httpd_server_app.conf I commented out the old version and added the call to the new one on the next line.

#LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so

When restarting the server, the newly re-generated file looks like so (the call to the new module remains, but the call to the old module is uncommented):

LoadModule php5_module libexec/apache2/libphp5.so
LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so

Apache loads the first module, which in this case would be the old version. If I place the the new module call above the old one, then this solves the problem for me. Although it doesn't feel like an ideal solution, as I am still left with the other LoadModule call uncommented.

I imagine there are other scenarios relating to editing the apache config where simply changing the order wouldn't solve the problem.

Jeemusu

Posted 2015-05-21T08:17:56.693

Reputation: 111

No answers