I’ve documented two ways of installing Apache. One where the default Apache Leopard install is overwritten with your own version. A second one, the DIYMacServer install, where the default install is left alone completely (it uses the same directory for the webpages, but a different location for the configuration). The difference in the configuration is made in the ‘config.layout’ file which determines where all the packages should be installed. For the DIYMacServer method copy the layout below and add it to the ‘config.layout’ file in these locations:

  • ./config.layout
  • ./srclib/apr/config.layout
  • ./srclib/apr-util/config.layout

The Darwin install will keep the functionality of the preference pane intact and you don’t need to add that (it is already included). The DIYMacServer install is used in all the other documentation in this site. You choose !

DIYMacserver installation configuration
<Layout DIYMacServer>
  prefix: /usr/local/apache2
  exec_prefix: ${prefix}
  bindir: ${exec_prefix}/bin
  sbindir: ${exec_prefix}/bin
  libdir: ${exec_prefix}/lib
  libexecdir: ${exec_prefix}/modules
  mandir: ${prefix}/man
  sysconfdir: /etc/httpd
  datadir: /Library/Webserver
  installbuilddir: ${datadir}/build
  errordir: ${datadir}/error
  iconsdir: ${datadir}/icons
  htdocsdir: ${datadir}/Documents
  manualdir: ${datadir}/manual
  cgidir: ${datadir}/CGI-Executables
  includedir: ${prefix}/include
  localstatedir: /var
  runtimedir: ${localstatedir}/run
  logfiledir: ${localstatedir}/log/httpd
  proxycachedir: ${runtimedir}/proxy
</Layout>

Leopard installation configuration
<Layout Darwin>
  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
</Layout>

If you’ve edited the ‘config.layout’ file to add DIYMacServer (the Darwin layout is already in the file) you are ready to run the configuration script. Change the ‘–enable-layout’ to reflect your choice in configuration. So fill in either DIYMacServer or Darwin to choose, the example uses DIYMacServer as the layout.

For Intel use:
CFLAGS="-arch x86_64" \
./configure -enable-layout=DIYMacServer \
 -enable-mods-shared=all \
 -with-ssl=/usr \
 -with-mpm=prefork \
 -disable-unique-id \
 -enable-ssl \
 -enable-dav \
 -enable-cache \
 -enable-proxy \
 -enable-logio \
 -enable-deflate \
 -with-included-apr \
 -enable-cgi \
 -enable-cgid \
 -enable-suexec

For PowerPC use
CFLAGS="-arch ppc64" \
./configure -enable-layout=DIYMacServer \
 -enable-mods-shared=all \
 -with-ssl=/usr \
 -with-mpm=prefork \
 -disable-unique-id \
 -enable-ssl \
 -enable-dav \
 -enable-cache \
 -enable-proxy \
 -enable-logio \
 -enable-deflate \
 -with-included-apr \
 -enable-cgi \
 -enable-cgid \
 -enable-suexec

Followed for both with:

make

and if it all goes well:

sudo make install

If you run into errors or some strange thig happens which you can’t explain, please post you questions and the error into the forum on this site:

Next step: Configuring Apache on Leopard