Sun logo      Previous      Contents      Next     

Sun Java System Application Server Enterprise Edition 8.1 Administration Guide 2005Q1

Appendix A  
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 Sun Java System Application Server, see the Sun Java System Application Server Release Notes.

This appendix contains the following topics:


Minimum Requirements

This 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.html

Requirements for other platforms:

In addition, before compiling Apache:

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:


Installing SSL-aware Apache

For 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.


Note

Untar mod_ssl, OpenSSL, and Apache at the same directory level.


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:

http://www.openssl.org/

Unpack the openssl-0.9.7d source and follow these steps.

  1. cd openssl-0.9.7d
  2. ./config
  3. make
  4. make test
  5. make install

For more information on building OpenSSL from the source, see the INSTALL file in the openssl 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:

http://www.modssl.org/

  1. Download the apache_1.3.29 source distribution.
  2. Unpack the source distribution. The source distribution comes as a compressed archive. For apache_1.3.29, the source distribution archive reads apache_1.3.29.tar.gz.

  3. Decompress and untar the archive using the following command:
  4. tar -zxvf apache_1.3.29.tar.gz

    This command creates a directory called apache_1.3.29 in the current working directory.

  5. Unpack the mod_ssl-2.8.14-1.3.29 source.
  6. cd mod_ssl-2.8.14-1.3.29
  7. 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 in configure 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".

  1. On Linux, include the following lines in src/MakeFile after End of automatically generated section:
  2. LIBS+= -licuuc -licui18n -lnspr4 -lpthread -lxerces-c -lsupport -lnsprwrap -lns-httpd40

    LDFLAGS+= -L/appserver_installdir/lib

  3. On Linux, put the Application Server installation directory in the LD_LIBRARY_PATH:
  4. export LD_LIBRARY_PATH=/app_server_install_dir/lib:$LD_LIBRARY_PATH
  5. Compile Apache using the make command, as follows:
    1. cd to the mod_ssl directory.
    2. make
    3. make certificate
    4. make install

    5. 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

  1. Download the Apache 2_0_NN source distribution.
  2. NN denotes a minor version, for example, 52.

  3. Unpack the source distribution.
  4. The source distribution comes as a compressed archive. For Apache 2_0_NN, the source distribution archive is httpd-2_0_NN.tar.gz.

  5. Decompress and untar the archive using the following command:
  6. tar -zxvf httpd-2_0_NN.tar.gz

    This command creates a directory called httpd-2_0_NN in the current working directory.

  7. cd httpd-2_0_NN.
  8. Run ./configure --with-ssl=open_ssl_install_path --prefix=install_path --enable-ssl --enable-so
  9. On Linux, modify apache_src/build/config_vars.mk and add the following lines:
  10. EXTRA_LIBS += -licuuc -licui18n -lnspr4 -lpthread -lxerces-c -lsupport -lnsprwrap -lns-httpd40

    LDFLAGS+=-L<appserver install dir>/lib

  11. On Linux, put the Application Server installation directory in the LD_LIBRARY_PATH:
  12. export LD_LIBRARY_PATH=/app_server_install_dir/lib:$LD_LIBRARY_PATH
  13. Compile Apache using the make command, as follows:
  14. From the httpd-2_0_NN directory:

    1. make
    2. make install
    3. 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.


      Note

      If you encounter errors, try putting the Application Server installation directory in the PATH:

      export LD_LIBRARY_PATH=/app_server_install_dir/lib

      or adding the OpenSSL library, for example:

      export LD_LIBRARY_PATH=/openssl_install_dir/lib:/app_server_install_dir/lib



      Note

      On Apache 2, you must create and install the certificate manually. For more information, see the Apache documentation.


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.



Previous      Contents      Next     


Copyright 2004 - 2005 Sun Microsystems, Inc. All rights reserved.