Subject: | PerlSetVar do not get set in httpd-perl |
Versions:
Distribution: Mandrake Linux release 9.0 (dolphin) for i586
OS : Linux 2.4.19-24mdk
perl: v5.8.0 built for i386-linux-thread-multi
Apache::RPC::Server : 1.22
mod_perl: 1.3.26_1.27-7mdk
Apache module: 1.27
Apache is running httpd and httpd-perl (which is handling the RPC in port 8200)
Problem:
I have added to /etc/httpd/conf/commonhttpd.conf the RPC servers defined in the attached
file (common_adds.conf). I've added 2 through <Perl> clauses and 1 through <Location>.
The <Perl> servers were correct, but the <Location> one wasn't configured according to the
PerlSetVar I had put in.
Trying to debug the problem I've added some prints (using debug) in Apache/RPC/Server.pm .
The problem seemed to be that only RpcServer and RPCOptPrefix were
being correctly read.
After some web digging, I got to the conclusion that in the Apache::RPC::Server->get_server method
- If called from a <Location> definition: $R is an Apache object
- If called from a <Perl> definition: $R is an Apache::Server (as aspected from the
creation in the <Perl> zone)
And:
- Apache::Server has server_hostname() and port(), but doesn't have dir_config related to
the current Location (he doesn't know the current request ?!? )
- Apache object has the dir_config related to the current Location, but isn't a server
(and so doesn't have server_hostname and port.
In the new method of Apache::RPC::Server there is a line:
$R = $R->server if (ref($R) eq 'Apache');
which makes the <Location> server do lose all dir_config() from this point forward.
Problems In documentation:
RpcMethod is refered as RpcServerMethod in Apache::RPC::Server .
RpcServerDir is refered (instead of RpcMethodDir) in Apache::RPC::Server .
The
PerlModule Apache::RPC::Server
could be added to the example.
(also in the diff file)
Possible solution:
I've attached a diff file for Apache/RPC/Server.pm. After this, the 3 servers operated as
expected.
Disclaimer:
All suggestions are made supposing that I didn't make any configuration mistake.
If I did, I'm sorry for making you lose your time.
Message body not shown because it is not plain text.