This file is indexed.

/usr/lib/perl5/Apache2/Module.pm is in libapache2-mod-perl2 2.0.5-5ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# 
# /*
#  * *********** WARNING **************
#  * This file generated by ModPerl::WrapXS/0.01
#  * Any changes made here will be lost
#  * ***********************************
#  * 01: lib/ModPerl/Code.pm:709
#  * 02: lib/ModPerl/WrapXS.pm:626
#  * 03: lib/ModPerl/WrapXS.pm:1175
#  * 04: Makefile.PL:424
#  * 05: Makefile.PL:326
#  * 06: Makefile.PL:57
#  */
# 


package Apache2::Module;

use strict;
use warnings FATAL => 'all';



use Apache2::XSLoader ();
our $VERSION = '2.000005';
Apache2::XSLoader::load __PACKAGE__;



1;
__END__

=head1 NAME

Apache2::Module - Perl API for creating and working with Apache modules




=head1 Synopsis

  use Apache2::Module ();
  
  #Define a configuration directive
  my @directives = (
      {
          name => 'MyDirective',
      }
  );
  
  Apache2::Module::add(__PACKAGE__, \@directives);
  
  # iterate over the whole module list
  for (my $modp = Apache2::Module::top_module(); $modp; $modp = $modp->next) {
      my $name                  = $modp->name;
      my $index                 = $modp->module_index;
      my $ap_api_major_version  = $modp->ap_api_major_version;
      my $ap_api_minor_version  = $modp->ap_api_minor_version;
      my $commands              = $modp->cmds;
  }
  
  # find a specific module
  my $module = Apache2::Module::find_linked_module('mod_ssl.c');
  
  # remove a specific module
  $module->remove_loaded_module();
  
  # access module configuration from a directive
  sub MyDirective {
      my ($self, $parms, $args) = @_;
      my  $srv_cfg = Apache2::Module::get_config($self, $parms->server);
      [...]
  }
  
  # test if an Apache module is loaded
  if (Apache2::Module::loaded('mod_ssl.c')) {
      [...]
  }
  
  # test if a Perl module is loaded
  if (Apache2::Module::loaded('Apache2::Status')) {
      [...]
  }







=head1 Description

C<Apache2::Module> provides the Perl API for creating and working with
Apache modules

See L<Apache Server Configuration Customization in
Perl|docs::2.0::user::config::custom>.





=head1 API

C<Apache2::Module> provides the following functions and/or methods:





=head2 C<add>

Add a module's custom configuration directive to Apache.

  Apache2::Module::add($package, $cmds);

=over 4

=item arg1: C<$package> ( string )

the package of the module to add

=item arg2: C<$cmds> ( ARRAY of HASH refs )

the list of configuration directives to add

=item ret: no return value

=item since: 2.0.00

=back

See also L<Apache Server Configuration Customization in
Perl|docs::2.0::user::config::custom>.







=head2 C<ap_api_major_version>

Get the httpd API version this module was build against, B<not> the
module's version.

  $major_version = $module->ap_api_major_version();

=over 4

=item obj: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item ret: C<$major_version> ( integer )

=item since: 2.0.00

=back

This methid is used to check that module is compatible with this
version of the server before loading it.






=head2 C<ap_api_minor_version>

Get the module API minor version.

  $minor_version = $module->ap_api_minor_version();

=over 4

=item obj: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item ret: C<$minor_version> ( integer )

=item since: 2.0.00

=back

C<ap_api_minor_version()> provides API feature milestones.

It's not checked during module init.





=head2 C<cmds>

Get the C<L<Apache2::Command|docs::2.0::api::Apache2::Command>> object,
describing all of the directives this module defines.

  $command = $module->cmds();

=over 4

=item obj: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item ret: C<$command>
( C<L<Apache2::Command object|docs::2.0::api::Apache2::Command>> )

=item since: 2.0.00

=back







=head2 C<get_config>

Retrieve a module's configuration. Used by configuration directives.

  $cfg = Apache2::Module::get_config($class, $server, $dir_config);
  $cfg = Apache2::Module::get_config($class, $server);
  $cfg =          $self->get_config($server, $dir_config);
  $cfg =          $self->get_config($server);

=over 4

=item obj: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item arg1: C<$class> ( string )

The Perl package this configuration is for

=item arg2: C<$server>
( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )

The current server, typically
C<L<$r-E<gt>server|docs::2.0::api::Apache2::ServerUtil>> or
C<L<$parms-E<gt>server|docs::2.0::api::Apache2::CmdParms>>.

=item opt arg3: C<$dir_config>
( C<L<Apache2::ConfVector object|docs::2.0::api::Apache2::RequestRec/C_per_dir_config_>> )

By default, the configuration returned is the server level one. To
retrieve the per directory configuration, use
C<L<$r-E<gt>per_dir_config|docs::2.0::api::Apache2::RequestRec>> as a
last argument.

=item ret: C<$cfg> (HASH reference)

A reference to the hash holding the module configuration data.

=item since: 2.0.00

=back

See also L<Apache Server Configuration Customization in
Perl|docs::2.0::user::config::custom>.






=head2 C<find_linked_module>

Find a module based on the name of the module

  $module = Apache2::Module::find_linked_module($name);

=over 4

=item arg1: C<$name> ( string )

The name of the module ending in C<.c>

=item ret: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

The module object if found, C<undef> otherwise.

=item since: 2.0.00

=back

For example:

  my $module = Apache2::Module::find_linked_module('mod_ssl.c');






=head2 C<loaded>

Determine if a certain module is loaded

  $loaded = Apache2::Module::loaded($module);

=over 4

=item name: C<$module> ( string )

The name of the module to search for.

If C<$module> ends with C<.c>, search all the modules, statically
compiled and dynamically loaded.

If C<$module> ends with C<.so>, search only the dynamically loaded
modules.

If C<$module> doesn't contain a C<.>, search the loaded Perl modules
(checks C<%INC>).

=item ret: C<$loaded> ( boolean )

Returns true if the module is loaded, false otherwise.

=item since: 2.0.00

=back

For example, to test if this server supports ssl:

  if (Apache2::Module::loaded('mod_ssl.c')) {
      [...]
  }

To test is this server dynamically loaded mod_perl:

  if (Apache2::Module::loaded('mod_perl.so')) {
      [...]
  }

To test if C<L<Apache2::Status|docs::2.0::api::Apache2::Status>> is
loaded:

  if (Apache2::Module::loaded('Apache2::Status')) {
      [...]
  }







=head2 C<module_index>

Get the index to this modules structures in config vectors.

  $index = $module->module_index();

=over 4

=item obj: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item ret: C<$index> ( integer )

=item since: 2.0.00

=back





=head2 C<name>

Get the name of the module's I<.c> file

  $name = $module->name();

=over 4

=item obj: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item ret: C<$name> ( string )

=item since: 2.0.00

=back

For example a mod_perl module, will return: I<mod_perl.c>.








=head2 C<next>

Get the next module in the list, C<undef> if this is the last module
in the list.

  $next_module = $module->next();

=over 4

=item obj: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item ret: C<$next_module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item since: 2.0.00

=back








=head2 C<remove_loaded_module>

Remove a module from the list of loaded modules permanently.

  $module->remove_loaded_module();

=over 4

=item obj: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item ret: no return value

=item since: 2.0.00

=back






=head2 C<top_module>

Returns the first module in the module list. Useful to start a
module iteration.

  $module = Apache2::Module::top_module();

=over 4

=item ret: C<$module>
( C<L<Apache2::Module object|docs::2.0::api::Apache2::Module>> )

=item since: 2.0.00

=back





=head1 See Also

L<mod_perl 2.0 documentation|docs::2.0::index>.




=head1 Copyright

mod_perl 2.0 and its core modules are copyrighted under
The Apache Software License, Version 2.0.




=head1 Authors

L<The mod_perl development team and numerous
contributors|about::contributors::people>.

=cut