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