~ubuntu-branches/ubuntu/edgy/libapache2-mod-perl2/edgy

« back to all changes in this revision

Viewing changes to docs/user/install/install.pod

  • Committer: Bazaar Package Importer
  • Author(s): Andres Salomon
  • Date: 2005-08-12 01:40:38 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050812014038-gjigefs55pqx4qc8
Tags: 2.0.1-3
Grr.  Really include perl.conf file; it got lost due to diff not
wanting to add an empty file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
Apache 2.0 is required. mod_perl 2.0 B<does not> work with Apache 1.3.
28
28
 
 
29
L<Dynamic|/MP_USE_DSO> (DSO) mod_perl build requires Apache 2.0.47 or
 
30
higher. L<Static|/MP_USE_STATIC> build requires Apache 2.0.51 or
 
31
higher.
 
32
 
29
33
=item * Perl
30
34
 
31
35
=over
32
36
 
33
 
=item prefork MPM
 
37
=item Prefork MPM
34
38
 
35
 
Requires at least Perl version 5.6.0. But we strongly suggest to use
36
 
at least version 5.6.1, since 5.6.0 is quite buggy. The only reason we
37
 
support 5.6.0 is for development reasons (so the build can be tested
38
 
on systems having only 5.6.0) and those users who want to give it a
39
 
try, without first having the hassle of updating their perl version.
 
39
Requires at least Perl version 5.6.1.
40
40
 
41
41
You don't need to have threads-support enabled in Perl. If you do have
42
42
it, it B<must> be I<ithreads> and not I<5005threads>! If you have:
49
49
on some platforms it's unstable (e.g., FreeBSD), so don't enable it
50
50
unless you really need it.
51
51
 
52
 
=item threaded MPMs
 
52
=item Threaded MPMs
53
53
 
54
54
Require at least Perl version 5.8.0 with ithreads support
55
55
built-in. That means that it should report:
60
60
 
61
61
If that's not what you see rebuild Perl with C<-Dusethreads>.
62
62
 
 
63
=item Static prefork build
 
64
 
 
65
Perl with ithreads support version 5.6.1 or higher
 
66
 
 
67
Perl without ithreads support version 5.8.2 or higher
 
68
 
 
69
=item Static non-prefork build
 
70
 
 
71
Perl with ithreads support version 5.8.0 or higher
 
72
 
63
73
=item threads.pm
64
74
 
65
75
If you want to run applications that take benefit of Perl's
83
93
 
84
94
=over
85
95
 
86
 
=item CGI.pm 3.01
 
96
=item CGI.pm 3.08
87
97
 
88
98
=item Compress::Zlib 1.09
89
99
 
90
100
=back
91
101
 
 
102
Though the easiest way to satisfy all the dependencies is to install
 
103
C<Bundle::Apache2> available from CPAN.
92
104
 
93
105
=back
94
106
 
95
107
 
 
108
 
 
109
 
 
110
 
 
111
 
 
112
 
96
113
=head2 Downloading Stable Release Sources
97
114
 
98
115
If you are going to install mod_perl on a production site, you want to
126
143
 
127
144
 
128
145
 
129
 
=head2 Getting Bleeding Edge CVS Sources
 
146
=head2 Getting Bleeding Edge Sources
130
147
 
131
 
If you really know what you are doing you can use the cvs versions of
132
 
the components. Chances are that you don't want to them on a
 
148
If you really know what you are doing you can use the cvs/svn versions
 
149
of the components. Chances are that you don't want to them on a
133
150
production site. You have been warned!
134
151
 
135
152
=over
136
153
 
137
154
=item Perl
138
155
 
139
 
CVS Perl (aka bleadperl or bleedperl) is only generally available
140
 
through an rsync repository maintained by ActiveState:
 
156
The cutting edge version of Perl (aka bleadperl or bleedperl) is only
 
157
generally available through an rsync repository maintained by
 
158
ActiveState:
141
159
 
142
160
  # (--delete to ensure a clean state)
143
161
  % rsync -acvz --delete --force \
158
176
 
159
177
=item Apache
160
178
 
161
 
To download the cvs version of httpd-2.0 and bring it to the same
162
 
state of the distribution package, execute the following commands:
163
 
 
164
 
  % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login
165
 
 
166
 
The password is "anoncvs". Now extract the C<APACHE_2_0_BRANCH> branch
167
 
of httpd-2.0.xx. If you don't use this branch you will get
168
 
httpd-2.1.xx which at this moment is not supported. Similarly you need
169
 
C<APR_0_9_BRANCH> and C<APU_0_9_BRANCH> cvs branches for apr and
170
 
apr-util projects, respectively.
171
 
 
172
 
  % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co \
173
 
    -r APACHE_2_0_BRANCH -d httpd-2.0 httpd-2.0
174
 
  % cd httpd-2.0/srclib
175
 
  % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co \
176
 
    -r APR_0_9_BRANCH -d apr apr
177
 
  % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co \
178
 
    -r APU_0_9_BRANCH -d apr-util apr-util
179
 
  % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co \
180
 
    -r APU_0_9_BRANCH -d apr-iconv apr-iconv
181
 
  % cd ..
182
 
  % ./buildconf
183
 
 
184
 
Once extracted, whenever you want to sync with the latest httpd-2.0
185
 
version and rebuild, run:
186
 
 
187
 
  % cd httpd-2.0
188
 
  % cvs up -dP
189
 
  % make distclean && ./buildconf
 
179
See L<Development mod_perl 2.0 Source
 
180
Distribution|download::source/Development_mod_perl_2_0_Source_Distribution>.
190
181
 
191
182
=back
192
183
 
208
199
 
209
200
  % ./Configure -des -Dusethreads
210
201
 
 
202
Most likely you don't want perl-support for threads enabled, in which
 
203
case pass: C<-Uusethreads> instead of C<-Dusethreads>.
 
204
 
211
205
If you want to debug mod_perl segmentation faults, add the
212
206
following I<./Configure> options:
213
207
 
222
216
 
223
217
=head3 Apache
224
218
 
 
219
You need to have Apache built and installed prior to building
 
220
mod_perl, only if you intend build a DSO mod_perl. If you intend to
 
221
build a statically linked Apache+mod_perl, you only need to have the
 
222
Apache source available (mod_perl will build and install Apache for
 
223
you), you should skip this step.
 
224
 
225
225
  % cd httpd-2.x.xx
226
226
  % ./configure --prefix=$HOME/httpd/prefork --with-mpm=prefork
227
227
  % make && make install
270
270
 
271
271
=item Stable Release
272
272
 
273
 
Download from: I<http://perl.apache.org/download/>
 
273
Download from I<http://perl.apache.org/download/> or your favorite
 
274
CPAN mirror.
274
275
 
275
276
This direct link which symlinks to the latest release should work too:
276
277
I<http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz>.
285
286
 
286
287
or an equivalent command.
287
288
 
288
 
=item CVS Bleeding-Edge Version
289
 
 
290
 
To download the cvs version of modperl-2.0 execute the following
291
 
commands:
292
 
 
293
 
  % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login
294
 
 
295
 
The password is "anoncvs".
296
 
 
297
 
  % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co modperl-2.0
298
 
 
299
 
You can also try the latest CVS snapshot:
300
 
 
301
 
http://cvs.apache.org/snapshots/modperl-2.0/
 
289
=item Development Version
 
290
 
 
291
See L<Development mod_perl 2.0 Source
 
292
Distribution|download::source/Development_mod_perl_2_0_Source_Distribution>.
302
293
 
303
294
=back
304
295
 
306
297
 
307
298
=head2 Configuring mod_perl
308
299
 
309
 
Before you proceed make sure that Apache 2.0 has been built and
310
 
installed. mod_perl B<cannot> be built before that.
 
300
To build mod_perl, you B<must> also use the same compiler that Perl
 
301
was built with. You can find that out by running C<perl -V> and
 
302
looking at the C<Compiler:> section.
311
303
 
312
304
Like any other Perl module, mod_perl is configured via the
313
305
I<Makefile.PL> file, but requires one or more configuration options:
315
307
  % cd modperl-1.99_xx
316
308
  % perl Makefile.PL <options>
317
309
 
318
 
where I<options> is an optional list of (key,value) pairs.
 
310
where I<options> is an optional list of key/value pairs.  These
 
311
options can include all the usual options supported by
 
312
C<ExtUtils::MakeMaker> (e.g., C<PREFIX>, C<LIB>, etc.).
319
313
 
320
314
The following sections give the details about all the available
321
 
options, but let's mention first the most important ones.
322
 
 
323
 
If you want to have mod_perl 1.0 and 2.0 installed under the same perl
324
 
tree you need to enable C<L<MP_INST_APACHE2|/MP_INST_APACHE2>>:
325
 
 
326
 
  % perl Makefile.PL MP_INST_APACHE2=1 <other options>
 
315
options, but let's mention first an important one.
 
316
 
 
317
Configuration options are discussed in L<Build
 
318
Options|/mod_perl_Build_Options>.
 
319
 
 
320
 
 
321
 
 
322
=head3 Dynamic mod_perl
 
323
 
 
324
Before you proceed, make sure that Apache 2.0 has been built and
 
325
installed. mod_perl B<cannot> be built before that.
327
326
 
328
327
It seems that most users use pre-packaged Apache installation, most of
329
328
which tend to spread the Apache files across many directories
333
332
option, which should be set to a full path to the C<apxs>
334
333
executable. For example:
335
334
 
336
 
  % perl Makefile.PL MP_INST_APACHE2=1 MP_APXS=/path/to/apxs
 
335
  % perl Makefile.PL MP_APXS=/path/to/apxs
337
336
 
338
337
For example RedHat Linux system installs the C<httpd> binary, the
339
338
C<apxs> and C<apr-config> scripts (the latter two are needed to build
340
339
mod_perl) all in different locations, therefore they configure
341
340
mod_perl 2.0 as:
342
341
 
343
 
  % perl Makefile.PL MP_INST_APACHE2=1 MP_APXS=/path/to/apxs \
 
342
  % perl Makefile.PL MP_APXS=/path/to/apxs \
344
343
    MP_APR_CONFIG=/another/path/to/apr-config <other options>
345
344
 
346
345
However a correctly built Apache shouldn't require the
351
350
directory, mod_perl 2.0's build only needs to know the path to that
352
351
directory, passed via the C<L<MP_AP_PREFIX|/MP_AP_PREFIX>> option:
353
352
 
354
 
  % perl Makefile.PL MP_INST_APACHE2=1 MP_AP_PREFIX=$HOME/httpd/prefork
355
 
 
356
 
These and other options are discussed in the following sections.
 
353
  % perl Makefile.PL MP_AP_PREFIX=$HOME/httpd/prefork
 
354
 
 
355
=head3 Static mod_perl
 
356
 
 
357
Before you proceed make sure that Apache 2.0 has been downloaded and
 
358
extracted. mod_perl B<cannot> be built before that.
 
359
 
 
360
If this is an svn checkout and not an official distribution tarball,
 
361
you need to first run:
 
362
 
 
363
  % cd httpd-2.0
 
364
  % ./buildconf
 
365
 
 
366
To enable statically linking mod_perl into Apache, use the
 
367
C<L<MP_USE_STATIC|/MP_USE_STATIC>> flag like this:
 
368
 
 
369
  % perl Makefile.PL MP_USE_STATIC=1 \
 
370
    MP_AP_PREFIX=$HOME/src/httpd-2.x \
 
371
    MP_AP_CONFIGURE="--with-mpm=prefork"
 
372
 
 
373
C<L<MP_AP_PREFIX|/MP_AP_PREFIX>> B<must> point to an extracted Apache
 
374
2.0 source tree.
 
375
 
 
376
This will configure Apache by passing C<L<MP_AP_CONFIGURE|/MP_AP_CONFIGURE>>
 
377
to Apache's F<./configure> script.
 
378
 
 
379
=head2 mod_perl Build Options
357
380
 
358
381
=head3 Boolean Build Options
359
382
 
371
394
 
372
395
=head4 MP_USE_DSO
373
396
 
374
 
Build mod_perl as a DSO (I<mod_perl.so>). This is the default. It'll
375
 
be turned off if C<MP_USE_STATIC=1> is used.
 
397
Build mod_perl as a DSO (I<mod_perl.so>). This is the default.
376
398
 
377
399
=head4 MP_USE_STATIC
378
400
 
379
 
Build static mod_perl (I<mod_perl.a>). This is the default. It'll be
380
 
turned off if C<MP_USE_DSO=1> is used.
381
 
 
382
 
C<MP_USE_DSO> and C<MP_USE_STATIC> are both enabled by default. So
383
 
mod_perl is built once as I<mod_perl.a> and I<mod_perl.so>, but
384
 
afterwards you can choose which of the two to use.
385
 
 
386
 
META: The following is not implemented yet.
387
 
 
388
 
  mod_perl and ends up with a src/modules/perl/mod_perl.{so,a} and
389
 
  src/modules/perl/ldopts.  to link modperl static with httpd, we just
390
 
  need some config.m4 magic to add `ldopts` and mod_perl.a to the build.
391
 
  so one could then build httpd like so:
392
 
  
393
 
  ln -s ~/apache/modperl-2.0/src/modules/perl $PWD/src/modules
394
 
  ./configure --with-mpm=prefork --enable-perl=static ...
395
 
  
396
 
  we not be configuring/building httpd for the user as 1.x attempted.
397
 
  
398
 
  downside is one will need to have configured httpd first, so that
399
 
  headers generated.  so it will probably be more like:
400
 
  
401
 
  ./configure --with-mpm=prefork ...
402
 
  (go build modperl)
403
 
  ./config.nice --enable-perl=static && make
404
 
  
405
 
  we could of course provide a wrapper script todo this, but don't want
406
 
  to have this stuff buried and tangled like it is in 1.x
407
 
 
 
401
Build static mod_perl (I<mod_perl.a>).
408
402
 
409
403
=head4 MP_STATIC_EXTS
410
404
 
411
 
Build C<Apache::*.xs> as static extensions.
 
405
Build C<Apache2::*.xs> as static extensions.
412
406
 
413
407
=head4 MP_USE_GTOP
414
408
 
427
421
 
428
422
=item *
429
423
 
430
 
Deprecated special variable, C<$Apache::__T> won't be available. Use
 
424
Deprecated special variable, C<$Apache2::__T> won't be available. Use
431
425
C<${^TAINT}> instead.
432
426
 
433
427
=item *
439
433
 
440
434
in I<httpd.conf> or:
441
435
 
442
 
  use Apache::Server ();
443
 
  use Apache::ServerUtil ();
444
 
  use Apache::Process ();
445
 
  my $pool = Apache->server->process->pool;
446
 
  push @INC, Apache::Server::server_root_relative($pool, "");
447
 
  push @INC, Apache::Server::server_root_relative($pool, "lib/perl");
 
436
  use Apache2::ServerUtil ();
 
437
  use File::Spec::Functins qw(catfile);
 
438
  push @INC, catfile Apache2::ServerUtil::server_root, "";
 
439
  push @INC, catfile Apache2::ServerUtil::server_root, "lib/perl";
448
440
 
449
441
in I<startup.pl>.
450
442
 
487
479
 
488
480
Enable tracing
489
481
 
490
 
=head4 MP_INST_APACHE2
491
 
 
492
 
Install all the I<*.pm> modules relative to the I<Apache2/> directory.
493
 
 
494
482
 
495
483
=head3 Non-Boolean Build Options
496
484
 
502
490
I</home/httpd/httpd-2.0> as DSO, the default location would be
503
491
I</home/httpd/httpd-2.0/bin/apxs>.
504
492
 
 
493
=head4 MP_AP_CONFIGURE
 
494
 
 
495
The command-line arguments to pass to httpd's configure script.
 
496
 
505
497
=head4 MP_AP_PREFIX
506
498
 
507
499
Apache installation prefix, under which the I<include/> directory with
508
 
Apache C header files can be found. For example if you've have
509
 
installed Apache 2.0 in directory I<\Apache2> on Win32, you should
510
 
use:
 
500
Apache C header files can be found. For example if you've installed
 
501
Apache 2.0 in directory I<\Apache2> on Win32, you should use:
511
502
 
512
503
  MP_AP_PREFIX=\Apache2
513
504
 
527
518
 
528
519
  % t/TEST -httpd /home/stas/httpd/prefork/bin/httpd
529
520
 
 
521
 
 
522
 
 
523
 
 
524
=head4 MP_AP_DESTDIR
 
525
 
 
526
This option exists to make the lives of package maintainers easier. If
 
527
you aren't a package manager you should not need to use this option.
 
528
 
 
529
Apache installation destination directory.  This path will be prefixed
 
530
to the installation paths for all Apache-specific files during C<make
 
531
install>.  For instance, if Apache modules are normally installed into
 
532
I</path/to/httpd-2.0/modules/> and C<MP_AP_DESTDIR> is set to
 
533
I</tmp/foo>, the I<mod_perl.so> will be installed in:
 
534
 
 
535
  /tmp/foo/path/to/httpd-2.0/modules/mod_perl.so
 
536
 
 
537
 
 
538
 
530
539
=head4 MP_APR_CONFIG
531
540
 
532
541
If APR wasn't installed under the same file tree as httpd, you may
549
558
 
550
559
  MP_OPTIONS_FILE=~/.my_mod_perl2_opts
551
560
 
552
 
 
 
561
=head4 MP_APR_LIB
 
562
 
 
563
On Win32, in order to build the APR and APR::* modules so as to
 
564
be independent of mod_perl.so, a static library is first built
 
565
containing the needed functions these modules link into. The option
 
566
 
 
567
  MP_APR_LIB=aprext
 
568
 
 
569
specifies the name that this library has. The default used
 
570
is C<aprext>. This option has no effect on platforms other than
 
571
Win32, as they use a different mechanism to accomplish the
 
572
decoupling of APR and APR::* from mod_perl.so.
553
573
 
554
574
=head3 mod_perl-specific Compiler Options
555
575
 
585
605
tracing which makes it easier to tell the reported errors and
586
606
warnings, from the rest of the notifications.
587
607
 
588
 
 
589
608
=head2 Re-using Configure Options
590
609
 
591
610
Since mod_perl remembers what build options were used to build it if
594
613
run:
595
614
 
596
615
  % cd modperl-2.x.xx
597
 
  % perl -MApache::Build -e rebuild
 
616
  % perl -MApache2::Build -e rebuild
598
617
 
599
618
 
600
619