⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serverrec.pm

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 PM
📖 第 1 页 / 共 2 页
字号:
=backFor example the following code traverses all the servers, startingfrom the base server and continuing to vhost servers, counting allavailable 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";=head2 C<path>Get/set pathname for the C<ServerPath> setting  $path      = $s->path();  $prev_path = $s->path($new_path);=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item opt arg1: C<$new_path> ( string )If passed, sets the new path.Note the L<limited functionality under threadedMPMs|/Limited_Functionality_under_Threaded_MPMs>.=item ret: C<$path> ( string )Returns the path setting.If C<$new_path> is passed, returns the setting before the change.=item since: 2.0.00=back=head2 C<port>Get/set the port value  $port      = $s->port();  $prev_port = $s->port($new_port);=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item opt arg1: C<$new_port> ( integer )If passed, sets the new port.Note the L<limited functionality under threadedMPMs|/Limited_Functionality_under_Threaded_MPMs>.META: I don't think one should be allowed to change port number afterthe server has started.=item ret: C<$port> ( integer )Returns the port setting.If C<$new_port> is passed returns the setting before the change.=item since: 2.0.00=back=head2 C<process>The process this server is running in  $proc = $s->process();=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item ret: C<$proc>( C<L<Apache2::Process object|docs::2.0::api::Apache2::Process>> )=item since: 2.0.00=back=head2 C<server_admin>Get/set the C<ServerAdmin> value  $server_admin      = $s->server_admin();  $prev_server_admin = $s->server_admin($new_server_admin);=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item opt arg1: C<$new_server_admin> ( string )If passed, sets the new C<ServerAdmin> value.Note the L<limited functionality under threadedMPMs|/Limited_Functionality_under_Threaded_MPMs>.=item ret: C<$server_admin> ( string )Returns the C<ServerAdmin> value.If C<$new_server_admin> is passed, returns the setting before thechange.=item since: 2.0.00=back=head2 C<server_hostname>Get/set the C<ServerName> value  $server_hostname      = $s->server_hostname();  $prev_server_hostname = $s->server_hostname($new_server_hostname);=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item opt arg1: C<$new_server_hostname> ( string )If passed, sets the C<ServerName> valueNote the L<limited functionality under threadedMPMs|/Limited_Functionality_under_Threaded_MPMs>.=item ret: C<$server_hostname> ( string )Returns the C<ServerName> valueIf C<$new_server_hostname> is passed, returns the setting before thechange.=item since: 2.0.00=back=head2 C<timeout>Get/set the timeout (C<TimeOut>) (in microsecs), which Apache willwait for before it gives up doing something  $timeout      = $s->timeout();  $prev_timeout = $s->timeout($new_timeout);=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item opt arg1: C<$new_timeout> ( integer )If passed, sets the new timeout (the value should be in microseconds).Note the L<limited functionality under threadedMPMs|/Limited_Functionality_under_Threaded_MPMs>.=item ret: C<$timeout> ( integer )Returns the timeout setting in microseconds.If C<$new_timeout> is passed, returns the setting before the change.=item since: 2.0.00=backLet us repeat again: the timeout values is microseconds. For exampleto set the timeout to 20 secs:  $s->timeout(20_000_000);=head1 Notes=head2 Limited Functionality under Threaded MPMsNote that under threaded MPMs, some of the read/write accessors, willbe able to set values only before threads are spawned (i.e. before theC<L<ChildInitphase|docs::2.0::user::handlers::server/C_PerlChildInitHandler_>>).Therefore if you are developing your application on the non-threadedMPM, but planning to have it run under threaded mpm, you should notuse those methods to set values after the ChildInit phase.The affected accessor methods are marked as such in their respectivedocumentation entries.=head1 Unsupported APIC<Apache2::ServerRec> also provides auto-generated Perl interface for afew other methods which aren't tested at the moment and thereforetheir API 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 L<the mod_perl development mailinglist|maillist::dev> so we can help each other take the steps necessaryto shift the method to an officially supported API.=head2 C<addrs>Get the addrs value  $addrs = $s->addrs();=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item ret: C<$addrs>( C<L<Apache2::ServerAddr|docs::2.0::api::Apache2::ServerAddr>> )Returns the addrs setting.=item since: subject to change=backMETA: 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.=head2 C<lookup_defaults>Get the lookup_defaults value.  MIME type info, etc., before we startchecking per-directory info.  $lookup_defaults = $s->lookup_defaults();=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item ret: C<$lookup_defaults>( C<L<Apache2::ConfVector|docs::2.0::api::Apache2::ConfVector>> )Returns the lookup_defaults setting.=item since: subject to change=back=head2 C<module_config>Get config vector containing pointers to modules' per-server configstructures.  $module_config = $s->module_config();=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item ret: C<$module_config>( C<L<Apache2::ConfVector|docs::2.0::api::Apache2::ConfVector>> )Returns the module_config setting.=item since: subject to change=back=head2 C<names>Get/set the value(s) for the C<ServerAlias> setting  $names      = $s->names();  $prev_names = $s->names($new_names);=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item opt arg1: C<$new_names>( C<L<APR::ArrayHeader|docs::2.0::api::APR::ArrayHeader>> )If passed, sets the new names.Note the L<limited functionality under threadedMPMs|/Limited_Functionality_under_Threaded_MPMs>.=item ret: C<$names> ( C<L<APR::ArrayHeader|docs::2.0::api::APR::ArrayHeader>> )Returns the names setting.If C<$new_names> is passed, returns the setting before the change.=item since: 2.0.00=backMETA: we don't have C<APR::ArrayHeader> yet=head2 C<wild_names>Wildcarded names for ServerAlias servers  $wild_names      = $s->wild_names();  $prev_wild_names = $s->wild_names($new_wild_names);=over 4=item obj: C<$s>( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> )=item opt arg1: C<$new_wild_names>( C<L<APR::ArrayHeader|docs::2.0::api::APR::ArrayHeader>> )If passed, sets the new wild_names.Note the L<limited functionality under threadedMPMs|/Limited_Functionality_under_Threaded_MPMs>.=item ret: C<$wild_names>( C<L<APR::ArrayHeader|docs::2.0::api::APR::ArrayHeader>> )Returns the wild_names setting.If C<$new_wild_names> is passed, returns the setting before thechange.=item since: 2.0.00=backMETA: we don't have C<APR::ArrayHeader> yet=head1 See AlsoL<mod_perl 2.0 documentation|docs::2.0::index>.=head1 Copyrightmod_perl 2.0 and its core modules are copyrighted underThe Apache Software License, Version 2.0.=head1 AuthorsL<The mod_perl development team and numerouscontributors|about::contributors::people>.=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -