Sun Java System Application Server Enterprise Edition 8.1 Administration Guide 2005Q1 |
Appendix A
Compiling and Configuring Apache Web ServerThis 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 Sun Java System Application Server, see the Sun Java System Application Server Release Notes.
This appendix contains the following topics:
Minimum RequirementsThis section describes the minimum requirements to successfully compile Apache web server to run the load balancer plug-in. The Apache source must be compiled and built to run with SSL.
This section contains the following topics:
Minimum Requirements for Apache 1.3
For requirements on Microsoft Windows platforms, see:
http://httpd.apache.org/docs/windows.html#req
http://httpd.apache.org/docs/win_compiling.htmlRequirements for other platforms:
In addition, before compiling Apache:
- On Linux, install Sun Java System Application Server on the same machine.
- On Solaris 8, ensure that
gcc
andmake
are in thePATH
.- On Solaris 9, ensure that
gcc
version 3.3 andmake
are in thePATH
, andflex
is installed.- If you are using
gcc
on Red Hat Enterprise Linux Advanced Server 2.1, the version must be later thangcc
3.0.
Minimum Requirements for Apache 2
For requirements on Microsoft Windows platforms, see:
http://httpd.apache.org/docs-2.0/platform/windows.html
Requirements for other platforms:
In addition, before compiling Apache:
- On Linux, install Sun Java System Application Server on the same machine.
- On Solaris 8, ensure that
gcc
andmake
are in thePATH
.- On Solaris 9, ensure that
gcc
version 3.3 andmake
are in thePATH
, andflex
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:
app_server_install_dir
export LD_LIBRARY_PATH=/lib:$LD_LIBRARY_PATH
This example is forsh
.- These software sources are available at http://www.sunfreeware.com
Installing SSL-aware ApacheFor instructions on compiling and installing Apache on Microsoft Windows platforms, see the following web sites:
Apache 1.3:
http://httpd.apache.org/docs/win_compiling.html
Apache 2:
http://httpd.apache.org/docs-2.0/platform/win_compiling.html
Follow these steps to compile, configure, and install SSL-aware Apache web server on other platforms. Although the examples show compiling and building Apache 1.3.29, the same procedures apply for Apache 2.
Compiling and Building OpenSSL
This step is not required on Linux if the version of OpenSSL installed with Linux is 0.9.7d.
For more information on OpenSSL, see:
Unpack the
openssl-0.9.7
d
source and follow these steps.For more information on building OpenSSL from the source, see the
INSTALL
file in theopenssl
directory.Configuring Apache with mod_ssl
This section only applies to Apache 1.3. For Apache 2.0 installations, skip to "Compiling and Building Apache".
For more information on mod_ssl, see:
- Download the
apache_1.3.29
source distribution.Unpack the source distribution. The source distribution comes as a compressed archive. For
apache_1.3.29
, the source distribution archive readsapache_1.3.29.tar.gz
.- Decompress and untar the archive using the following command:
tar -zxvf apache_1.3.29.tar.gz
This command creates a directory called
apache_1.3.29
in the current working directory.- Unpack the
mod_ssl-2.8.14-1.3.29
source.
cd mod_ssl-2.8.14-1.3.29
- Run
./configure --with-apache=../apache_1.3.29 --with-ssl=../openssl-0.9.7d --prefix=
install path--enable-module=ssl --enable-shared=ssl --enable-rule=SHARED_CORE --enable-module=so
The directory specified in the above command examples is a variable. The prefix argument indicates where to install Apache. This command outputs several lines on the screen.
This command creates the
make
files for the build according to your system configuration. Errors inconfigure
can cause some header files or utility programs to be missing. Install them before proceeding.Compiling and Building Apache
The instructions for compiling and building Apache vary depending upon the version of Apache.
Compiling and Building Apache 1.3
This procedure installs Apache in the location provided in the
--prefix
attribute described in "Configuring Apache with mod_ssl".
- On Linux, include the following lines in
src/MakeFile
afterEnd of automatically generated section
:
LIBS+= -licuuc -licui18n -lnspr4 -lpthread -lxerces-c -lsupport -lnsprwrap -lns-httpd40
LDFLAGS+= -L/
appserver_installdir/lib
- On Linux, put the Application Server installation directory in the LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=/app_server_install_dir/lib:$LD_LIBRARY_PATH
- Compile Apache using the
make
command, as follows:
- cd to the
mod_ssl
directory.make
make certificate
make install
Note
The command
make certificate
asks for a secure password. Remember this password as it’s required for starting secure Apache.
The command
make install
outputs several lines on the screen indicating that the process is compiling Apache source code and linking Apache. This process normally concludes without errors. However, if any errors occur, check that all the library files and utility programs of Apache have been properly downloaded.Configure the installation of Apache by entering the appropriate values for your environment in the apache_install_path
/conf/httpd.conf
file.Compiling and Building Apache 2
- Download the Apache 2_0_NN source distribution.
NN denotes a minor version, for example, 52.
- Unpack the source distribution.
The source distribution comes as a compressed archive. For Apache 2_0_NN, the source distribution archive is
httpd-2_0_
NN.tar.gz
.- Decompress and untar the archive using the following command:
tar -zxvf httpd-2_0_
NN.tar.gz
This command creates a directory called
httpd-2_0_
NN in the current working directory.cd httpd-2_0_
NN.- Run
./configure --with-ssl=
open_ssl_install_path--prefix=
install_path--enable-ssl --enable-so
- On Linux, modify apache_src
/build/config_vars.mk
and add the following lines:
EXTRA_LIBS += -licuuc -licui18n -lnspr4 -lpthread -lxerces-c -lsupport -lnsprwrap -lns-httpd40
LDFLAGS+=-L<appserver install dir>/lib
- On Linux, put the Application Server installation directory in the LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=/app_server_install_dir/lib:$LD_LIBRARY_PATH
- Compile Apache using the make command, as follows:
From the
httpd-2_0_
NN directory:
make
make install
The command
make install
outputs several lines on the screen indicating that the process is compiling Apache source code and linking Apache. This process normally concludes without errors. However, if any errors occur, check that all the library files and utility programs of Apache have been properly downloaded.Configure the installation of Apache by entering the appropriate values for your environment in the apache_install_path
/conf/httpd.conf
file.
Starting and Stopping Apache
Apache comes bundled with a script titled
apachectl
that facilitates starting, stopping and restarting Apache.After starting Apache, test the installation. Once Apache is running, type the following address in a web browser: http://server_name:port_number/. If the installation was successful and Apache is running, a test page is displayed.
Once you have completed the Apache installation, see "Modifications to Apache Web Server" for information on Apache configuration during and after plug-in installation.