From 57337b1f413933a9da83307e0cec11cfc49db3ca Mon Sep 17 00:00:00 2001 From: Joshua Slive Date: Thu, 10 May 2001 05:40:04 +0000 Subject: [PATCH] Replace install.html with an html-ized version of httpd-2.0/INSTALL. Discussion following on apache-docs. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89067 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/install.html | 618 +++++++++++++++++++++++++----------- docs/manual/install.html.en | 618 +++++++++++++++++++++++++----------- 2 files changed, 878 insertions(+), 358 deletions(-) diff --git a/docs/manual/install.html b/docs/manual/install.html index 3b997645dd..9b1b920da9 100644 --- a/docs/manual/install.html +++ b/docs/manual/install.html @@ -14,185 +14,445 @@ > -
Warning: -This document has not been updated to take into account changes -made in the 2.0 version of the Apache HTTP Server. Some of the -information may still be relevant, but please use it -with care. -
- -

Compiling and Installing Apache 1.3

- -This document covers compilation and installation of Apache on Unix -systems only. For compiling and installation on Windows, see Using Apache with Microsoft Windows and for -TPF see Installing the Apache 1.3 HTTP -Server on TPF. - -

- -UnixWare users will want to consult build notes -for various UnixWare versions before compiling. - -

Downloading Apache

- -Information on the latest version of Apache can be found on the Apache -web server at http://www.apache.org/. This will -list the current release, any more recent beta-test release, together -with details of mirror web and anonymous ftp sites. - -

- -If you downloaded a binary distribution, skip to Installing Apache. Otherwise read the next section -for how to compile the server. - -

Compiling Apache

- -Compiling Apache consists of three steps: Firstly select which Apache -modules you want to include into the server. Secondly create a -configuration for your operating system. Thirdly compile the -executable. -

- -All configuration of Apache is performed in the src -directory of the Apache distribution. Change into this directory. - -

    -
  1. - Select modules to compile into Apache in the - Configuration file. Uncomment lines corresponding to - those optional modules you wish to include (among the AddModule lines - at the bottom of the file), or add new lines corresponding to - additional modules you have downloaded or written. (See API.html for preliminary docs on how to - write Apache modules). Advanced users can comment out some of the - default modules if they are sure they will not need them (be careful - though, since many of the default modules are vital for the correct - operation and security of the server). -

    - - You should also read the instructions in the Configuration - file to see if you need to set any of the Rule lines. - - -

  2. - Configure Apache for your operating system. Normally you can just - run the Configure script as given below. However - if this fails or you have any special requirements (e.g., to include - an additional library required by an optional module) you might need - to edit one or more of the following options in the - Configuration file: - EXTRA_CFLAGS, LIBS, LDFLAGS, INCLUDES. -

    - - Run the Configure script: -

    -
    -    % Configure
    -    Using 'Configuration' as config file
    -     + configured for <whatever> platform
    -     + setting C compiler to <whatever> *
    -     + setting C compiler optimization-level to <whatever> *
    -     + Adding selected modules
    -     + doing sanity check on compiler and options
    -    Creating Makefile in support
    -    Creating Makefile in main
    -    Creating Makefile in os/unix
    -    Creating Makefile in modules/standard
    -   
    -
    - - (*: Depending on Configuration and your system, Configure - might not print these lines. That's OK).

    - - This generates a Makefile for use in stage 3. It also creates a - Makefile in the support directory, for compilation of the optional - support programs. -

    - - (If you want to maintain multiple configurations, you can give an - option to Configure to tell it to read an alternative - Configuration file, such as Configure -file - Configuration.ai). -

    - -

  3. - Type make. -
- -The modules we place in the Apache distribution are the ones we have -tested and are used regularly by various members of the Apache -development group. Additional modules contributed by members or third -parties with specific needs or functions are available at -<http://www.apache.org/dist/httpd/contrib/modules/>. -There are instructions on that page for linking these modules into the -core Apache code. - -

Installing Apache

- -You will have a binary file called httpd in the -src directory. A binary distribution of Apache will -supply this file.

- -The next step is to install the program and configure it. Apache is -designed to be configured and run from the same set of directories -where it is compiled. If you want to run it from somewhere else, make -a directory and copy the conf, logs and -icons directories into it. In either case you should -read the security tips -describing how to set the permissions on the server root directory.

- -The next step is to edit the configuration files for the server. This -consists of setting up various directives in up to three -central configuration files. By default, these files are located in -the conf directory and are called srm.conf, -access.conf and httpd.conf. To help you get -started there are same files in the conf directory of the -distribution, called srm.conf-dist, -access.conf-dist and httpd.conf-dist. Copy -or rename these files to the names without the -dist. -Then edit each of the files. Read the comments in each file carefully. -Failure to setup these files correctly could lead to your server not -working or being insecure. You should also have an additional file in -the conf directory called mime.types. This -file usually does not need editing. - -

- -First edit httpd.conf. This sets up general attributes -about the server: the port number, the user it runs as, etc. Next -edit the srm.conf file; this sets up the root of the -document tree, special functions like server-parsed HTML or internal -imagemap parsing, etc. Finally, edit the access.conf -file to at least set the base cases of access. - -

- -In addition to these three files, the server behavior can be configured -on a directory-by-directory basis by using .htaccess -files in directories accessed by the server. - -

Set your system time properly!

- -Proper operation of a public web server requires accurate time -keeping, since elements of the HTTP protocol are expressed as the time -of day. So, it's time to investigate setting up NTP or some other -time synchronization system on your Unix box, or whatever the -equivalent on NT would be. - -

Compiling Support Programs

- -In addition to the main httpd server which is compiled -and configured as above, Apache includes a number of support programs. -These are not compiled by default. The support programs are in the -support directory of the distribution. To compile -the support programs, change into this directory and type -
-    make
-
+

Compiling and Installing

+ + +

This document covers compilation and installation of Apache on Unix +and Unix-like systems only. For compiling and installation on Windows, +see Using Apache with Microsoft +Windows. For other platforms, see the platform documentation.

+ +

Apache 2.0's configuration and installation environment has changed +completely from Apache 1.3. Apache 1.3 used a custom set of scripts +to achieve easy installation. Apache 2.0 now uses libtool and +autoconf to create an environment that looks like many other Open +Source projects.

+ +

Overview for the impatient

+ +
+ $ ./configure --prefix=PREFIX
+ $ make
+ $ make install
+ $ PREFIX/bin/apachectl start +
+ +

Notes: +

+ +

Requirements

+ +

The following requirements exist for building Apache:

+ + + + +

If you are building from a copy of the CVS repository, rather than +a release distribution, then you will need these additional tools:

+ + + +

Configuring the source tree

+ +

Setup

+ +

If you have downloading the Apache 2.0 from the CVS, rather than a +release distribution, then you will need to prepare the source tree +for configuration and compilation. This is done by running:

+ +
+ ./buildconf +
+ +

This script ensures that all required programs are installed on the +currently machine, and creates the ./configure script. If you are +using a package downloaded from apache.org then this step is not +necessary.

+ +

Introduction

+ +

The next step is to configure the Apache source tree for your +particular platform and personal requirements. The most important +setup here is the location prefix where Apache is to be installed +later, because Apache has to be configured for this location to work +correctly. But there are a lot of other options available for your +pleasure.

+ +

For a short impression of what possibilities you have, here is a +typical example which compiles Apache for the installation tree +/sw/pkg/apache with a particular compiler and flags plus the two +additional modules mod_rewrite and mod_speling for later loading +through the DSO mechanism:

+ +
+ $ CC="pgcc" CFLAGS="-O2" \
+ ./configure --prefix=/sw/pkg/apache \
+ --enable-rewrite=shared \
+ --enable-speling=shared +
+ +

The easiest way to find all of the configuration flags for Apache +2.0 is to run ./configure --help. What follows is a brief description +of most of the arguments.

+ +
+     Reference:
+
+     $ [CC=...]        [TARGET=...]
+       [CPPFLAGS=...]  [NOTEST_CPPFLAGS=...]
+       [CFLAGS=...]    [NOTEST_CFLAGS=...]
+       [CXXFLAGS=...]  [NOTEST_CXXFLAGS=...]
+       [LDFLAGS=...]   [NOTEST_LDFLAGS=...]
+       [LIBS=...]      [NOTEST_LIBS=...]
+       [INCLUDES=...]  [SHLIB_PATH=...] 
+
+       ./configure
+           [--quiet]         [--prefix=DIR]            [--enable-NAME=(shared)]
+           [--verbose]       [--exec-prefix=PREFIX]    [--disable-NAME]
+           [--shadow[=DIR]]  [--bindir=EPREFIX]        [--with-mpm=NAME]
+           [--show-layout]   [--sbindir=DIR]           
+           [--help]          [--libexecdir=DIR]        
+                             [--mandir=DIR]            
+                             [--sysconfdir=DIR]        
+                             [--datadir=DIR]           
+                             [--includedir=DIR]        
+                             [--localstatedir=DIR]
+                             [--runtimedir=DIR]        [--enable-suexec]
+                             [--logfiledir=DIR]        [--suexec-caller=UID]
+                             [--proxycachedir=DIR]     [--suexec-docroot=DIR]
+                             [--with-layout=[FILE:]ID] [--suexec-logfile=FILE]
+                                                       [--suexec-userdir=DIR]
+                             [--with-perl=FILE]        [--suexec-uidmin=UID]
+                             [--without-support]       [--suexec-gidmin=GID]
+                             [--without-confadjust]    [--suexec-safepath=PATH]
+                             [--without-execstrip]
+			     [--server-uid=UID]
+			     [--server-gid=GID]
+
+                             [--enable-maintainter-mode]
+                             [--enable-debug]
+
+ +

Use the CC, CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS, INCLUDES, +SHLIB_PATH and TARGET environment variables to override or expand the +corresponding default entries as determined by configure.

+ +

Use NOTEST_CPPFLAGS, NOTEST_CFLAGS, NOTEST_CXXFLAGS, +NOTEST_LDFLAGS, and NOTEST_LIBS to add entries that should only be +used during the actual build and compilation of Apache, such as +-Werror.

+ +

Use the --prefix=PREFIX and --exec-prefix=EPREFIX options to +configure Apache to use a particular installation prefix. The default +is PREFIX=/usr/local/apache and EPREFIX=PREFIX.

+ +

Use the --bindir=DIR, --sbindir=DIR, --libexecdir=DIR, +--mandir=DIR, --sysconfdir=DIR, --datadir=DIR, --iconsdir=DIR, +--htdocsdir=DIR, --cgidir=DIR, --includedir=DIR, --localstatedir=DIR, +--runtimedir=DIR, --logfiledir=DIR and --proxycachedir=DIR option to +change the paths for particular subdirectories of the installation +tree. Defaults are bindir=EPREFIX/bin, sbindir=EPREFIX/bin, +libexecdir=EPREFIX/modules, mandir=PREFIX/man, sysconfdir=PREFIX/conf, +datadir=PREFIX, iconsdir=PREFIX/icons, htdocsdir=PREFIX/htdocs, +cgidir=PREFIX/cgi-bin, includedir=PREFIX/include, +localstatedir=PREFIX, runtimedir=PREFIX/logs, logfiledir=PREFIX/logs +and proxycachedir=PREFIX/proxy.

+ +

Note: To reduce the pollution of shared installation locations +(like /usr/local/ or /etc) with Apache files to a minimum the string +``/apache'' is automatically appended to 'libexecdir', 'sysconfdir', +'datadir', 'localstatedir' and 'includedir' if (and only if) the +following points apply for each path individually:

+
    +
  1. the path doesn't already contain the word ``apache''
  2. +
  3. the path was not directly customized by the user
  4. +
+ +

Keep in mind that per default these paths are derived from 'prefix' +and 'exec-prefix', so usually its only a matter whether these paths +contain ``apache'' or not. Although the defaults were defined with +experience in mind you always should make sure the paths fit your +situation by checking the finally chosen paths via the --layout +option.

+ +

Use the --with-layout=[F:]ID option to select a particular +installation path base-layout. You always _HAVE_ to select a +base-layout. There are currently two layouts pre-defined in the file +config.layout: `Apache' for the classical Apache path layout and `GNU' +for a path layout conforming to the GNU `standards' document. When you +want to use your own custom layout FOO, either add a corresponding +"<Layout FOO>...</Layout>" section to config.layout and use +--with-layout=FOO or place it into your own file, say config.mypaths, +and use --with-layout=config.mypaths:FOO.

+ +

Use the --show-layout option to check the final installation path +layout while fiddling with the options above.

+ +

Use the --enable-NAME=(shared) and --disable-NAME options to enable +or disable a particular already distributed module from the Apache +package.

+ +

Use the --with-mpm=NAME option to determine which MPM should be +built for your server.

+ +

List of Available Modules

+
+     Environment creation
+      (+) mod_env .......... Set environment variables for CGI/SSI scripts
+      (+) mod_setenvif ..... Set environment variables based on HTTP headers
+      (-) mod_unique_id .... Generate unique identifiers for request
+
+     Content type decisions
+      (+) mod_mime ......... Content type/encoding determination (configured)
+      (-) mod_mime_magic ... Content type/encoding determination (automatic)
+      (+) mod_negotiation .. Content selection based on the HTTP Accept* headers
+
+     URL mapping
+      (+) mod_alias ........ Simple   URL translation and redirection
+      (-) mod_rewrite ...... Advanced URL translation and redirection
+      (+) mod_userdir ...... Selection of resource directories by username
+      (-) mod_speling ...... Correction of misspelled URLs
+
+     Directory Handling
+      (+) mod_dir .......... Directory and directory default file handling
+      (+) mod_autoindex .... Automated directory index file generation
+
+     Access Control and Authentication
+      (+) mod_access ....... Access Control (user, host, network)
+      (+) mod_auth ......... HTTP Basic Authentication (user, passwd)
+      (-) mod_auth_dbm ..... HTTP Basic Authentication via Unix NDBM files
+      (-) mod_auth_db ...... HTTP Basic Authentication via Berkeley-DB files
+      (-) mod_auth_anon .... HTTP Basic Authentication for Anonymous-style users
+      (-) mod_digest ....... HTTP Digest Authentication
+
+     HTTP response
+      (-) mod_headers ...... Arbitrary HTTP response headers (configured)
+      (-) mod_cern_meta .... Arbitrary HTTP response headers (CERN-style files)
+      (-) mod_expires ...... Expires HTTP responses 
+      (+) mod_asis ......... Raw HTTP responses 
+
+     Scripting
+      (+) mod_include ...... Server Side Includes (SSI) support
+      (+) mod_cgi .......... Common Gateway Interface (CGI) support
+      (+) mod_cgid ......... Common Gateway Interface (CGI) support for 
+                             multi-threaded MPMs
+      (+) mod_actions ...... Map CGI scripts to act as internal `handlers'
+
+     Internal Content Handlers
+      (+) mod_status ....... Content handler for server run-time status
+      (-) mod_info ......... Content handler for server configuration summary
+
+     Request Logging
+      (+) mod_log_config ... Customizable logging of requests
+      (-) mod_usertrack .... Logging of user click-trails via HTTP Cookies
+
+     Content Management
+      (-) mod_dav .......... WebDAV (RFC 2518) support for Apache
+      (-) mod_dav_fs ....... mod_dav backend to managing filesystem content
+
+     Miscellaneous
+      (+) mod_imap ......... Server-side Image Map support
+      (-) mod_proxy ........ Caching Proxy Module (HTTP, HTTPS, FTP)
+      (-) mod_so ........... Dynamic Shared Object (DSO) bootstrapping
+
+     Experimental
+      (-) mod_mmap_static .. Caching of frequently served pages via mmap()
+
+     Development
+      (-) mod_example ...... Apache API demonstration (developers only)
+
+     MPMs
+          mpmt_pthread ..... Multi-process(dynamic) Multi-threaded(static) 
+                             Unix MPM
+          prefork .......... Preforking Unix MPM
+          perchild ......... Multi-process(static) Multi-threaded(dynamic)
+                             Unix MPM, that allows a User per child process
+
+          winnt ............ Multi-process(1) Multi-threaded Windows MPM
+
+          mpmt_beos ........ Multi-process Multi-threaded Beos MPM
+          beos ............. Multi-process Multi-threaded Beos MPM
+
+          spmt_os2 ......... Single-process Multi-threaded OS/2 MPM
+     _________________________________________________________________________
+                    (+) = enabled  per default [disable with --disable-module]
+                    (-) = disabled per default [enable  with --enable-module ]
+
+
+ +

Use the --enable-suexec option to enable the suEXEC feature by +building and installing the "suexec" support program.

+ +

CAUTION: FOR DETAILS ABOUT THE SUEXEC FEATURE WE HIGHLY +RECOMMEND YOU TO FIRST READ THE DOCUMENT htdocs/manual/suexec.html +BEFORE USING THE ABOVE OPTIONS.

+ +

USING THE SUEXEC FEATURE PROPERLY CAN REDUCE CONSIDERABLY +THE SECURITY RISKS INVOLVED WITH ALLOWING USERS TO DEVELOP AND RUN +PRIVATE CGI OR SSI PROGRAMS. HOWEVER, IF SUEXEC IS IMPROPERLY +CONFIGURED, IT CAN CAUSE ANY NUMBER OF PROBLEMS AND POSSIBLY CREATE +NEW HOLES IN YOUR COMPUTER'S SECURITY. IF YOU AREN'T FAMILIAR WITH +MANAGING SETUID ROOT PROGRAMS AND THE SECURITY ISSUES THEY PRESENT, WE +HIGHLY RECOMMEND THAT YOU NOT CONSIDER USING SUEXEC AND KEEP AWAY FROM +THESE OPTIONS!

+ +

Use the --quiet option to disable all configuration verbose +messages.

+ + +

Building the package

+ +

Now you can build the various parts which form the Apache package +by simply running the command:

+ +
+ $ make +
+ +

Please be patient here, this takes approximately 2 minutes to +complete under a Pentium-166/FreeBSD-2.2 system, dependend on the +amount of modules you have enabled.

+ + +

Installing the package

+ +

Now its time to install the package under the configured +installation PREFIX (see --prefix option above) by running: +

+ $ make install +
+ +

For the paranoid hackers under us: The above command really +installs under prefix _only_, i.e. no other stuff from your system is +touched. Even if you upgrade an existing installation your +configuration files in PREFIX/conf/ are preserved.

+ + +

Testing the package

+ +

Now you can fire up your Apache HTTP server by immediately running:

+ +
+ $ PREFIX/bin/apachectl start +
+ +

and then you should be able to request your first document via URL +http://localhost/ (when you built and installed Apache as root or at +least used the --without-confadjust option) or http://localhost:8080/ +(when you built and installed Apache as a regular user). Then stop the +server again by running:

+
+ $ PREFIX/bin/apachectl stop +
+ +

Customizing the package

+ +

Finally you can customize your Apache HTTP server by editing the +configuration files under PREFIX/conf/.

+
+ $ vi PREFIX/conf/httpd.conf +
+ +

Have a look at the Apache manual under docs/manual/ or +http://httpd.apache.org/docs/ for a complete reference of available +configuration directives.

+ + +

Preparing the system

+ +

Proper operation of a public HTTP server requires at least the +following:

+ +
    + +
  1. A correctly working TCP/IP layer, since HTTP is implemented on top +of TCP/IP. Although modern Unix platforms have good networking layers, +always make sure you have all official vendor patches referring to the +network layer applied.
  2. + +
  3. Accurate time keeping, since elements of the HTTP protocol are +expressed as the time of day. So, it's time to investigate setting +some time synchronization facility on your system. Usually the ntpdate +or xntpd programs are used for this purpose which are based on the +Network Time Protocol (NTP). See the Usenet newsgroup +comp.protocols.time.ntp and the NTP homepage at +http://www.eecis.udel.edu/~ntp/ for more details about NTP software +and public time servers.
  4. + +
+ diff --git a/docs/manual/install.html.en b/docs/manual/install.html.en index 3b997645dd..9b1b920da9 100644 --- a/docs/manual/install.html.en +++ b/docs/manual/install.html.en @@ -14,185 +14,445 @@ > -
Warning: -This document has not been updated to take into account changes -made in the 2.0 version of the Apache HTTP Server. Some of the -information may still be relevant, but please use it -with care. -
- -

Compiling and Installing Apache 1.3

- -This document covers compilation and installation of Apache on Unix -systems only. For compiling and installation on Windows, see Using Apache with Microsoft Windows and for -TPF see Installing the Apache 1.3 HTTP -Server on TPF. - -

- -UnixWare users will want to consult build notes -for various UnixWare versions before compiling. - -

Downloading Apache

- -Information on the latest version of Apache can be found on the Apache -web server at http://www.apache.org/. This will -list the current release, any more recent beta-test release, together -with details of mirror web and anonymous ftp sites. - -

- -If you downloaded a binary distribution, skip to Installing Apache. Otherwise read the next section -for how to compile the server. - -

Compiling Apache

- -Compiling Apache consists of three steps: Firstly select which Apache -modules you want to include into the server. Secondly create a -configuration for your operating system. Thirdly compile the -executable. -

- -All configuration of Apache is performed in the src -directory of the Apache distribution. Change into this directory. - -

    -
  1. - Select modules to compile into Apache in the - Configuration file. Uncomment lines corresponding to - those optional modules you wish to include (among the AddModule lines - at the bottom of the file), or add new lines corresponding to - additional modules you have downloaded or written. (See API.html for preliminary docs on how to - write Apache modules). Advanced users can comment out some of the - default modules if they are sure they will not need them (be careful - though, since many of the default modules are vital for the correct - operation and security of the server). -

    - - You should also read the instructions in the Configuration - file to see if you need to set any of the Rule lines. - - -

  2. - Configure Apache for your operating system. Normally you can just - run the Configure script as given below. However - if this fails or you have any special requirements (e.g., to include - an additional library required by an optional module) you might need - to edit one or more of the following options in the - Configuration file: - EXTRA_CFLAGS, LIBS, LDFLAGS, INCLUDES. -

    - - Run the Configure script: -

    -
    -    % Configure
    -    Using 'Configuration' as config file
    -     + configured for <whatever> platform
    -     + setting C compiler to <whatever> *
    -     + setting C compiler optimization-level to <whatever> *
    -     + Adding selected modules
    -     + doing sanity check on compiler and options
    -    Creating Makefile in support
    -    Creating Makefile in main
    -    Creating Makefile in os/unix
    -    Creating Makefile in modules/standard
    -   
    -
    - - (*: Depending on Configuration and your system, Configure - might not print these lines. That's OK).

    - - This generates a Makefile for use in stage 3. It also creates a - Makefile in the support directory, for compilation of the optional - support programs. -

    - - (If you want to maintain multiple configurations, you can give an - option to Configure to tell it to read an alternative - Configuration file, such as Configure -file - Configuration.ai). -

    - -

  3. - Type make. -
- -The modules we place in the Apache distribution are the ones we have -tested and are used regularly by various members of the Apache -development group. Additional modules contributed by members or third -parties with specific needs or functions are available at -<http://www.apache.org/dist/httpd/contrib/modules/>. -There are instructions on that page for linking these modules into the -core Apache code. - -

Installing Apache

- -You will have a binary file called httpd in the -src directory. A binary distribution of Apache will -supply this file.

- -The next step is to install the program and configure it. Apache is -designed to be configured and run from the same set of directories -where it is compiled. If you want to run it from somewhere else, make -a directory and copy the conf, logs and -icons directories into it. In either case you should -read the security tips -describing how to set the permissions on the server root directory.

- -The next step is to edit the configuration files for the server. This -consists of setting up various directives in up to three -central configuration files. By default, these files are located in -the conf directory and are called srm.conf, -access.conf and httpd.conf. To help you get -started there are same files in the conf directory of the -distribution, called srm.conf-dist, -access.conf-dist and httpd.conf-dist. Copy -or rename these files to the names without the -dist. -Then edit each of the files. Read the comments in each file carefully. -Failure to setup these files correctly could lead to your server not -working or being insecure. You should also have an additional file in -the conf directory called mime.types. This -file usually does not need editing. - -

- -First edit httpd.conf. This sets up general attributes -about the server: the port number, the user it runs as, etc. Next -edit the srm.conf file; this sets up the root of the -document tree, special functions like server-parsed HTML or internal -imagemap parsing, etc. Finally, edit the access.conf -file to at least set the base cases of access. - -

- -In addition to these three files, the server behavior can be configured -on a directory-by-directory basis by using .htaccess -files in directories accessed by the server. - -

Set your system time properly!

- -Proper operation of a public web server requires accurate time -keeping, since elements of the HTTP protocol are expressed as the time -of day. So, it's time to investigate setting up NTP or some other -time synchronization system on your Unix box, or whatever the -equivalent on NT would be. - -

Compiling Support Programs

- -In addition to the main httpd server which is compiled -and configured as above, Apache includes a number of support programs. -These are not compiled by default. The support programs are in the -support directory of the distribution. To compile -the support programs, change into this directory and type -
-    make
-
+

Compiling and Installing

+ + +

This document covers compilation and installation of Apache on Unix +and Unix-like systems only. For compiling and installation on Windows, +see Using Apache with Microsoft +Windows. For other platforms, see the platform documentation.

+ +

Apache 2.0's configuration and installation environment has changed +completely from Apache 1.3. Apache 1.3 used a custom set of scripts +to achieve easy installation. Apache 2.0 now uses libtool and +autoconf to create an environment that looks like many other Open +Source projects.

+ +

Overview for the impatient

+ +
+ $ ./configure --prefix=PREFIX
+ $ make
+ $ make install
+ $ PREFIX/bin/apachectl start +
+ +

Notes: +

+ +

Requirements

+ +

The following requirements exist for building Apache:

+ + + + +

If you are building from a copy of the CVS repository, rather than +a release distribution, then you will need these additional tools:

+ + + +

Configuring the source tree

+ +

Setup

+ +

If you have downloading the Apache 2.0 from the CVS, rather than a +release distribution, then you will need to prepare the source tree +for configuration and compilation. This is done by running:

+ +
+ ./buildconf +
+ +

This script ensures that all required programs are installed on the +currently machine, and creates the ./configure script. If you are +using a package downloaded from apache.org then this step is not +necessary.

+ +

Introduction

+ +

The next step is to configure the Apache source tree for your +particular platform and personal requirements. The most important +setup here is the location prefix where Apache is to be installed +later, because Apache has to be configured for this location to work +correctly. But there are a lot of other options available for your +pleasure.

+ +

For a short impression of what possibilities you have, here is a +typical example which compiles Apache for the installation tree +/sw/pkg/apache with a particular compiler and flags plus the two +additional modules mod_rewrite and mod_speling for later loading +through the DSO mechanism:

+ +
+ $ CC="pgcc" CFLAGS="-O2" \
+ ./configure --prefix=/sw/pkg/apache \
+ --enable-rewrite=shared \
+ --enable-speling=shared +
+ +

The easiest way to find all of the configuration flags for Apache +2.0 is to run ./configure --help. What follows is a brief description +of most of the arguments.

+ +
+     Reference:
+
+     $ [CC=...]        [TARGET=...]
+       [CPPFLAGS=...]  [NOTEST_CPPFLAGS=...]
+       [CFLAGS=...]    [NOTEST_CFLAGS=...]
+       [CXXFLAGS=...]  [NOTEST_CXXFLAGS=...]
+       [LDFLAGS=...]   [NOTEST_LDFLAGS=...]
+       [LIBS=...]      [NOTEST_LIBS=...]
+       [INCLUDES=...]  [SHLIB_PATH=...] 
+
+       ./configure
+           [--quiet]         [--prefix=DIR]            [--enable-NAME=(shared)]
+           [--verbose]       [--exec-prefix=PREFIX]    [--disable-NAME]
+           [--shadow[=DIR]]  [--bindir=EPREFIX]        [--with-mpm=NAME]
+           [--show-layout]   [--sbindir=DIR]           
+           [--help]          [--libexecdir=DIR]        
+                             [--mandir=DIR]            
+                             [--sysconfdir=DIR]        
+                             [--datadir=DIR]           
+                             [--includedir=DIR]        
+                             [--localstatedir=DIR]
+                             [--runtimedir=DIR]        [--enable-suexec]
+                             [--logfiledir=DIR]        [--suexec-caller=UID]
+                             [--proxycachedir=DIR]     [--suexec-docroot=DIR]
+                             [--with-layout=[FILE:]ID] [--suexec-logfile=FILE]
+                                                       [--suexec-userdir=DIR]
+                             [--with-perl=FILE]        [--suexec-uidmin=UID]
+                             [--without-support]       [--suexec-gidmin=GID]
+                             [--without-confadjust]    [--suexec-safepath=PATH]
+                             [--without-execstrip]
+			     [--server-uid=UID]
+			     [--server-gid=GID]
+
+                             [--enable-maintainter-mode]
+                             [--enable-debug]
+
+ +

Use the CC, CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS, INCLUDES, +SHLIB_PATH and TARGET environment variables to override or expand the +corresponding default entries as determined by configure.

+ +

Use NOTEST_CPPFLAGS, NOTEST_CFLAGS, NOTEST_CXXFLAGS, +NOTEST_LDFLAGS, and NOTEST_LIBS to add entries that should only be +used during the actual build and compilation of Apache, such as +-Werror.

+ +

Use the --prefix=PREFIX and --exec-prefix=EPREFIX options to +configure Apache to use a particular installation prefix. The default +is PREFIX=/usr/local/apache and EPREFIX=PREFIX.

+ +

Use the --bindir=DIR, --sbindir=DIR, --libexecdir=DIR, +--mandir=DIR, --sysconfdir=DIR, --datadir=DIR, --iconsdir=DIR, +--htdocsdir=DIR, --cgidir=DIR, --includedir=DIR, --localstatedir=DIR, +--runtimedir=DIR, --logfiledir=DIR and --proxycachedir=DIR option to +change the paths for particular subdirectories of the installation +tree. Defaults are bindir=EPREFIX/bin, sbindir=EPREFIX/bin, +libexecdir=EPREFIX/modules, mandir=PREFIX/man, sysconfdir=PREFIX/conf, +datadir=PREFIX, iconsdir=PREFIX/icons, htdocsdir=PREFIX/htdocs, +cgidir=PREFIX/cgi-bin, includedir=PREFIX/include, +localstatedir=PREFIX, runtimedir=PREFIX/logs, logfiledir=PREFIX/logs +and proxycachedir=PREFIX/proxy.

+ +

Note: To reduce the pollution of shared installation locations +(like /usr/local/ or /etc) with Apache files to a minimum the string +``/apache'' is automatically appended to 'libexecdir', 'sysconfdir', +'datadir', 'localstatedir' and 'includedir' if (and only if) the +following points apply for each path individually:

+
    +
  1. the path doesn't already contain the word ``apache''
  2. +
  3. the path was not directly customized by the user
  4. +
+ +

Keep in mind that per default these paths are derived from 'prefix' +and 'exec-prefix', so usually its only a matter whether these paths +contain ``apache'' or not. Although the defaults were defined with +experience in mind you always should make sure the paths fit your +situation by checking the finally chosen paths via the --layout +option.

+ +

Use the --with-layout=[F:]ID option to select a particular +installation path base-layout. You always _HAVE_ to select a +base-layout. There are currently two layouts pre-defined in the file +config.layout: `Apache' for the classical Apache path layout and `GNU' +for a path layout conforming to the GNU `standards' document. When you +want to use your own custom layout FOO, either add a corresponding +"<Layout FOO>...</Layout>" section to config.layout and use +--with-layout=FOO or place it into your own file, say config.mypaths, +and use --with-layout=config.mypaths:FOO.

+ +

Use the --show-layout option to check the final installation path +layout while fiddling with the options above.

+ +

Use the --enable-NAME=(shared) and --disable-NAME options to enable +or disable a particular already distributed module from the Apache +package.

+ +

Use the --with-mpm=NAME option to determine which MPM should be +built for your server.

+ +

List of Available Modules

+
+     Environment creation
+      (+) mod_env .......... Set environment variables for CGI/SSI scripts
+      (+) mod_setenvif ..... Set environment variables based on HTTP headers
+      (-) mod_unique_id .... Generate unique identifiers for request
+
+     Content type decisions
+      (+) mod_mime ......... Content type/encoding determination (configured)
+      (-) mod_mime_magic ... Content type/encoding determination (automatic)
+      (+) mod_negotiation .. Content selection based on the HTTP Accept* headers
+
+     URL mapping
+      (+) mod_alias ........ Simple   URL translation and redirection
+      (-) mod_rewrite ...... Advanced URL translation and redirection
+      (+) mod_userdir ...... Selection of resource directories by username
+      (-) mod_speling ...... Correction of misspelled URLs
+
+     Directory Handling
+      (+) mod_dir .......... Directory and directory default file handling
+      (+) mod_autoindex .... Automated directory index file generation
+
+     Access Control and Authentication
+      (+) mod_access ....... Access Control (user, host, network)
+      (+) mod_auth ......... HTTP Basic Authentication (user, passwd)
+      (-) mod_auth_dbm ..... HTTP Basic Authentication via Unix NDBM files
+      (-) mod_auth_db ...... HTTP Basic Authentication via Berkeley-DB files
+      (-) mod_auth_anon .... HTTP Basic Authentication for Anonymous-style users
+      (-) mod_digest ....... HTTP Digest Authentication
+
+     HTTP response
+      (-) mod_headers ...... Arbitrary HTTP response headers (configured)
+      (-) mod_cern_meta .... Arbitrary HTTP response headers (CERN-style files)
+      (-) mod_expires ...... Expires HTTP responses 
+      (+) mod_asis ......... Raw HTTP responses 
+
+     Scripting
+      (+) mod_include ...... Server Side Includes (SSI) support
+      (+) mod_cgi .......... Common Gateway Interface (CGI) support
+      (+) mod_cgid ......... Common Gateway Interface (CGI) support for 
+                             multi-threaded MPMs
+      (+) mod_actions ...... Map CGI scripts to act as internal `handlers'
+
+     Internal Content Handlers
+      (+) mod_status ....... Content handler for server run-time status
+      (-) mod_info ......... Content handler for server configuration summary
+
+     Request Logging
+      (+) mod_log_config ... Customizable logging of requests
+      (-) mod_usertrack .... Logging of user click-trails via HTTP Cookies
+
+     Content Management
+      (-) mod_dav .......... WebDAV (RFC 2518) support for Apache
+      (-) mod_dav_fs ....... mod_dav backend to managing filesystem content
+
+     Miscellaneous
+      (+) mod_imap ......... Server-side Image Map support
+      (-) mod_proxy ........ Caching Proxy Module (HTTP, HTTPS, FTP)
+      (-) mod_so ........... Dynamic Shared Object (DSO) bootstrapping
+
+     Experimental
+      (-) mod_mmap_static .. Caching of frequently served pages via mmap()
+
+     Development
+      (-) mod_example ...... Apache API demonstration (developers only)
+
+     MPMs
+          mpmt_pthread ..... Multi-process(dynamic) Multi-threaded(static) 
+                             Unix MPM
+          prefork .......... Preforking Unix MPM
+          perchild ......... Multi-process(static) Multi-threaded(dynamic)
+                             Unix MPM, that allows a User per child process
+
+          winnt ............ Multi-process(1) Multi-threaded Windows MPM
+
+          mpmt_beos ........ Multi-process Multi-threaded Beos MPM
+          beos ............. Multi-process Multi-threaded Beos MPM
+
+          spmt_os2 ......... Single-process Multi-threaded OS/2 MPM
+     _________________________________________________________________________
+                    (+) = enabled  per default [disable with --disable-module]
+                    (-) = disabled per default [enable  with --enable-module ]
+
+
+ +

Use the --enable-suexec option to enable the suEXEC feature by +building and installing the "suexec" support program.

+ +

CAUTION: FOR DETAILS ABOUT THE SUEXEC FEATURE WE HIGHLY +RECOMMEND YOU TO FIRST READ THE DOCUMENT htdocs/manual/suexec.html +BEFORE USING THE ABOVE OPTIONS.

+ +

USING THE SUEXEC FEATURE PROPERLY CAN REDUCE CONSIDERABLY +THE SECURITY RISKS INVOLVED WITH ALLOWING USERS TO DEVELOP AND RUN +PRIVATE CGI OR SSI PROGRAMS. HOWEVER, IF SUEXEC IS IMPROPERLY +CONFIGURED, IT CAN CAUSE ANY NUMBER OF PROBLEMS AND POSSIBLY CREATE +NEW HOLES IN YOUR COMPUTER'S SECURITY. IF YOU AREN'T FAMILIAR WITH +MANAGING SETUID ROOT PROGRAMS AND THE SECURITY ISSUES THEY PRESENT, WE +HIGHLY RECOMMEND THAT YOU NOT CONSIDER USING SUEXEC AND KEEP AWAY FROM +THESE OPTIONS!

+ +

Use the --quiet option to disable all configuration verbose +messages.

+ + +

Building the package

+ +

Now you can build the various parts which form the Apache package +by simply running the command:

+ +
+ $ make +
+ +

Please be patient here, this takes approximately 2 minutes to +complete under a Pentium-166/FreeBSD-2.2 system, dependend on the +amount of modules you have enabled.

+ + +

Installing the package

+ +

Now its time to install the package under the configured +installation PREFIX (see --prefix option above) by running: +

+ $ make install +
+ +

For the paranoid hackers under us: The above command really +installs under prefix _only_, i.e. no other stuff from your system is +touched. Even if you upgrade an existing installation your +configuration files in PREFIX/conf/ are preserved.

+ + +

Testing the package

+ +

Now you can fire up your Apache HTTP server by immediately running:

+ +
+ $ PREFIX/bin/apachectl start +
+ +

and then you should be able to request your first document via URL +http://localhost/ (when you built and installed Apache as root or at +least used the --without-confadjust option) or http://localhost:8080/ +(when you built and installed Apache as a regular user). Then stop the +server again by running:

+
+ $ PREFIX/bin/apachectl stop +
+ +

Customizing the package

+ +

Finally you can customize your Apache HTTP server by editing the +configuration files under PREFIX/conf/.

+
+ $ vi PREFIX/conf/httpd.conf +
+ +

Have a look at the Apache manual under docs/manual/ or +http://httpd.apache.org/docs/ for a complete reference of available +configuration directives.

+ + +

Preparing the system

+ +

Proper operation of a public HTTP server requires at least the +following:

+ +
    + +
  1. A correctly working TCP/IP layer, since HTTP is implemented on top +of TCP/IP. Although modern Unix platforms have good networking layers, +always make sure you have all official vendor patches referring to the +network layer applied.
  2. + +
  3. Accurate time keeping, since elements of the HTTP protocol are +expressed as the time of day. So, it's time to investigate setting +some time synchronization facility on your system. Usually the ntpdate +or xntpd programs are used for this purpose which are based on the +Network Time Protocol (NTP). See the Usenet newsgroup +comp.protocols.time.ntp and the NTP homepage at +http://www.eecis.udel.edu/~ntp/ for more details about NTP software +and public time servers.
  4. + +
+ -- 2.50.1