From: Max B. <ma...@wa...> - 2013-07-23 16:15:43
|
Hi Jeroen, Ugh, why do they have to break APIs that are 10+ years in production? I think the cleanest thing to do would be to use can on the connection object so that the code works with both versions of apache. This is assuming can() works. Something like : my $con = $r->connection; my $userip = $con->can('client_ip') ? $con->client_ip() : $con->can('remote_ip') ? $con->remote_ip() : croak "useful message"; -m On 7/21/2013 11:58 PM, Jeroen Massar wrote: > Hi folks, > > For the ones already playing with Apache 2.4 which is getting included > on a variety of distributions (eg Debian unstable), and that uses apreq2 > and has dropped 'remote_ip' in favor of 'client_ip'. > > http://www.gossamer-threads.com/lists/modperl/modperl/104081: > "c->remote_ip gone, and now split into c->client_ip (tcp endpoint) and > c->useragent_ip (e.g. X-Forwarded-For)" > > > /usr/share/netdisco/html/login.html line 50 will fail as Apache 2.4 does > note have "remote_ip" anymore due to internal changes (hence the 2.4 > version number instead of 2.2 as they are not compatible). > > In that file instead of: > my $userip = $r->connection->remote_ip; > > just have: > my $userip = $r->connection->client_ip; > > and everything will work again. > > This holds for netdisco 1.0 till the recently released 1.3. > > Btw, taking the netdisco-1.0 package from Debian source (apt-get source > netdisco), moving that debian dir to a 1.3 tarball, removing the patches > dir, manually applying the FHS changes and just doing dpkg-buildpackage > -b, installing the package and then following the debian setup (apache > config + db) then applying the 1.0 -> 1.1 -> 1.2 -> 1.3 db upgrades and > voila, you have a working 1.3 netdisco that is properly packaged. You'll > have to do the same for the SNMP perl lib though, just copy the debian > dir over from an old one, rebuild, presto. > > Much cleaner and actually simpler than the 'blog' version of installing > netdisco 1.3 on Debian which will leave a huge mess of stuff and does > not patch things properly and contains various typo errors... > > Greets, > Jeroen > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > netdisco-devel mailing list > net...@li... > https://lists.sourceforge.net/lists/listinfo/netdisco-devel > |