]> granicus.if.org Git - apache/blob - INSTALL
*Sigh.* The janitor cleans up after himself.
[apache] / INSTALL
1
2   APACHE INSTALLATION
3
4   Introduction
5   ============
6
7   Apache 2.0's configuration and installation environment has changed
8   completely from Apache 1.3.  Apache 1.3 used a custom set of scripts
9   to achieve easy installation.  Apache 2.0 now uses libtool and
10   autoconf to create an environment that looks like many other Open
11   Source projects.
12
13
14   Installing the Apache 2.0 HTTP server
15   =====================================
16
17   1. Overview for the impatient
18      --------------------------
19
20      $ ./configure --prefix=PREFIX
21      $ make
22      $ make install
23      $ PREFIX/bin/apachectl start
24
25      NOTE: PREFIX is not the string "PREFIX". Instead use the Unix
26            filesystem path under which Apache should be installed. For
27            instance use "/usr/local/apache" for PREFIX above.
28
29      NOTE: if you are building from a copy of the Apache CVS
30            repository, rather than a release distribution, then you
31            must use the "buildconf" script before running configure.
32
33      NOTE: If you are building on FreeBSD, you should add the argument
34            --with-mpm=prefork to the configure line.  The Apache Group
35            has discovered that threads do not work well with Apache
36            on FreeBSD.  For that reason, we disable threads by default
37            on FreeBSD, and you need to build the prefork MPM.  If you wish
38            to try to make threads work on FreeBSD, they can be re-enabled
39            by using --enable-threads
40
41   2. Requirements
42      ------------
43
44      The following requirements exist for building Apache:
45
46      o  Disk Space: 
47
48         Make sure you have approximately 12 MB of temporary free disk
49         space available.  After installation Apache occupies
50         approximately 5 MB of disk space (the actual required disk
51         space depends on the amount of compiled in third party
52         modules, etc).
53
54      o  ANSI-C Compiler: 
55
56         Make sure you have an ANSI-C compiler installed. The GNU C
57         compiler (GCC) from the Free Software Foundation (FSF) is
58         recommended (version 2.7.2 is fine). If you don't have GCC
59         then at least make sure your vendors compiler is ANSI
60         compliant. You can find the homepage of GNU at
61         http://www.gnu.org/ and the GCC distribution under
62         http://www.gnu.org/order/ftp.html .
63
64      o  Perl 5 Interpreter [OPTIONAL]:
65
66         For some of the support scripts like `apxs' or `dbmmanage'
67         (which are written in Perl) the Perl 5 interpreter is required
68         (versions 5.003 and 5.004 are fine). If no such interpreter is
69         found by the `configure' script this is no harm.  Of
70         course, you still can build and install Apache 2.0. Only those
71         support scripts cannot be used. If you have multiple Perl
72         interpreters installed (perhaps a Perl 4 from the vendor and a
73         Perl 5 from your own), then it is recommended to use the
74         --with-perl option (see below) to make sure the correct one is
75         selected by ./configure.
76
77      o  Dynamic Shared Object (DSO) support [OPTIONAL]:
78
79         To provide maximum flexibility Apache now is able to load
80         modules under runtime via the DSO mechanism by using the
81         pragmatic apr_dso_open()/apr_dso_sym() calls. These calls
82         are not available under all operating systems therefore you
83         cannot use the DSO mechanism on all platforms. Apache relies
84         on autoconf to detect the ability to use DSOs, and libtool to
85         determine how to build DSOs. If your platform is supported by
86         libtool, and we can find DSO system calls, then DSOs should
87         work out-of-the-box. 
88
89         If your system is not on these lists but has the dlopen-style
90         interface, you either have to provide the appropriate compiler
91         and linker flags (see CFLAGS_SHLIB, LDFLAGS_SHLIB and
92         LDFLAGS_SHLIB_EXPORT below) manually or at least make sure a
93         Perl 5 interpreter is installed from which Apache can guess
94         the options.
95
96
97      If you are building from a copy of the CVS repository, rather
98      than a release distribution, then you will need these additional
99      tools:
100
101      o  Libtool 1.3.3:
102
103         Make sure that you have libtool 1.3.3 or later installed
104         before trying to configure and build Apache 2.0.  Libtool can
105         be downloaded from the Free Software Foundation (FSF), at
106         http://www.gnu.org/order/ftp.html.
107
108      o  Autoconf 2.13:
109
110         Make sure that you have autoconf 2.13 or later installed
111         before trying to configure and build Apache 2.0.  Autoconf can
112         be downloaded from the Free Software Foundation (FSF), at
113         http://www.gnu.org/order/ftp.html.
114
115
116   3. Configuring the source tree
117      ---------------------------
118
119      Setup:
120
121      If you have downloading the Apache 2.0 from the CVS, rather than
122      a release distribution, then you will need to prepare the source
123      tree for configuration and compilation. This is done by running:
124  
125      ./buildconf
126
127      This script ensures that all required programs are installed on
128      the currently machine, and creates the ./configure script.  If
129      you are using a package downloaded from apache.org then this step
130      is not necessary.
131
132      Introduction:
133
134      The next step is to configure the Apache source tree for your
135      particular platform and personal requirements. The most important
136      setup here is the location prefix where Apache is to be installed
137      later, because Apache has to be configured for this location to
138      work correctly. But there are a lot of other options available
139      for your pleasure.
140
141      For a short impression of what possibilities you have, here is a
142      typical example which compiles Apache for the installation tree
143      /sw/pkg/apache with a particular compiler and flags plus the two
144      additional modules mod_rewrite and mod_speling for later loading
145      through the DSO mechanism:
146
147      $ CC="pgcc" OPTIM="-O2" \
148        ./configure --prefix=/sw/pkg/apache \
149                    --enable-rewrite=shared \
150                    --enable-speling=shared
151
152      The easiest way to find all of the configuration flags for Apache
153      2.0 is to run ./configure --help.  What follows is a brief
154      description of most of the arguments.
155
156      Reference:
157
158      $ [CC=...]        [CFLAGS_SHLIB=...]           [TARGET=...]
159        [OPTIM=...]     [LD_SHLIB=...]
160        [CFLAGS=...]    [LDFLAGS_SHLIB=...]        
161        [INCLUDES=...]  [LDFLAGS_SHLIB_EXPORT=...] 
162        [LDFLAGS=...]   [RANLIB=...]  
163        [LIBS=...]      [DEPS=...]
164        [NOTEST_CFLAGS=...]
165        [NOTEST_LDFLAGS=...]
166        ./configure
167            [--quiet]         [--prefix=DIR]            [--enable-NAME=(shared)]
168            [--verbose]       [--exec-prefix=PREFIX]    [--disable-NAME]
169            [--shadow[=DIR]]  [--bindir=EPREFIX]        [--with-mpm=NAME]
170            [--show-layout]   [--sbindir=DIR]           
171            [--help]          [--libexecdir=DIR]        
172                              [--mandir=DIR]            
173                              [--sysconfdir=DIR]        
174                              [--datadir=DIR]           
175                              [--includedir=DIR]        
176                              [--localstatedir=DIR]
177                              [--runtimedir=DIR]        [--enable-suexec]
178                              [--logfiledir=DIR]        [--suexec-caller=UID]
179                              [--proxycachedir=DIR]     [--suexec-docroot=DIR]
180                              [--with-layout=[FILE:]ID] [--suexec-logfile=FILE]
181                                                        [--suexec-userdir=DIR]
182                              [--with-perl=FILE]        [--suexec-uidmin=UID]
183                              [--without-support]       [--suexec-gidmin=GID]
184                              [--without-confadjust]    [--suexec-safepath=PATH]
185                              [--without-execstrip]
186                              [--server-uid=UID]        [--with-maintainter-mode]
187                              [--server-gid=GID]
188
189      Use the CC, OPTIM, CFLAGS, INCLUDES, LDFLAGS, LIBS, CFLAGS_SHLIB,
190      LD_SHLIB, LDFLAGS_SHLIB, LDFLAGS_SHLIB_EXPORT, RANLIB, DEPS and
191      TARGET environment variables to override and expand the corresponding
192      default entries as determined by configure. Use NOTEST_CFLAGS
193      and NOTEST_LDFLAGS to add entries that should be used only during
194      the actual build and compilation of Apache, such as -Werror.
195
196      Use the --prefix=PREFIX and --exec-prefix=EPREFIX options to
197      configure Apache to use a particular installation prefix. The
198      default is PREFIX=/usr/local/apache and EPREFIX=PREFIX.
199
200      Use the --bindir=DIR, --sbindir=DIR, --libexecdir=DIR,
201      --mandir=DIR, --sysconfdir=DIR, --datadir=DIR, --iconsdir=DIR,
202      --htdocsdir=DIR, --cgidir=DIR, --includedir=DIR,
203      --localstatedir=DIR, --runtimedir=DIR, --logfiledir=DIR and
204      --proxycachedir=DIR option to change the paths for particular
205      subdirectories of the installation tree.  Defaults are
206      bindir=EPREFIX/bin, sbindir=EPREFIX/bin,
207      libexecdir=EPREFIX/modules, mandir=PREFIX/man,
208      sysconfdir=PREFIX/conf, datadir=PREFIX, iconsdir=PREFIX/icons,
209      htdocsdir=PREFIX/htdocs, cgidir=PREFIX/cgi-bin,
210      includedir=PREFIX/include, localstatedir=PREFIX,
211      runtimedir=PREFIX/logs, logfiledir=PREFIX/logs and
212      proxycachedir=PREFIX/proxy.
213
214          Note: To reduce the pollution of shared installation
215                locations (like /usr/local/ or /etc) with Apache files
216                to a minimum the string ``/apache'' is automatically
217                appended to 'libexecdir', 'sysconfdir', 'datadir',
218                'localstatedir' and 'includedir' if (and only if) the
219                following points apply for each path individually:
220
221                    1. the path doesn't already contain the word ``apache''
222                    2. the path was not directly customized by the user
223
224                Keep in mind that per default these paths are derived
225                from 'prefix' and 'exec-prefix', so usually its only a
226                matter whether these paths contain ``apache'' or
227                not. Although the defaults were defined with experience
228                in mind you always should make sure the paths fit your
229                situation by checking the finally chosen paths via the
230                --layout option.
231
232      Use the --with-layout=[F:]ID option to select a particular
233      installation path base-layout. You always _HAVE_ to select a
234      base-layout. There are currently two layouts pre-defined in the
235      file config.layout: `Apache' for the classical Apache path layout
236      and `GNU' for a path layout conforming to the GNU `standards'
237      document. When you want to use your own custom layout FOO, either
238      add a corresponding "<Layout FOO>...</Layout>" section to
239      config.layout and use --with-layout=FOO or place it into your own
240      file, say config.mypaths, and use
241      --with-layout=config.mypaths:FOO.
242  
243      Use the --show-layout option to check the final installation path
244      layout while fiddling with the options above.
245  
246      Use the --enable-NAME=(shared) and --disable-NAME options to
247      enable or disable a particular already distributed module from
248      the Apache package.
249
250      Use the --with-mpm=NAME option to determine which MPM should be
251      built for your server.
252
253      _________________________________________________________________________
254      LIST OF AVAILABLE MODULES
255
256      Environment creation
257       (+) mod_env .......... Set environment variables for CGI/SSI scripts
258       (+) mod_setenvif ..... Set environment variables based on HTTP headers
259       (-) mod_unique_id .... Generate unique identifiers for request
260
261      Content type decisions
262       (+) mod_mime ......... Content type/encoding determination (configured)
263       (-) mod_mime_magic ... Content type/encoding determination (automatic)
264       (+) mod_negotiation .. Content selection based on the HTTP Accept* headers
265
266      URL mapping
267       (+) mod_alias ........ Simple   URL translation and redirection
268       (-) mod_rewrite ...... Advanced URL translation and redirection
269       (+) mod_userdir ...... Selection of resource directories by username
270       (-) mod_speling ...... Correction of misspelled URLs
271
272      Directory Handling
273       (+) mod_dir .......... Directory and directory default file handling
274       (+) mod_autoindex .... Automated directory index file generation
275
276      Access Control and Authentication
277       (+) mod_access ....... Access Control (user, host, network)
278       (+) mod_auth ......... HTTP Basic Authentication (user, passwd)
279       (-) mod_auth_dbm ..... HTTP Basic Authentication via Unix NDBM files
280       (-) mod_auth_db ...... HTTP Basic Authentication via Berkeley-DB files
281       (-) mod_auth_anon .... HTTP Basic Authentication for Anonymous-style users
282       (-) mod_digest ....... HTTP Digest Authentication
283
284      HTTP response
285       (-) mod_headers ...... Arbitrary HTTP response headers (configured)
286       (-) mod_cern_meta .... Arbitrary HTTP response headers (CERN-style files)
287       (-) mod_expires ...... Expires HTTP responses 
288       (+) mod_asis ......... Raw HTTP responses 
289
290      Scripting
291       (+) mod_include ...... Server Side Includes (SSI) support
292       (+) mod_cgi .......... Common Gateway Interface (CGI) support
293       (+) mod_cgid ......... Common Gateway Interface (CGI) support for 
294                              multi-threaded MPMs
295       (+) mod_actions ...... Map CGI scripts to act as internal `handlers'
296
297      Internal Content Handlers
298       (+) mod_status ....... Content handler for server run-time status
299       (-) mod_info ......... Content handler for server configuration summary
300
301      Request Logging
302       (+) mod_log_config ... Customizable logging of requests
303       (-) mod_usertrack .... Logging of user click-trails via HTTP Cookies
304
305      Content Management
306       (-) mod_dav .......... WebDAV (RFC 2518) support for Apache
307       (-) mod_dav_fs ....... mod_dav backend to managing filesystem content
308
309      Miscellaneous
310       (+) mod_imap ......... Server-side Image Map support
311       (-) mod_proxy ........ Caching Proxy Module (HTTP, HTTPS, FTP)
312       (-) mod_so ........... Dynamic Shared Object (DSO) bootstrapping
313
314      Experimental
315       (-) mod_mmap_static .. Caching of frequently served pages via mmap()
316
317      Development
318       (-) mod_example ...... Apache API demonstration (developers only)
319
320      MPMs
321           mpmt_pthread ..... Multi-process(dynamic) Multi-threaded(static) 
322                              Unix MPM
323           prefork .......... Preforking Unix MPM
324           perchild ......... Multi-process(static) Multi-threaded(dynamic)
325                              Unix MPM, that allows a User per child process
326
327           winnt ............ Multi-process(1) Multi-threaded Windows MPM
328
329           mpmt_beos ........ Multi-process Multi-threaded Beos MPM
330           beos ............. Multi-process Multi-threaded Beos MPM
331
332           spmt_os2 ......... Single-process Multi-threaded OS/2 MPM
333      _________________________________________________________________________
334                     (+) = enabled  per default [disable with --disable-module]
335                     (-) = disabled per default [enable  with --enable-module ]
336
337      Use the --enable-suexec option to enable the suEXEC feature by
338      building and installing the "suexec" support program.
339
340      CAUTION: FOR DETAILS ABOUT THE SUEXEC FEATURE WE HIGHLY RECOMMEND
341               YOU TO FIRST READ THE DOCUMENT htdocs/manual/suexec.html
342               BEFORE USING THE ABOVE OPTIONS.
343      
344               USING THE SUEXEC FEATURE PROPERLY CAN REDUCE
345               CONSIDERABLY THE SECURITY RISKS INVOLVED WITH ALLOWING
346               USERS TO DEVELOP AND RUN PRIVATE CGI OR SSI
347               PROGRAMS. HOWEVER, IF SUEXEC IS IMPROPERLY CONFIGURED,
348               IT CAN CAUSE ANY NUMBER OF PROBLEMS AND POSSIBLY CREATE
349               NEW HOLES IN YOUR COMPUTER'S SECURITY.  IF YOU AREN'T
350               FAMILIAR WITH MANAGING SETUID ROOT PROGRAMS AND THE
351               SECURITY ISSUES THEY PRESENT, WE HIGHLY RECOMMEND THAT
352               YOU NOT CONSIDER USING SUEXEC AND KEEP AWAY FROM THESE
353               OPTIONS!
354
355      Use the --quiet option to disable all configuration verbose
356      messages.
357  
358
359   4. Building the package
360      --------------------
361      
362      Now you can build the various parts which form the Apache package
363      by simply running the command:
364  
365         $ make 
366  
367      Please be patient here, this takes approximately 2 minutes to
368      complete under a Pentium-166/FreeBSD-2.2 system, dependend on the
369      amount of modules you have enabled.
370
371  
372   5. Installing the package
373      ----------------------
374      
375      Now its time to install the package under the configured
376      installation PREFIX (see --prefix option above) by running:
377  
378         $ make install
379  
380      For the paranoid hackers under us: The above command really
381      installs under prefix _only_, i.e. no other stuff from your
382      system is touched. Even if you upgrade an existing installation
383      your configuration files in PREFIX/conf/ are preserved.
384
385
386   6. Testing the package
387      -------------------
388  
389      Now you can fire up your Apache HTTP server by immediately
390      running:
391  
392         $ PREFIX/bin/apachectl start
393  
394      and then you should be able to request your first document via
395      URL http://localhost/ (when you built and installed Apache as
396      root or at least used the --without-confadjust option) or
397      http://localhost:8080/ (when you built and installed Apache as a
398      regular user). Then stop the server again by running:
399
400         $ PREFIX/bin/apachectl stop
401
402  
403   7. Customizing the package
404      -----------------------
405  
406      Finally you can customize your Apache HTTP server by editing the
407      configuration files under PREFIX/conf/.
408  
409         $ vi PREFIX/conf/httpd.conf
410  
411      Have a look at the Apache manual under docs/manual/ or
412      http://httpd.apache.org/docs/ for a complete reference of
413      available configuration directives.
414
415
416   8. Preparing the system
417      --------------------
418
419      Proper operation of a public HTTP server requires at least the
420      following:
421
422      1. A correctly working TCP/IP layer, since HTTP is implemented on
423         top of TCP/IP. Although modern Unix platforms have good
424         networking layers, always make sure you have all official
425         vendor patches referring to the network layer applied.
426
427      2. Accurate time keeping, since elements of the HTTP protocol are
428         expressed as the time of day.  So, it's time to investigate
429         setting some time synchronization facility on your
430         system. Usually the ntpdate or xntpd programs are used for
431         this purpose which are based on the Network Time Protocol
432         (NTP). See the Usenet newsgroup comp.protocols.time.ntp and
433         the NTP homepage at http://www.eecis.udel.edu/~ntp/ for more
434         details about NTP software and public time servers.
435
436
437   9. Contacts
438      --------
439
440      o If you want to be informed about new code releases, bug fixes,
441        security fixes, general news and information about the Apache
442        server subscribe to the apache-announce mailing list as
443        described under http://httpd.apache.org/announcelist.html
444
445      o If you want freely available support for running Apache please
446        join the Apache user community by subscribing at least to the
447        following USENET newsgroup: comp.infosystems.www.servers.unix
448
449      o If you want commercial support for running Apache please
450        contact one of the companies and contractors which are listed
451        at http://httpd.apache.org/info/support.cgi
452
453      o If you have a concrete bug report for Apache please go to the
454        Apache Group Bug Database and submit your report:
455        http://httpd.apache.org/bug_report.html
456
457      o If you want to participate in actively developing Apache please
458        subscribe to the `new-httpd' mailing list as described at
459        http://www.apache.org/foundation/mailinglists.html
460
461      Thanks for running Apache.
462
463                                           The Apache Group
464                                           http://www.apache.org/