apache2::serverrec.3
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· 3 代码 · 共 838 行 · 第 1/2 页
3
838 行
Note the limited functionality under threadedMPMs..ie n .IP "ret: $limit_req_line ( integer )" 4.el .IP "ret: \f(CW$limit_req_line\fR ( integer )" 4.IX Item "ret: $limit_req_line ( integer )"Returns the request line limit value.SpIf \f(CW$new_limit_req_line\fR is passed, returns the setting before thechange..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".ie n .Sh """loglevel""".el .Sh "\f(CWloglevel\fP".IX Subsection "loglevel"Get/set the \f(CW\*(C`LogLevel\*(C'\fR directive value.PP.Vb 2\& $loglevel = $s\->loglevel();\& $prev_loglevel = $s\->loglevel($new_loglevel);.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "opt arg1: $new_loglevel\fR ( \f(CW""Apache2::Const :log constant"" )" 4.el .IP "opt arg1: \f(CW$new_loglevel\fR ( \f(CWApache2::Const :log constant\fR )" 4.IX Item "opt arg1: $new_loglevel ( Apache2::Const :log constant )".PDIf passed, sets a new \f(CW\*(C`LogLevel\*(C'\fR value.SpNote the limited functionality under threadedMPMs..ie n .IP "ret: $loglevel\fR ( \f(CW""Apache2::Const :log constant"" )" 4.el .IP "ret: \f(CW$loglevel\fR ( \f(CWApache2::Const :log constant\fR )" 4.IX Item "ret: $loglevel ( Apache2::Const :log constant )"Returns the \f(CW\*(C`LogLevel\*(C'\fR value as a constant..SpIf \f(CW$new_loglevel\fR is passed, returns the setting before the change..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPFor example, to set the \f(CW\*(C`LogLevel\*(C'\fR value to \f(CW\*(C`info\*(C'\fR:.PP.Vb 2\& use Apache2::Const \-compile => qw(LOG_INFO);\& $s\->loglevel(Apache2::Const::LOG_INFO);.Ve.ie n .Sh """next""".el .Sh "\f(CWnext\fP".IX Subsection "next"The next server record in the list (if there are vhosts).PP.Vb 1\& $s_next = $s\->next();.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "ret: $s_next\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "ret: \f(CW$s_next\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "ret: $s_next ( Apache2::ServerRec object )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.PPFor example the following code traverses all the servers, startingfrom the base server and continuing to vhost servers, counting allavailable vhosts:.PP.Vb 8\& 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";.Ve.ie n .Sh """path""".el .Sh "\f(CWpath\fP".IX Subsection "path"Get/set pathname for the \f(CW\*(C`ServerPath\*(C'\fR setting.PP.Vb 2\& $path = $s\->path();\& $prev_path = $s\->path($new_path);.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "opt arg1: $new_path ( string )" 4.el .IP "opt arg1: \f(CW$new_path\fR ( string )" 4.IX Item "opt arg1: $new_path ( string )".PDIf passed, sets the new path..SpNote the limited functionality under threadedMPMs..ie n .IP "ret: $path ( string )" 4.el .IP "ret: \f(CW$path\fR ( string )" 4.IX Item "ret: $path ( string )"Returns the path setting..SpIf \f(CW$new_path\fR is passed, returns the setting before the change..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".ie n .Sh """port""".el .Sh "\f(CWport\fP".IX Subsection "port"Get/set the port value.PP.Vb 2\& $port = $s\->port();\& $prev_port = $s\->port($new_port);.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "opt arg1: $new_port ( integer )" 4.el .IP "opt arg1: \f(CW$new_port\fR ( integer )" 4.IX Item "opt arg1: $new_port ( integer )".PDIf passed, sets the new port..SpNote the limited functionality under threadedMPMs..Sp\&\s-1META:\s0 I don't think one should be allowed to change port number afterthe server has started..ie n .IP "ret: $port ( integer )" 4.el .IP "ret: \f(CW$port\fR ( integer )" 4.IX Item "ret: $port ( integer )"Returns the port setting..SpIf \f(CW$new_port\fR is passed returns the setting before the change..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".ie n .Sh """process""".el .Sh "\f(CWprocess\fP".IX Subsection "process"The process this server is running in.PP.Vb 1\& $proc = $s\->process();.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "ret: $proc\fR ( \f(CW""Apache2::Process object"" )" 4.el .IP "ret: \f(CW$proc\fR ( \f(CWApache2::Process object\fR )" 4.IX Item "ret: $proc ( Apache2::Process object )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """server_admin""".el .Sh "\f(CWserver_admin\fP".IX Subsection "server_admin"Get/set the \f(CW\*(C`ServerAdmin\*(C'\fR value.PP.Vb 2\& $server_admin = $s\->server_admin();\& $prev_server_admin = $s\->server_admin($new_server_admin);.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "opt arg1: $new_server_admin ( string )" 4.el .IP "opt arg1: \f(CW$new_server_admin\fR ( string )" 4.IX Item "opt arg1: $new_server_admin ( string )".PDIf passed, sets the new \f(CW\*(C`ServerAdmin\*(C'\fR value..SpNote the limited functionality under threadedMPMs..ie n .IP "ret: $server_admin ( string )" 4.el .IP "ret: \f(CW$server_admin\fR ( string )" 4.IX Item "ret: $server_admin ( string )"Returns the \f(CW\*(C`ServerAdmin\*(C'\fR value..SpIf \f(CW$new_server_admin\fR is passed, returns the setting before thechange..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".ie n .Sh """server_hostname""".el .Sh "\f(CWserver_hostname\fP".IX Subsection "server_hostname"Get/set the \f(CW\*(C`ServerName\*(C'\fR value.PP.Vb 2\& $server_hostname = $s\->server_hostname();\& $prev_server_hostname = $s\->server_hostname($new_server_hostname);.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "opt arg1: $new_server_hostname ( string )" 4.el .IP "opt arg1: \f(CW$new_server_hostname\fR ( string )" 4.IX Item "opt arg1: $new_server_hostname ( string )".PDIf passed, sets the \f(CW\*(C`ServerName\*(C'\fR value.SpNote the limited functionality under threadedMPMs..ie n .IP "ret: $server_hostname ( string )" 4.el .IP "ret: \f(CW$server_hostname\fR ( string )" 4.IX Item "ret: $server_hostname ( string )"Returns the \f(CW\*(C`ServerName\*(C'\fR value.SpIf \f(CW$new_server_hostname\fR is passed, returns the setting before thechange..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".ie n .Sh """timeout""".el .Sh "\f(CWtimeout\fP".IX Subsection "timeout"Get/set the timeout (\f(CW\*(C`TimeOut\*(C'\fR) (in microsecs), which Apache willwait for before it gives up doing something.PP.Vb 2\& $timeout = $s\->timeout();\& $prev_timeout = $s\->timeout($new_timeout);.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "opt arg1: $new_timeout ( integer )" 4.el .IP "opt arg1: \f(CW$new_timeout\fR ( integer )" 4.IX Item "opt arg1: $new_timeout ( integer )".PDIf passed, sets the new timeout (the value should be in microseconds)..SpNote the limited functionality under threadedMPMs..ie n .IP "ret: $timeout ( integer )" 4.el .IP "ret: \f(CW$timeout\fR ( integer )" 4.IX Item "ret: $timeout ( integer )"Returns the timeout setting in microseconds..SpIf \f(CW$new_timeout\fR is passed, returns the setting before the change..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPLet us repeat again: the timeout values is microseconds. For exampleto set the timeout to 20 secs:.PP.Vb 1\& $s\->timeout(20_000_000);.Ve.SH "Notes".IX Header "Notes".Sh "Limited Functionality under Threaded MPMs".IX Subsection "Limited Functionality under Threaded MPMs"Note that under threaded MPMs, some of the read/write accessors, willbe able to set values only before threads are spawned (i.e. before the\&\f(CW\*(C`ChildInitphase\*(C'\fR).Therefore if you are developing your application on the non-threaded\&\s-1MPM\s0, but planning to have it run under threaded mpm, you should notuse those methods to set values after the ChildInit phase..PPThe affected accessor methods are marked as such in their respectivedocumentation entries..SH "Unsupported API".IX Header "Unsupported API"\&\f(CW\*(C`Apache2::ServerRec\*(C'\fR also provides auto-generated Perl interface for afew other methods which aren't tested at the moment and thereforetheir \s-1API\s0 is a subject to change. These methods will be finalizedlater as a need arises. If you want to rely on any of the followingmethods please contact the the mod_perl development mailinglist so we can help each other take the steps necessaryto shift the method to an officially supported \s-1API\s0..ie n .Sh """addrs""".el .Sh "\f(CWaddrs\fP".IX Subsection "addrs"Get the addrs value.PP.Vb 1\& $addrs = $s\->addrs();.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "ret: $addrs\fR ( \f(CW""Apache2::ServerAddr"" )" 4.el .IP "ret: \f(CW$addrs\fR ( \f(CWApache2::ServerAddr\fR )" 4.IX Item "ret: $addrs ( Apache2::ServerAddr )".PDReturns the addrs setting..IP "since: subject to change" 4.IX Item "since: subject to change".PP\&\s-1META:\s0 this methods returns a vhost-specific Apache2::ServerAddr object,which is not implemented at the moment. See the struct server_addr_recentry in httpd\-2.0/include/httpd.h for more information. It seems thatmost (all?) of the information in that record is available throughother APIs..ie n .Sh """lookup_defaults""".el .Sh "\f(CWlookup_defaults\fP".IX Subsection "lookup_defaults"Get the lookup_defaults value. \s-1MIME\s0 type info, etc., before we startchecking per-directory info..PP.Vb 1\& $lookup_defaults = $s\->lookup_defaults();.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "ret: $lookup_defaults\fR ( \f(CW""Apache2::ConfVector"" )" 4.el .IP "ret: \f(CW$lookup_defaults\fR ( \f(CWApache2::ConfVector\fR )" 4.IX Item "ret: $lookup_defaults ( Apache2::ConfVector )".PDReturns the lookup_defaults setting..IP "since: subject to change" 4.IX Item "since: subject to change".ie n .Sh """module_config""".el .Sh "\f(CWmodule_config\fP".IX Subsection "module_config"Get config vector containing pointers to modules' per-server configstructures..PP.Vb 1\& $module_config = $s\->module_config();.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "ret: $module_config\fR ( \f(CW""Apache2::ConfVector"" )" 4.el .IP "ret: \f(CW$module_config\fR ( \f(CWApache2::ConfVector\fR )" 4.IX Item "ret: $module_config ( Apache2::ConfVector )".PDReturns the module_config setting..IP "since: subject to change" 4.IX Item "since: subject to change".ie n .Sh """names""".el .Sh "\f(CWnames\fP".IX Subsection "names"Get/set the value(s) for the \f(CW\*(C`ServerAlias\*(C'\fR setting.PP.Vb 2\& $names = $s\->names();\& $prev_names = $s\->names($new_names);.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "opt arg1: $new_names\fR ( \f(CW""APR::ArrayHeader"" )" 4.el .IP "opt arg1: \f(CW$new_names\fR ( \f(CWAPR::ArrayHeader\fR )" 4.IX Item "opt arg1: $new_names ( APR::ArrayHeader )".PDIf passed, sets the new names..SpNote the limited functionality under threadedMPMs..ie n .IP "ret: $names\fR ( \f(CW""APR::ArrayHeader"" )" 4.el .IP "ret: \f(CW$names\fR ( \f(CWAPR::ArrayHeader\fR )" 4.IX Item "ret: $names ( APR::ArrayHeader )"Returns the names setting..SpIf \f(CW$new_names\fR is passed, returns the setting before the change..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PP\&\s-1META:\s0 we don't have \f(CW\*(C`APR::ArrayHeader\*(C'\fR yet.ie n .Sh """wild_names""".el .Sh "\f(CWwild_names\fP".IX Subsection "wild_names"Wildcarded names for ServerAlias servers.PP.Vb 2\& $wild_names = $s\->wild_names();\& $prev_wild_names = $s\->wild_names($new_wild_names);.Ve.ie n .IP "obj: $s\fR ( \f(CW""Apache2::ServerRec object"" )" 4.el .IP "obj: \f(CW$s\fR ( \f(CWApache2::ServerRec object\fR )" 4.IX Item "obj: $s ( Apache2::ServerRec object )".PD 0.ie n .IP "opt arg1: $new_wild_names\fR ( \f(CW""APR::ArrayHeader"" )" 4.el .IP "opt arg1: \f(CW$new_wild_names\fR ( \f(CWAPR::ArrayHeader\fR )" 4.IX Item "opt arg1: $new_wild_names ( APR::ArrayHeader )".PDIf passed, sets the new wild_names..SpNote the limited functionality under threadedMPMs..ie n .IP "ret: $wild_names\fR ( \f(CW""APR::ArrayHeader"" )" 4.el .IP "ret: \f(CW$wild_names\fR ( \f(CWAPR::ArrayHeader\fR )" 4.IX Item "ret: $wild_names ( APR::ArrayHeader )"Returns the wild_names setting..SpIf \f(CW$new_wild_names\fR is passed, returns the setting before thechange..IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PP\&\s-1META:\s0 we don't have \f(CW\*(C`APR::ArrayHeader\*(C'\fR yet.SH "See Also".IX Header "See Also"mod_perl 2.0 documentation..SH "Copyright".IX Header "Copyright"mod_perl 2.0 and its core modules are copyrighted underThe Apache Software License, Version 2.0..SH "Authors".IX Header "Authors"The mod_perl development team and numerouscontributors.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?