Chapter 18 Compiling and Configuring Apache Web Server
This appendix describes how to compile the Apache source code and configure
an installation of Apache Web Server to use the Sun Java System Application Server load
balancer plug-in.
Download the appropriate Apache source code. For information about the versions
and platforms of Apache Web Server supported for the Application Server, see theApplication Server Release
Notes.
This appendix contains the following topics:
Installing Apache
This section contains the following topics:
Minimum Requirements for Apache 1.3
This section describes the minimum requirements to successfully compile Apache
1.3 web server to run the load balancer plug-in. The Apache source must be compiled
and built to run with SSL.
Requirements for UNIX and Linux platforms:
-
openssl-0.9.7d (source)
-
mod_ssl-2.8.16-1.3.29 (source)
-
apache_1.3.29 (sources)
-
gcc-3.3-sol9-sparc-local packages (for Solaris
9 SPARC/x86).
-
flex-2.5.4a-sol9-sparc-local packages (for Solaris
9 SPARC)
-
flex-2.5.4a-sol9-intel-local packages (for Solaris
9 x86)
In addition, before compiling Apache:
-
On Linux, install the Sun Java System Application Server on the same machine.
-
On Solaris 8, ensure that gcc and make are in the PATH.
-
On Solaris 9, ensure that gcc version 3.3 and make are in the PATH, and flex is
installed.
-
If you are using gcc on Red Hat Enterprise Linux
Advanced Server 2.1, the version must be later than gcc 3.0.
Note –
-
To use another C compiler, set the path of the C compiler and make
utility in the PATH environment variable. For example:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:install-dir/lib
-
These software sources are available at http://www.sunfreeware.com.
Minimum Requirements for Apache 2
This section describes the minimum requirements to successfully compile Apache
2 web server to run the load balancer plug-in. The Apache source must be compiled
and built to run with SSL.
Requirements for UNIX and Linux platforms:
-
openssl-0.9.7e (source)
-
httpd-2.0.49 (source)
-
gcc-3.3-sol9-sparc-local packages (for Solaris
SPARC).
-
gcc-3.3-sol9-intel-local packages (for Solaris
x86)
-
flex-2.5.4a-sol9-sparc-local packages (for Solaris
SPARC)
-
flex-2.5.4a-sol9-intel-local packages (for Solaris
x86)
In addition, before compiling Apache:
-
On the Linux platform, install the Sun Java System Application Server on
the same machine.
-
On the Solaris operating system, ensure that gcc version
3.3 and make are in the PATH, and flex is installed.
-
On the Solaris 10 operating system, before running make for
OpenSSL, run /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/install-tools/mkheaders (Solaris SPARC) or /usr/local/lib/gcc-lib/i386-pc-solaris2.9/3.3/install-tools/mkheaders (Solaris x86).
-
If you are using gcc on Red Hat Enterprise Linux
Advanced Server 2.1, the version must be later than gcc 3.0.
Note –
-
To use another C compiler, set the path of the C compiler and make
utility in the PATH environment variable. For example:export LD_LIBRARY_PATH=install-dir/lib:$LD_LIBRARY_PATH. This example is for sh.
-
These software sources are available at http://www.sunfreeware.com.
To install SSL-aware Apache
Before You Begin
You must have already downloaded and uncompressed the Apache software.
-
Compile and build OpenSSL. For more information about OpenSSL, see http://www.openssl.org/.
This step is not required
on the Linux platform if the version of OpenSSL installed with Linux is 0.9.7.e.
Download and unpack the OpenSSL source.
-
cd openssl-0.9.7e
-
make
-
make install
-
For Apache 1.3, configure Apache with mod_ssl. You
do not need to complete this step for Apache 2. For more information about mod_ssl, see http://www.modssl.org/.
Unpack the mod_ssl source and follow these steps.
-
cd mod_ssl-2.8.14-1.3.x
-
Run ./configure --with-apache=../apache_1.3.x --with-ssl=../openssl-0.9.7e --prefix=install-dir--enable-module=ssl --enable-shared=ssl --enable-rule=SHARED_CORE --enable-module=so
The directory specified in the above command example is a variable.
The prefix argument indicates where to install Apache.
The x in the version number represents your actual version.
-
For Apache 2.0, configure the source tree:
-
cd to the http-2.0_x directory.
-
Run ./configure --with-ssl=open-ssl-install-path --prefix=install-dir --enable-ssl --enable-so
The directory specified in the above command example is a variable.
The prefix argument indicates where to install Apache.
The x in the version number represents your actual version.
-
For Apache on Linux 2.1, before compiling:
-
Open src/MakeFile and find the end of the automatically
generated section.
-
Add the following lines after the first four lines after the automatically
generated section:
LIBS+= -licuuc -licui18n -lnspr4 -lpthread
-lxerces-c -lsupport -lnsprwrap -lns-httpd40
LDFLAGS+=
-L/install-dir/lib -L/opt/sun/private/lib
Note –
The -L/opt/sun/private/lib part is only required if
you installed Application Server as part of a Java Enterprise System installation.
For example:
## (End of automatically generated section)##
CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)LIBS=$(EXTRA_LIBS)
$(LIBS1)INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)"
LIBS+= -licuuc -licui18n -lnspr4 -lpthread -lxerces-c
-lsupport -lnsprwrap -lns-httpd40LDFLAGS+= -L/install-dir/lib
-L/opt/sun/private/lib
-
Create an environment variable LD_LIBRARY_PATH equal to: install-dir/lib (for all installations) and install-dir/lib:opt/sun/private/lib (for Application Server installed as part of a Java Enterprise System installation).
-
Compile Apache as described in the installation instructions for the version
you are using. Full documentation is at http://httpd.apache.org/.
In general the steps are:
-
make
-
make certificate (Apache 1.3 only)
-
make install
The command make
certificate asks for a secure password. Remember this password as it is
required for starting secure Apache.
-
Configure Apache for your environment.
Once you have completed
the Apache installation, see “Modifications to Apache Web Server” after
plug-in installation.