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
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
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:
For PowerPC use
Follow for both with:
-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
You can now run:
and if it all goes well:
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



11:38 pm
I am getting the following error when I make, and I have no idea how to fix this.
ranlib: archive member: .libs/libmain.a(exports.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib: archive member: .libs/libmain.a(exports.o) cputype (7) does not match previous archive members cputype (16777223) (all members must match)
ranlib: for architecture: x86_64 file: .libs/libmain.a(util_ebcdic.o) has no symbols
ranlib: for architecture: x86_64 file: .libs/libmain.a(util_charset.o) has no symbols
make[2]: *** [libmain.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
7:05 am
@Mark, are you sure your Mac support 64 bits? It should say so in the output of “httpd -V”
6:49 am
i am going with the darwin option, where would I paste “CFLAGS=
7:08 am
I’m sorry you don’t if you want to use the Darwin layout you need to change:
./configure
8:03 am
ok so with it changed to “Darwin” where within the document would I paste the “CFLAGS” portion?
thanks
8:09 am
There are no CFLAGS in the config.layout file. You need to enter those commands in a Terminal session while in the source directory.
12:29 am
In your config code block above you are using the coded character 8211 rather than just the minus sign for the config flags. (Perhaps this is from pasting from some word processor?)
This makes it rather difficult to cut and paste. Was this intentional?
8:43 am
@Dan, Sorry about this. It’s Wordpress which occasionally has some strange behaviour. I’ve corrected it.
6:09 pm
Hi Richard,
I switched to source of httpd, changed the layout file and when I tried to give the command I got following error.
macs-mac-mini:~ mac$ cd /Users/mac/Desktop/httpd-2.2.12
macs-mac-mini:httpd-2.2.12 mac$ 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
-bash: x86_64″: command not found
macs-mac-mini:httpd-2.2.12 mac$
Does this make any sense ?
6:12 pm
Yes, this was a left over error of the problems that we had with Wordpress. Quotes and dashes where not represented as they needed to be. There were different quotes and dashes in the code. It is corrected now and you can try it again! Sorry about this…
6:28 pm
Hi Richard,
Probably something stupid. But I amended the config_layout file with DIYMacServer but I got following errors.
checking for chosen layout… DIYMacServer
checking for working mkdir -p… yes
checking build system type… i386-apple-darwin9.7.0
checking host system type… i386-apple-darwin9.7.0
checking target system type… i386-apple-darwin9.7.0
Configuring Apache Portable Runtime library …
configuring package in srclib/apr now
checking build system type… i386-apple-darwin9.7.0
checking host system type… i386-apple-darwin9.7.0
checking target system type… i386-apple-darwin9.7.0
Configuring APR library
Platform: i386-apple-darwin9.7.0
checking for working mkdir -p… yes
APR Version: 1.3.7
** Error: unable to find layout DIYMacServer
configure failed for srclib/apr
Thanks for any help
Luc
9:27 pm
Hey Luc,
I ran into the same error. It appears that there are three config.layout files (1 in srclib/apr, and 1 in srclib/apr-utl) and I bet they all need to be appended with the DIYMacServer layout information. I’ll try it tonight. Hope this helps.
David
9:31 pm
Hey Luc,
Yes, that fixed it. When I added the DIYMacServer layout info to the 2 additional config.layout files, the configuration worked.
Cheers,
David
9:43 pm
Hi David, thanks for the update. I found the same answer with Luc offsite. I asked for a proper solution on the apache user mailinglist, but no answer. There is even an old bug which is still open which addresses this issue: https://issues.apache.org/bugzilla/show_bug.cgi?id=23167
5:23 pm
Hi Richard,
As proposed I started back from scratch. So far everything OK. I just was wondering before compiling in 64bit of the DIYMACSERVER layout.
Is it correct that this has prefix usr/local/apache2 and the other /usr ? Just for confirmation as you mentionned that the DIY version is the one that doesn’t overwrite the original version.
Luc
6:47 pm
Yes, but also the sysconfigdir and the logfile location are different.
8:55 pm
Hi Richard,
When I compared the 3 files in the original source directory they contain different fields. Shouldn’t the 3 files also be different ?
This is maybe the source of problem as i copied the first changed config.layout to the other locations also. I also verified the creation time of those files and 2 are matching and the third is different
Luc
1:19 pm
For all us old-timers with PowerPC Macs (G3, G4 & G5) Richard suggests using:
CFLAGS=”-arch ppc64″ \
instead of
CFLAGS=”-arch x86_64″ \
10:48 pm
I have compiling errors as below:
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make: *** [all-recursive] Error 1
That I could solve changing option:
-enable-mods-shared=all
to
-enable-mods-shared=most
Maybe it’s an useful hint to somebody.
2:24 am
[...] went ahead and compiled Apache from scratch. It’s easy enough and you’ll need the 64bit support for PHP. MySQL was much easier [...]