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 both methods copy the layout below and add it to the ‘config.layout’ file.
The Leopard install will keep the functionality of the preference pane intact. 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 you are ready to run the configuration script. Change the ‘–enable-layout’ to reflect your choice in configuration. So fill in either DIYMacServer or Leopard to choose, the example uses DIYMacServer as the layout.
--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



2:59 am
You say “You can now run: make”
How does one do that? Sorry…new to Mac. Thanks.
7:30 am
Open a terminal and type: “make” and press enter.
4:22 pm
Oh…thanks.
2:12 pm
Hi,
everything compiles without any problem. Troubles comes when link stage starts:
/Users/alvise/src/httpd-2.0.63/srclib/apr/libtool –silent –mode=link gcc -g -O2 -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -DAP_HAVE_DESIGNATED_INITIALIZER -I/Users/alvise/src/httpd-2.0.63/srclib/apr/include -I/Users/alvise/src/httpd-2.0.63/srclib/apr-util/include -I. -I/Users/alvise/src/httpd-2.0.63/os/unix -I/Users/alvise/src/httpd-2.0.63/server/mpm/prefork -I/Users/alvise/src/httpd-2.0.63/modules/http -I/Users/alvise/src/httpd-2.0.63/modules/filters -I/Users/alvise/src/httpd-2.0.63/modules/proxy -I/Users/alvise/src/httpd-2.0.63/include -I/Users/alvise/src/httpd-2.0.63/modules/generators -I/Users/alvise/src/httpd-2.0.63/modules/dav/main -export-dynamic -o httpd modules.lo modules/aaa/mod_access.la modules/aaa/mod_auth.la modules/filters/mod_include.la modules/loggers/mod_log_config.la modules/metadata/mod_env.la modules/metadata/mod_setenvif.la modules/http/mod_http.la modules/http/mod_mime.la modules/generators/mod_status.la modules/generators/mod_autoindex.la modules/generators/mod_asis.la modules/generators/mod_cgi.la modules/mappers/mod_negotiation.la modules/mappers/mod_dir.la modules/mappers/mod_imap.la modules/mappers/mod_actions.la modules/mappers/mod_userdir.la modules/mappers/mod_alias.la modules/mappers/mod_so.la server/mpm/prefork/libprefork.la server/libmain.la os/unix/libos.la /Users/alvise/src/httpd-2.0.63/srclib/pcre/libpcre.la /Users/alvise/src/httpd-2.0.63/srclib/apr-util/libaprutil-0.la -lexpat -liconv /Users/alvise/src/httpd-2.0.63/srclib/apr/libapr-0.la -lresolv -lpthread
Undefined symbols:
“_apr_sendfile”, referenced from:
_core_output_filter in libmain.a(core.o)
_ap_hack_apr_sendfile in libmain.a(exports.o)
“_apr_socket_sendfile”, referenced from:
_ap_hack_apr_socket_sendfile in libmain.a(exports.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [httpd] Error 1
make: *** [all-recursive] Error 1
I’ve installed apr and aprutils in my machine:
alvise@imac-di-alvise-dorigo 15:09:04 ~/src/httpd-2.0.63>ls /opt/local/lib/libapr*
/opt/local/lib/libapr-0.0.9.17.dylib /opt/local/lib/libapr-1.la /opt/local/lib/libaprutil-0.dylib
/opt/local/lib/libapr-0.0.dylib /opt/local/lib/libapriconv-1.0.2.1.dylib /opt/local/lib/libaprutil-0.la
/opt/local/lib/libapr-0.a /opt/local/lib/libapriconv-1.0.dylib /opt/local/lib/libaprutil-1.0.3.2.dylib
/opt/local/lib/libapr-0.dylib /opt/local/lib/libapriconv-1.a /opt/local/lib/libaprutil-1.0.dylib
/opt/local/lib/libapr-0.la /opt/local/lib/libapriconv-1.dylib /opt/local/lib/libaprutil-1.a
/opt/local/lib/libapr-1.0.3.2.dylib /opt/local/lib/libapriconv-1.la /opt/local/lib/libaprutil-1.dylib
/opt/local/lib/libapr-1.0.dylib /opt/local/lib/libaprutil-0.0.9.17.dylib /opt/local/lib/libaprutil-1.la
/opt/local/lib/libapr-1.a /opt/local/lib/libaprutil-0.0.dylib
/opt/local/lib/libapr-1.dylib /opt/local/lib/libaprutil-0.a
Any Idea ? thank you
Alvise
3:30 am
OK, so compiling failed (just as it did trying to compile mySQL) because, I think, of this line in the output:
no acceptable C compiler found in $PATH
How/where do I get a C compiler? This is a brand new mini running 10.5.4. Thanks.
1:32 pm
Craig, please install the X-Code tools from the Leopard install disc. That will install everything that is required.
6:58 pm
I can compile it and install it no problem.
The trouble is with trying to control it.
if I do whereis apachectl, it’s in /usr/sbin/ , not /usr/local/apache2/bin/
So…Apache runs, but not the installation we’re doing here.
I then have the same problem with PHP 5, it runs, but not the version I compiled/installed.
Help!
7:57 pm
John, if you compiled and installed it succesfully you should also have an apachectl in /usr/local/apache2/bin/ . The one you are using in /usr/bin/ is the original apache installation