GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Apache::Defaults(3) User Contributed Perl Documentation Apache::Defaults(3)

Apache::Defaults - Get default settings for Apache httpd daemon

    $x = new Apache::Defaults;
    print $x->name;
    print $x->version;
    print $x->server_root;
    print $x->server_config;
    print $x->built;
    print $x->architecture;
    print $x->MPM;
    print $x->defines('DYNAMIC_MODULE_LIMIT');
    print $x->preloaded('cgi_module');

Detects the default settings of the Apache httpd daemon by invoking it with appropriate options and analyzing its output.

    $x = new Apache::Defaults(%attrs);

Detects the settings of the apache server and returns the object representing them. Attributes (%attrs) are:

"server"
Full pathname of the httpd binary to inspect. The argument can also be a reference to the list of possible pathnames. In this case, the first of them that exists on disk and has executable privileges will be used. Full command line can also be used, e.g.:

    server => '/usr/sbin/httpd -d /etc/httpd'
    

The default used in the absense of this attribute is:

    [ '/usr/sbin/apachectl', '/usr/sbin/httpd', '/usr/sbin/apache2' ]
    

The use of apachectl is preferred over directly invoking httpd daemon, because the apache configuration file might contain referenmces to environment variables defined elsewhere, which will cause httpd to fail. apachectl takes care of this by including the file with variable definitions prior to calling httpd. See also "environ", below.

"environ"
Name of the shell script that sets the environment for httpd invocation. Usually, this is the same script that is sourced by apachectl prior to passing control over to httpd. This option provides another solution to the environment problem mentioned above. E.g.:

    $x = new Apache::Defaults(environ => /etc/apache2/envvars)
    
"on_error"
Controls error handling. Allowed values are "croak" and "return". If the value is "croak" (the default), the method will croak if an error occurs. If set to "return", the constructor will return a valid object. The httpd exit status and diagnostics emitted to the stderr will be available via the status and error methods.

    $x = new Apache::Defaults(on_error => 'return');
    if ($x->status) {
        die $x->error;
    }

Returns the status of the last httpd invocation (i.e. the value of the $? perl variable after waitpid). The caller should inspect this value, after constructing an Apache::Defaults object with the "on_error" attribute set to "return".

Returns additional diagnostics if $x->status != 0. Normally, these are diagnostic messages that httpd printed to standard error before termination.

    $s = $x->server;

Returns the pathname of the httpd binary.

    @cmd = $x->server_command;

Returns the full command line of the httpd binary.

    $s = $x->server_config;

Returns the full pathname of the server configuration file.

    $hashref = $x->environ;

Returns a reference to the environment used when invoking the server.

    $s = $x->name;

Returns server implementation name (normally "Apache").

    $v = $x->version;

Returns server version (as string).

    $s = $x->platform;

Platform (distribution) on which the binary is compiled.

Architecture for which the server is built.

    $d = $x->built;

Returns a DateTime object, representing the time when the server was built.

APR tools with which the server is loaded.

APR tools with which the server is compiled.

MPM module loaded in the configuration.

True if the MPM is threaded.

True if the MPM is forked.

    @names = $x->defines;

Returns the list of symbolic names defined during the compilation. The names are in lexical order.

    @values = $x->defines(@names);

Returns values of the named defines.

    $s = $x->server_root;

Returns default server root directory. This is equivalent to

    $x->defines('HTTPD_ROOT');

    @ids = $x->preloaded;

Returns the list of the preloaded module identifiers, in lexical order.

    @sources = $x->preloaded(@ids);

Returns the list of module source names for the given source identifiers. For non-existing identifiers, undef is returned.

GPLv3+: GNU GPL version 3 or later, see <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Sergey Poznyakoff <gray@gnu.org>
2021-02-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.