Richard
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:
./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
./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:
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



Comments
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 [...]
10:18 am
I am working on this, compiling mysql, postresql, apache and php from scratch for a server. With just a little work I was able to get mysql finished. With Apache, I ran into several problems. The first required that I specify –bindir, –libdir, etc., in the config command line or it refused to compile. In addition, the evaluation of the config.layout files for the apr and apr-util refused to accept the ${prefix} variables and required these to be specified as whole paths rather than assembled. Having jumped through all of those hoops I am at ‘sudo make install’. But I seem to have some errors.
/usr/bin/install -c -m 644 apr.exp /Library/Apache2/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /Library/Apache2/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \
if test -f ${f}; then /usr/bin/install -c -m 755 ${f} ; fi; \
done
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 … fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory …
/usr/bin/install -c -m 755 /Users/roxie/Downloads/20100507/httpd-2.2.15/srclib/apr/build/mkdir.sh
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 … fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory …
make[2]: *** [install] Error 64
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
I’m honestly not sure where to go from here. Anyone with any thoughts would be appreciated.
2:01 pm
@DavidM, not sure what you are trying to do with the bindir and libdir settings, these instructions only work if you follow the layout as described and not for any other configurations you might want to accomplish. Also note that this only works for Leopard, there is another setup described on this site for Snow Leopard
4:39 pm
@Richard, This is for a Leopard machine. I have not upgraded to Snow Leopard. I admit, I did change the Layout to put everything under /Library/Apache2, but that was the only change and should not (theoretically) have made this installation bomb like this. The only reason I was using libdir and bindir and other settings was because Make would not complete without them. Nevertheless, I will go back and use your default config.layout pieces and see if it will complete properly there where it will not in /Library/Apache2. More information to follow when I have it.
4:44 pm
Attempting your configuration with no changes, precisely as specified above, I get the following:
./config.pld: line 1: Ê: command not found
./config.pld: line 2: Ê: command not found
./config.pld: line 3: Ê: command not found
./config.pld: line 4: Ê: command not found
./config.pld: line 5: Ê: command not found
./config.pld: line 6: Ê: command not found
./config.pld: line 7: Ê: command not found
./config.pld: line 8: Ê: command not found
./config.pld: line 9: Ê: command not found
./config.pld: line 10: Ê: command not found
./config.pld: line 11: Ê: command not found
./config.pld: line 12: Ê: command not found
./config.pld: line 13: Ê: command not found
./config.pld: line 14: Ê: command not found
./config.pld: line 15: Ê: command not found
./config.pld: line 16: Ê: command not found
./config.pld: line 17: Ê: command not found
./config.pld: line 18: Ê: command not found
./config.pld: line 19: Ê: command not found
./config.pld: line 20: Ê: command not found
checking for chosen layout… DIYMacServer
checking for working mkdir -p… yes
checking build system type… i386-apple-darwin9.8.0
checking host system type… i386-apple-darwin9.8.0
checking target system type… i386-apple-darwin9.8.0
Configuring Apache Portable Runtime library …
configuring package in srclib/apr now
configure: error: expected an absolute directory name for –bindir: NONE/bin
configure failed for srclib/apr
This would be the point at which I then started specifying directories in the configuration statement, to get things to build.
6:25 pm
@DavidM, something is wrong with your setup. Configure should not have these errors. I’m assuming you did install XCode. Try to download apache again and start from scratch with a new source… Could be a type or strange characters in any config.layout.
8:10 pm
It appears to have been strange characters in the config.layout copied from the site. Using ‘Zap Gremlins’ in BBEdit to clean it up and then pasting that into the files in place of what I’d put in before cleared up the mistakes.
6:38 am
[...] Compiling Apache in 64-bits Mode on Leopard [...]
7:36 pm
I’ve been trying to configure & compile httpd but appearantly there’s one problem:
CFLAGS (and/or CXXFLAGS) don’t get passed to ./configure
I tried it with both bash and tcsh, still no change,
CFLAGS=”-arch ppc64″ is not to be found in configure script, I see that under config.status or after I make && make installed, in the resulting binary (file /usr/local/apache2/bin/httpd)
What’s wrong I wonder.
6:03 am
Can you mail me with the full copy of your Terminal session and config.log to info at this domain?
first guess is that something went wring while copy and pasting the command from the browser to the Terminal.
8:39 am
Ooops! You’re correct about entering the correct command into the Terminal. Only now do I realize I was entering it the wrong way: I was entering the CFLAGS=”-arch x86_64″ and the remaining ./configure -enable-layout ….. -enable-suexec section separately, because I thought CFLAGS variable was already saved and then it can be used within the ./configure but somehow it wasn’t.
For configure to use the CFLAGS variable, it must have been ***absolutely*** entered at the same command line, not seperately. I really didn’t know that.
Now everything works fine in 64bits. That’s very fine and it made my sending the log eMail kind of unnecessary.
That’s been very helpful, thanks!