Apache::XMLRPC(3)

πŸ’– Apache::XMLRPC πŸ’–

okay bestie, welcome to the Apache::XMLRPC(3) page β€” the User Contributed Perl Documentation one β€” and it’s literally all about serving XML-RPC requests from Apache. 🫢 no cap, let’s get into it.

✨ NAME ✨

Apache::XMLRPC β€” serve XML-RPC requests from Apache. short, sweet, iconic. πŸ’…

🌈 SYNOPSIS 🌈

here’s the Apache config situation and the services file setup, exactly as laid out:

          ##
          ##  Directives for your Apache config file.
          ##
          <Location /RPC2>
             SetHandler perl-script
             PerlHandler Apache::XMLRPC
             PerlSetVar XMLRPC_Config /usr/local/apache/xml-rpc/services
          </Location>

          ##
          ##  In the 'services' file referenced above by 'XMLRPC_Config'
          ##
          sub foo {
             ...
          }

          sub bar {
             ...
          }

          $map = {
             foo   => \&foo,
             bar   => \&bar,
          };

          1;

πŸ¦‹ DESCRIPTION πŸ¦‹

Apache::XMLRPC serves Userland XML-RPC requests from Apache/mod_perl using the Frontier::RPC2 module. that’s the whole vibe check. πŸ¦‹

Configuring Apache::XMLRPC to work under mod_perl is a two-step process. First, you must declare a <Location> directive in your Apache configuration file β€” that tells Apache to use the content handler found in the Apache::XMLRPC module, and it defines a variable that tells the module where to find your services. Then, you must define the services. two steps, no drama. periodt. ✨

πŸŽ€ Apache Configuration πŸŽ€

Apache configuration is as simple as the <Location> directive shown in the synopsis above. Any directive allowed by Apache inside a <Location> block is allowed here, but the three lines shown above are required. pay close attention to the PerlSetVar XMLRPC_Config ... line, because that’s where you tell Apache where to find your services. this file may reside anywhere accessable by Apache. πŸ‘€

πŸ’œ Defining Services πŸ’œ

To actually define the XML-RPC routines that will be served, they must reside in the file referenced by the PerlSetVar XMLRPC_Config ... directive in the Apache configuration file. In this file you may place as many Perl subroutines as you like, but only those which are explicitly published will be available to your XML-RPC clients. the rest are lowkey just vibing. πŸ’œ

To publish a subroutine, it must be included in the hash reference named $map β€” and yes, the hash reference must have this name, because this is the variable that Apache::XMLRPC passes to Frontier::RPC2::serve to actually service each request. the hash reference must be defined in this "services" file. no cap. 🫢

The keys of the hash are the service names visible to the XML-RPC clients, while the hash values are references to the subroutines you wish to make public. there is no requirement that the published service names match those of their associated subroutines, but it does make administration a little easier. iykyk. πŸ’…

🌟 SEE ALSO 🌟

πŸ‘‘ AUTHOR πŸ‘‘

Ed Hill <ed-hill@uiowa.edu> is the original author. πŸ’–

Tim Peoples <tep@colltech.com> added a few tweaks and all the documentation. 🫢


okay, that’s the whole page, bestie. this gem is from perl v5.32.1, dated 2023-10-24, and it’s the Apache::XMLRPC(3) manual page. slay and goodbye. πŸ’…βœ¨

πŸ“¦ where this page comes from