summaryrefslogtreecommitdiff
path: root/lib/Apache/Defaults.pm
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-02-24 11:13:25 +0200
committerSergey Poznyakoff <gray@gnu.org>2018-02-24 11:13:25 +0200
commitd9bdc9cfcb2f10ea3642b6150e1c4fddbf9facdb (patch)
treee8fc51d793af7b0b15ca3428a206d22544f82e4a /lib/Apache/Defaults.pm
parent8147f2b3c96bc6b387f0aa5a7d195de233215484 (diff)
downloadapache-defaults-d9bdc9cfcb2f10ea3642b6150e1c4fddbf9facdb.tar.gz
apache-defaults-d9bdc9cfcb2f10ea3642b6150e1c4fddbf9facdb.tar.bz2
Update docs
Diffstat (limited to 'lib/Apache/Defaults.pm')
-rw-r--r--lib/Apache/Defaults.pm35
1 files changed, 24 insertions, 11 deletions
diff --git a/lib/Apache/Defaults.pm b/lib/Apache/Defaults.pm
index b980333..70d5385 100644
--- a/lib/Apache/Defaults.pm
+++ b/lib/Apache/Defaults.pm
@@ -9,7 +9,7 @@ use Text::ParseWords;
use Symbol 'gensym';
use Carp;
-our $VERSION = '0.10';
+our $VERSION = '1.00';
sub new {
my $class = shift;
@@ -176,6 +176,15 @@ my @ATTRIBUTES = qw(status error
sub server_root { shift->defines('HTTPD_ROOT') }
+sub server_config {
+ my $self = shift;
+ my $conf = $self->defines('SERVER_CONFIG_FILE');
+ if ($conf && !File::Spec->file_name_is_absolute($conf)) {
+ $conf = File::Spec->catfile($self->server_root, $conf);
+ }
+ return $conf;
+}
+
sub defines {
my $self = shift;
if (@_) {
@@ -339,6 +348,7 @@ Apache::Defaults - Get default settings for Apache httpd daemon
print $x->name;
print $x->version;
print $x->server_root;
+ print $x->server_config;
print $x->built;
print $x->architecture;
print $x->MPM;
@@ -377,13 +387,13 @@ The default used in the absense of this attribute is:
=item C<environ>
Name of the shell script that sets the environment for B<httpd> invocation.
-For some obscure reason, B<httpd> attempts to read its configuration file
-even if invoked with the B<-V> option (which is intended to print the version
-and build parameters of the daemon). It will fail if its configuration refers
-to the environment variables, defined elsewhere. This situation is quite
-common in Debian-based distributions, which define the environment variables
-in file F</etc/apache2/envvars>. This attribute is intended to cope with
-such problems, e.g.:
+
+If invoked with the B<-V> option, B<httpd> attempts to read its configuration
+file and will fail if the latter contains references to the environment
+variables defined elsewhere. This is quite common in Debian-based
+distributions, which define the environment variables in file
+F</etc/apache2/envvars>. To avoid such failures, use the C<environ> attribute,
+e.g.:
$x = new Apache::Defaults(environ => /etc/apache2/envvars)
@@ -397,9 +407,6 @@ will be available via the B<status> and B<error> methods.
=back
-The method will I<croak> if an error occurs (e.g. the server binary
-is not found or exits with failure).
-
=head2 status
$x = new Apache::Defaults(on_error => 'return');
@@ -430,6 +437,12 @@ Returns the pathname of the B<httpd> binary.
Returns the full command line of the B<httpd> binary.
+=head2 server_config
+
+ $s = $x->server_config;
+
+Returns the full pathname of the server configuration file.
+
=head2 environ
$hashref = $x->environ;

Return to:

Send suggestions and report system problems to the System administrator.