This habratopic will be from a series on how to organize MAMP (Mac OS X + Apache + MySQL + PHP) under Mac OS X with your own hands.
Let's start by updating Apache 2.
I think Mac OS X Leopard users know that Apache (version 2, starting with 10.5.2) already comes with the operating system. But this does not mean that the ability to independently update your Apache is useless.
')
Note: in order for you to succeed, you need to install Developer Tools
Since the organization of files, etc. on Mac OS it differs from those used in other Unix systems (equal to them because we will work through the terminal) and the location of the files of the same pre-installed Apache differs from the standard one, I will give instructions on how to update the web server without creating its extra copies and preserving the management function of them through Sharing in System Preferences.
So let's get started. To get started, download the latest version of the Apache source (at the time of writing habratopik - 2.2.8) -
here (I will clarify, we need Unix Source - here is a
direct link ).
We will unpack it somewhere in a safe place (I note that we will not delete these sortsy - on the contrary, they will lie with us for the subsequent addition of components with the least effort - with such need).
Open the Terminal (Utilities folder in Applications). Tulim to that folder command, let's say it lies in the src folder, in the user's home folder:
cd ~/src/httpd-2.2.8
In this folder, open config.layout and append the following to the end:
prefix: /usr
exec_prefix: ${prefix}
bindir: ${exec_prefix}/bin
sbindir: ${exec_prefix}/sbin
libdir: ${exec_prefix}/lib
libexecdir: ${exec_prefix}/libexec+
mandir: ${prefix}/share/man
sysconfdir: /etc+
datadir: /Library/Webserver
installbuilddir: ${prefix}/share/httpd/build
errordir: ${prefix}/share/httpd/error
iconsdir: ${prefix}/share/httpd/icons
htdocsdir: ${datadir}/Documents
manualdir: ${datadir}/share/httpd/manual
cgidir: ${datadir}/CGI-Executables
includedir: ${prefix}/include+
localstatedir: /var
runtimedir: ${localstatedir}/run
logfiledir: ${localstatedir}/log+
proxycachedir: ${runtimedir}/proxy
This is the layout of the web server files on our typewriter. It clearly follows the layout of the native Apache, which is installed by the Leopard system.
Next, create a conf.args file right here:
./configure \
--enable-layout=Leopard \
--enable-mods-shared=all \
--with-mpm=prefork \
--disable-static \
--disable-unique-id \
--disable-ipv6 \
--enable-dav \
--enable-cache \
--enable-proxy \
--enable-shared \
--enable-logio \
--enable-deflate \
--with-included-apr \
--enable-cgi \
--enable-cgid \
--enable-suexec
This is a configuration command that will prepare the sorts for compilation to your system and determine the layout of the files (--enable-layout = Leopard). In addition, there are specified additional settings that I use locally personally. If you need something else or something is not necessary - subject to editing.
In the file we put it, so that when something needs to be added or changed, there will be a previous configuration option.
All that is left to do is to execute the configuration command - copy it entirely from the file, paste it into the console and click the enterter. It will take some time and the team will finish working out.
Next, perform:
make
We are waiting, and after:
sudo make install
In general, the server is updated. :) Later I will add how to add it to autoload.
And yet, I often mentioned that in the future it will be possible to remove or add components - this is done simply. We apply .configure with new parameters for the same options, then make and sudo make install. The advantage of the fact that you will do it again on the same result is that the configuration and make will occur much faster.