Manual Pages for UNIX Darwin command on man Apache2::ServerRec
MyWebUniversity

Manual Pages for UNIX Darwin command on man Apache2::ServerRec

apacheapmaocdhepemrold-1p0e1r.l1-~12U0:s1:e.mr1o~dC2o:pn:etmrrolid-b2up.te0er.dl2-:P2:e.dr0ol.c2sD::o::cdauopmcies:n::t:Aaaptpaiico:hn:eA2p:a:cSheer2v:e:rSReercv(e3r)Rec(3)

NAME

Apache2::ServerRec - Perl API for Apache server record accessors

SSyynnooppssiiss

use Apache2::ServerRec ();

$errorfname = $s->errorfname();

$isvirtual = $s->isvirtual();

$keepalive = $s->keepalive();

$keepalivemax = $s->keepalivemax();

$keepalivetimeout = $s->keepalivetimeout();

$limitreqfields = $s->limitreqfields();

$limitreqfieldsize = $s->limitreqfieldsize();

$limitreqline = $s->limitreqline();

$path = $s->path();

$hostname = $s->serverhostname();

$port = $s->port();

$serveradmin = $s->serveradmin();

$proc = $s->process();

$timeout = $s->timeout();

$loglevel = $s->loglevel();

my $server = Apache2::ServerUtil->server;

my $vhosts = 0;

for (my $s = $server->next; $s; $s = $s->next) {

$vhosts++;

}

print "There are $vhosts virtual hosts";

DDeessccrriippttiioonn

"Apache2::ServerRec" provides the Perl API for Apache serverrec

object. "Apache2::ServerUtil" provides an extra functionality. AAPPII

"Apache2::ServerRec" provides the following functions and/or methods:

""eerrrroorrffnnaammee"" Get/set the "ErrorLog" file value (e.g. logs/errorlog)

$errorfname = $s->errorfname();

$preverrorfname = $s->errorfname($newerrorfname);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newerrorfname ( string )

If passed, sets the new value for "ErrorLog" Note the limited functionality under threaded MPMs.

ret: $errorfname ( string )

Returns the "ErrorLog" value setting.

If $newerrorfname is passed returns the setting before the

change. since: 2.0.00 ""iissvviirrttuuaall""

Test whether $s is a virtual host object

$isvirtual = $s->isvirtual();

obj: $s ( "Apache2::ServerRec object" )

ret: $isvirtual ( boolean )

Returns the isvirtual setting.

If $newisvirtual is passed, returns the setting before the

change. since: 2.0.00 Example:

print "This is a virtual host" if $s->isvirtual();

""kkeeeeppaalliivvee"" Get/set the "KeepAlive" setting, which specifies whether Apache should accept more than one request over the same connection from the same client.

$keepalive = $s->keepalive();

$prevkeepalive = $s->keepalive($newkeepalive);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newkeepalive ( boolean )

If passed, sets the new keepalive. Note the limited functionality under threaded MPMs.

ret: $keepalive ( boolean )

Returns the "KeepAlive" setting.

If $newkeepalive is passed, returns the setting before the

change. since: 2.0.00 ""kkeeeeppaalliivveemmaaxx"" Get/set the "MaxKeepAliveRequest" setting, which specifies the maximum number of requests Apache will serve over a "KeepAlive" connection.

$keepalivemax = $s->keepalivemax();

$prevkeepalivemax = $s->keepalivemax($newkeepalivemax);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newkeepalivemax ( integer )

If passed, sets the new keepalivemax. Note the limited functionality under threaded MPMs.

ret: $keepalivemax ( integer )

Returns the keepalivemax setting.

If $newkeepalivemax is passed, returns the setting before the

change. since: 2.0.00 ""kkeeeeppaalliivveettiimmeeoouutt"" Get/set the "KeepAliveTimeout" setting (in microsecs), which specifies how long Apache will wait for another request before breaking a "KeepAlive" connection.

$keepalivetimeout = $s->keepalivetimeout();

$prevkeepalivetimeout = $s->keepalivetimeout($newtimeout);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newkeepalivetimeout ( integer )

The expected value is in microsecs. If passed, sets the new "KeepAlive" timeout. Note the limited functionality under threaded MPMs.

ret: $keepalivetimeout ( integer )

Returns the "KeepAlive" timeout value (in microsecs).

If $newtimeout is passed, returns the setting before the change.

since: 2.0.00 ""lliimmiittrreeqqffiieellddss"" Get/set limit on number of request header fields

$limitreqfields = $s->limitreqfields();

$prevlimitreqfields = $s->limitreqfields($newlimitreqfields);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newlimitreqfields ( integer )

If passed, sets the new request headers number limit. Note the limited functionality under threaded MPMs.

ret: $limitreqfields ( integer )

Returns the request headers number limit.

If $newlimitreqfields is passed, returns the setting before the

change. since: 2.0.00 ""lliimmiittrreeqqffiieellddssiizzee"" Get/set limit on size of any request header field

$limitreqfieldsize = $s->limitreqfieldsize();

$prevlimit = $s->limitreqfieldsize($newlimit);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newlimitreqfieldsize ( integer )

If passed, sets the new request header size limit. Note the limited functionality under threaded MPMs.

ret: $limitreqfieldsize ( integer )

Returns the request header size limit.

If $newlimit is passed, returns the setting before the change.

since: 2.0.00 ""lliimmiittrreeqqlliinnee"" Get/set limit on size of the HTTP request line

$limitreqline = $s->limitreqline();

$prevlimitreqline = $s->limitreqline($newlimitreqline);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newlimitreqline ( integer )

If passed, sets the new request line limit value. Note the limited functionality under threaded MPMs.

ret: $limitreqline ( integer )

Returns the request line limit value

If $newlimitreqline is passed, returns the setting before the

change. since: 2.0.00 ""lloogglleevveell"" Get/set the "LogLevel" directive value

$loglevel = $s->loglevel();

$prevloglevel = $s->loglevel($newloglevel);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newloglevel ( "Apache2::Const :log constant" )

If passed, sets a new "LogLevel" value Note the limited functionality under threaded MPMs.

ret: $loglevel ( "Apache2::Const :log constant" )

Returns the "LogLevel" value as a constant.

If $newloglevel is passed, returns the setting before the change.

since: 2.0.00 For example, to set the "LogLevel" value to "info":

use Apache2::Const -compile => qw(LOGINFO);

$s->loglevel(Apache2::Const::LOGINFO);

""nneexxtt"" The next server record in the list (if there are vhosts)

$snext = $s->next();

obj: $s ( "Apache2::ServerRec object" )

ret: $snext ( "Apache2::ServerRec object" )

since: 2.0.00 For example the following code traverses all the servers, starting from the base server and continuing to vhost servers, counting all available vhosts:

use Apache2::ServerRec ();

use Apache2::ServerUtil ();

my $server = Apache2::ServerUtil->server;

my $vhosts = 0;

for (my $s = $server->next; $s; $s = $s->next) {

$vhosts++;

}

print "There are $vhosts virtual hosts";

""ppaatthh"" Get/set pathname for the "ServerPath" setting

$path = $s->path();

$prevpath = $s->path($newpath);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newpath ( string )

If passed, sets the new path. Note the limited functionality under threaded MPMs.

ret: $path ( string )

Returns the path setting.

If $newpath is passed, returns the setting before the change.

since: 2.0.00 ""ppoorrtt"" Get/set the port value

$port = $s->port();

$prevport = $s->port($newport);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newport ( integer )

If passed, sets the new port. Note the limited functionality under threaded MPMs. META: I don't think one should be allowed to change port number after the server has started.

ret: $port ( integer )

Returns the port setting.

If $newport is passed returns the setting before the change.

since: 2.0.00 ""pprroocceessss"" The process this server is running in

$proc = $s->process();

obj: $s ( "Apache2::ServerRec object" )

ret: $proc ( "Apache2::Process object" )

since: 2.0.00 ""sseerrvveerraaddmmiinn"" Get/set the "ServerAdmin" value

$serveradmin = $s->serveradmin();

$prevserveradmin = $s->serveradmin($newserveradmin);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newserveradmin ( string )

If passed, sets the new "ServerAdmin" value. Note the limited functionality under threaded MPMs.

ret: $serveradmin ( string )

Returns the "ServerAdmin" value.

If $newserveradmin is passed, returns the setting before the

change. since: 2.0.00 ""sseerrvveerrhhoossttnnaammee"" Get/set the "ServerName" value

$serverhostname = $s->serverhostname();

$prevserverhostname = $s->serverhostname($newserverhostname);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newserverhostname ( string )

If passed, sets the "ServerName" value Note the limited functionality under threaded MPMs.

ret: $serverhostname ( string )

Returns the "ServerName" value

If $newserverhostname is passed, returns the setting before the

change. since: 2.0.00 ""ttiimmeeoouutt"" Get/set the timeout ("TimeOut") (in microsecs), which Apache will wait for before it gives up doing something

$timeout = $s->timeout();

$prevtimeout = $s->timeout($newtimeout);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newtimeout ( integer )

If passed, sets the new timeout (the value should be in microseconds). Note the limited functionality under threaded MPMs.

ret: $timeout ( integer )

Returns the timeout setting in microseconds.

If $newtimeout is passed, returns the setting before the change.

since: 2.0.00 Let us repeat again: the timeout values is microseconds. For example to set the timeout to 20 secs:

$s->timeout(20000000);

NNootteess LLiimmiitteedd FFuunnccttiioonnaalliittyy uunnddeerr TThhrreeaaddeedd MMPPMMss Note that under threaded MPMs, some of the read/write accessors, will be able to set values only before threads are spawned (i.e. before the "ChildInit phase"). Therefore if you are developing your application

on the non-threaded MPM, but planning to have it run under threaded

mpm, you should not use those methods to set values after the ChildInit phase. The affected accessor methods are marked as such in their respective documentation entries. UUnnssuuppppoorrtteedd AAPPII

"Apache2::ServerRec" also provides auto-generated Perl interface for a

few other methods which aren't tested at the moment and therefore their API is a subject to change. These methods will be finalized later as a need arises. If you want to rely on any of the following methods please contact the the modperl development mailing list so we can help each other take the steps necessary to shift the method to an officially supported API. ""aaddddrrss"" Get the addrs value

$addrs = $s->addrs();

obj: $s ( "Apache2::ServerRec object" )

ret: $addrs ( "Apache2::ServerAddr" )

Returns the addrs setting. since: subject to change

META: this methods returns a vhost-specific Apache2::ServerAddr object,

which is not implemented at the moment. See the struct serveraddrrec

entry in httpd-2.0/include/httpd.h for more information. It seems that

most (all?) of the information in that record is available through other APIs. ""llooookkuuppddeeffaauullttss"" Get the lookupdefaults value. MIME type info, etc., before we start

checking per-directory info.

$lookupdefaults = $s->lookupdefaults();

obj: $s ( "Apache2::ServerRec object" )

ret: $lookupdefaults ( "Apache2::ConfVector" )

Returns the lookupdefaults setting. since: subject to change ""mmoodduulleeccoonnffiigg""

Get config vector containing pointers to modules' per-server config

structures.

$moduleconfig = $s->moduleconfig();

obj: $s ( "Apache2::ServerRec object" )

ret: $moduleconfig ( "Apache2::ConfVector" )

Returns the moduleconfig setting. since: subject to change ""nnaammeess"" Get/set the value(s) for the "ServerAlias" setting

$names = $s->names();

$prevnames = $s->names($newnames);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newnames ( "APR::ArrayHeader" )

If passed, sets the new names. Note the limited functionality under threaded MPMs.

ret: $names ( "APR::ArrayHeader" )

Returns the names setting.

If $newnames is passed, returns the setting before the change.

since: 2.0.00 META: we don't have "APR::ArrayHeader" yet ""wwiillddnnaammeess"" Wildcarded names for ServerAlias servers

$wildnames = $s->wildnames();

$prevwildnames = $s->wildnames($newwildnames);

obj: $s ( "Apache2::ServerRec object" )

opt arg1: $newwildnames ( "APR::ArrayHeader" )

If passed, sets the new wildnames. Note the limited functionality under threaded MPMs.

ret: $wildnames ( "APR::ArrayHeader" )

Returns the wildnames setting.

If $newwildnames is passed, returns the setting before the

change. since: 2.0.00 META: we don't have "APR::ArrayHeader" yet SSeeee AAllssoo modperl 2.0 documentation. CCooppyyrriigghhtt modperl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. AAuutthhoorrss The modperl development team and numerous contributors.

perl va5p.a8c.h8emodperl-101.1~2::mod2p0e0r5l-120.-02.02::docs::api::Apache2::ServerRec(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™