1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
APACHE CONFIGURATION
Apache 1.3 Autoconf-style Interface (APACI)
===========================================
APACI is an Autoconf-style interface for the Unix side of the Apache 1.3
HTTP server source distribution. It is actually not GNU Autoconf-based, i.e.
the GNU Autoconf package itself is not used. Instead APACI just provides a
similar batch configuration interface and a corresponding out-of-the-box
build and installation procedure.
The basic goal is to provide the following commonly known and expected
procedure for out-of-the-box building and installing a package like Apache:
$ gunzip <apache_1.3.X.tar.gz | tar xvf -
$ ./configure --prefix=PREFIX [...]
$ make
$ make install
NOTE: PREFIX is not the string "PREFIX". Instead use the Unix
filesystem path under which Apache should be installed. For
instance use "/usr/local/apache" for PREFIX above.
After these steps Apache 1.3 is completely installed under PREFIX and
already initially configured, so you can immediately fire it up the first
time via
$ PREFIX/sbin/apachectl start
to get your first success event with the Apache HTTP server without having
to fiddle around with various options for a long time. On the other hand
APACI provides a lot of options to adjust the build and installation process
for flexibly customizing your Apache installation. So, APACI provides both:
Out-of-the-box building and installation for the impatient and powerful
custom configuration for the experts.
Detailed Description
====================
For a detailed description of all available APACI options please read the
file INSTALL or at least run the command
$ ./configure --help
for a compact one-page summary of the possibilities you have.
Alternatively, you can start from the following examples.
Examples
========
In the following typical or even interesting variants of the available
configuration steps are shown to give you an impression what APACI is good
for and what APACI can do for you to be able to install Apache without much
pain.
Standard installation
---------------------
The standard installation is done via
$ ./configure --prefix=/path/to/apache
$ make
$ make install
This builds Apache 1.3 with the standard set of enabled modules
(automatically determined from src/Configuration.tmpl) with an Apache 1.2
conforming subdirectory layout under /path/to/apache. For using the GNU
style subdirectory layout additionally use the --with-layout=GNU option:
$ ./configure --with-layout=GNU --prefix=/path/to/apache
$ make
$ make install
If you are not sure which directory layout you want, you can use the
--show-layout option. It displays the directory layout which would be used
but immediately exits without configuring anything. Examples:
$ ./configure --show-layout
$ ./configure --prefix=/path/to/apache --show-layout
$ ./configure --with-layout=GNU --prefix=/path/to/apache --show-layout
Additionally if some of the shown paths still don't fit for your particular
situation, you can use the --bindir, --sbindir, --libexecdir, --mandir,
--sysconfdir, --datadir, --localstatedir, --runtimedir, --logfiledir and
--proxycachedir options to adjust the layout as required. Always check with
--show-layout the resulting directory layout which would be used for
installation.
suEXEC support
--------------
The suEXEC feature of Apache provides a mechanism to run CGI and SSI
programs under the user and group id of the owner of the program. It is
neither installed nor configured per default for Apache 1.3, but APACI
supports it with additional options:
$ ./configure --prefix=/path/to/apache \
--enable-suexec \
--suexec-caller=www \
--suexec-userdir=.www \
--suexec-docroot=/path/to/root/dir \
--suexec-logfile=/path/to/logdir/suexec_log \
--suexec-uidmin=1000 \
--suexec-gidmin=1000 \
--suexec-safepath="/bin:/usr/bin"
$ make
$ make install
This automatically builds and installs Apache 1.3 with suEXEC support for
the caller uid "www" and the user's homedir subdirs ".www". The default
paths for --suexec-docroot is the value from the --datadir option with
the suffix "/htdocs" and the --logfiledir value with the suffix
"/suexec_log" for the --suexec-logfile option. The access paths for the
suexec program are automatically adjusted and the suexec program is
installed, so Apache can find it on startup.
Building multiple platforms in parallel
---------------------------------------
When you want to compile Apache for multiple platforms in parallel it is
useful to share the source tree (usually via NFS, AFS or DFS) but build the
object files in separated subtrees. This can be accomplished by letting
APACI create a source shadow tree and build there:
$ ./configure --shadow --prefix=/path/to/apache
$ make
$ make install
Then APACI first determines the GNU platform triple, creates a shadow tree
in src.<gnu-triple> plus corresponding Makefile.<gnu-triple> and then
performs the complete build process inside this shadow tree.
Dynamic Shared Object (DSO) support
-----------------------------------
Apache 1.3 supports building modules as shared objects on all major Unix
platforms (see section "Supported Platforms" in document
htdocs/manual/dso.html for details). APACI has a nice way of enabling the
building of DSO-based modules and automatically installing them:
$ ./configure --prefix=/path/to/apache \
--enable-module=rewrite \
--enable-shared=rewrite
$ make
$ make install
This builds and installs Apache with the default configuration except that
it adds the mod_rewrite module and automatically builds and installs it as a
DSO, so it is optionally available for loading under runtime. To make your
life even more easy APACI additionally inserts a corresponding `LoadModule'
line into the httpd.conf file in the installation phase.
APACI also supports a variant of the --enable-shared option:
$ ./configure --prefix=/path/to/apache \
--enable-shared=max
$ make
$ make install
This enables shared object building for the maximum of modules, i.e. all
enabled modules (--enable-module or the default set) except for mod_so
itself (the bootstrapping module for DSO support). So, to build a
full-powered Apache with maximum flexibility by building and installing most
of the modules, you can use:
$ ./configure --prefix=/path/to/apache \
--enable-module=most \
--enable-shared=max
$ make
$ make install
This first enables most of the modules (all modules except some problematic
ones like mod_auth_db which needs third party libraries not available on
every platform or mod_log_agent and mod_log_referer which are deprecated)
and then enables DSO support for all of them. This way you get all these
modules installed and you then can decide under runtime (via the
`LoadModule') directives which ones are actually used. This is especially
useful for vendor package maintainers to provide a flexible Apache package.
On-the-fly added additional/private module
------------------------------------------
For Apache there are a lot of modules flying around on the net which solve
particular problems. For a good reference see the Apache Module Registory at
http://modules.apache.org/ and the Apache Group's contribution directory at
http://www.apache.org/dist/contrib/modules/. These modules usually come in a
file named mod_foo.c. APACI supports adding these sources on-the-fly to the
build process:
$ ./configure --prefix=/path/to/apache \
--add-module=/path/to/mod_foo.c
$ make
$ make install
This automatically copies mod_foo.c to src/modules/extra/, activates it in
the configuration and builds Apache with it. A very useful way is to combine
this with the DSO support:
$ ./configure --prefix=/path/to/apache \
--add-module=/path/to/mod_foo.c \
--enable-shared=foo
$ make
$ make install
This builds and installs Apache with the default set of modules, but
additionally builds mod_foo as a DSO and adds a `LoadModule' line to the
httpd.conf file to activate it for loading under runtime.
Apache and mod_perl
-------------------
The Apache/Perl integration project (http://perl.apache.org/) from Doug
MacEachern <dougm@perl.apache.org> is a very powerful approach to integrate
a Perl 5 interpreter into the Apache HTTP server both for running Perl
programs and for programming Apache modules in Perl. The distribution
mod_perl-1.XX.tar.gz can be found on http://perl.apache.org/src/. Here is
how you can build and install Apache with mod_perl:
$ gunzip <apache_1.3.X.tar.gz | tar xvf -
$ gunzip <mod_perl-1.XX.tar.gz | tar xvf -
$ cd mod_perl-1.XX
$ perl Makefile.PL APACHE_SRC=../apache_1.3.X/src \
DO_HTTPD=1 USE_APACI=1 \
[EVERYTHING=1 ...]
$ make
$ make install
[optionally you now have the chance to prepare or add more
third-party modules to the Apache source tree]
$ cd ../apache_1.3.X
$ ./configure --prefix=/path/to/apache \
--activate-module=src/modules/perl/libperl.a \
[--enable-shared=perl]
$ make
$ make install
Apache and PHP
--------------
The PHP language (http://www.php.net) is an HTML-embedded scripting language
which can be directly integrated into the Apache HTTP server for powerful HTML
scripting. The package can be found at http://www.php.net/downloads.php
1. How you can install Apache with a statically linked PHP:
$ gunzip <apache_1.3.X.tar.gz | tar xvf -
$ gunzip <php-3.0.tar.gz | tar xvf -
$ cd apache_1.3.X
$ ./configure --prefix=/path/to/apache
$ cd ../php-3.0
$ ./configure --with-apache=../apache_1.3.X
$ make
$ make install
[optionally you now have the chance to prepare or add more
third-party modules to the Apache source tree]
$ cd ../apache_1.3.X
$ ./configure --prefix=/path/to/apache \
--activate-module=src/modules/php3/libphp3.a
$ make
$ make install
2. You can also use APXS:
$ cd apache-1.3.X
$ ./configure --prefix=/path/to/apache --enable-shared=max
$ make
$ make install
$ cd php-3.0.X
$ ./configure --with-apxs=/path/to/apache/bin/apxs \
--with-config-file-path=/path/to/apache
$ make
$ make install
At this point don't forget to edit your conf/httpd.conf file and
make sure the file contains the line for PHP 3:
AddType application/x-httpd-php3 .php3
Or this line for PHP 4:
AddType application/x-httpd-php .php
Then restart your server.
|