Re: Possible Apache::AuthenSmb Mod?
Peter Hartzler wrote: Hello, We're looking into using your Apache::AuthenSmb module to allow us to migrate our intranet to GNU/Linux/Apache. One issue we have is that we have two NT domains. I have a couple of different ideas for how to modify the code to allow this scenario, and am wondering if you have any thoughts on this, or would be interested in a patch, or have a patch, or this is already possible and somehow I've missed it... There are a couple of obvious considerations, such as the possibility of userid duplication in the two domains (we don't do that), the need to not break existing/legacy configurations, and perhaps the desirability of passing the user's domain to the script (not sure about that one). Anyhow, thanks for the very useful code, and do feel welcome to jump in if anything moves you! Best Regards, Pete. Hi! I think that Apache-AuthenNTLM may fit the bill for you. Check it out at: http://search.cpan.org/author/SPEEVES/Apache-AuthenNTLM-2.04/AuthenNTLM.pm You are able to create mappings for more than one domain. Also, please include the modperl mailing list in your replies. (This email may have information that will help others in the future :) ) thanks, speeves cws
Re: apache2, mod_perl: problem with CGI
Stas Bekman wrote: speeves wrote: Stas Bekman wrote: Thanks that did it. Great. It would be nice though if the minimum rev level of the CGI.pm could be mentioned in the doc. Or maybe it is there somewhere and I skimmed over it. It's a a CGI.pm problem, really. We can't go and support all possible modules that may or may not run under mod_perl 2.0. However we do have this section: http://perl.apache.org/products/apache-modules.html#Porting_CPAN_modules_to_mod_perl_2_0_Status We probably should specify the version number of each of these modules. Can somebody please lookup those modules and send me a patch with the version number which starts to support mod_perl 2.0? No need for Apache::Peek, CGI and CGI::Cookie since I know these versions already. I'm CC'ing Shannon, since he has ported most of the auth modules. Sorry, I wasn't following the thread, so don't know what the patch is for. :( But, here is a listing of the version numbers for the auth mods that are stable, and work with mod_perl2: Apache-AuthenNIS-0.11 Apache-AuthenNTLM-2.04 Apache-AuthenPasswd-0.12 Apache-AuthenSmb-0.70 Apache-AuthExpire-0.38 Apache-AuthNetLDAP-0.25 Apache-AuthPerLDAP-2.01 Apache-AuthzNetLDAP-0.07 Apache-AuthzNIS-0.11 Apache-AuthzPasswd-0.11 Thanks, speeves So these are the versions required to run properly with mod_perl 2.0? Here is an updated table: Module Name Required Dist Package - Apache::AuthExpire Apache-AuthExpire-0.38 Apache::AuthNetLDAPApache-AuthNetLDAP-0.25 Apache::AuthPerLDAPApache-AuthPerLDAP-2.01 Apache::AuthenNIS Apache-AuthenNIS-0.11 Apache::AuthenPasswd Apache-AuthenPasswd-0.12 Apache::AuthenSmb Apache-AuthenSmb-0.70 Apache::AuthzNIS Apache-AuthzNIS-0.11 Apache::AuthzNetLDAP Apache-AuthzNetLDAP-0.07 Apache::AuthzPasswdApache-AuthzPasswd-0.11 Apache::Clean Apache-Clean-2.00_4 (not released) Apache::Peek Apache-Peek-1.01 CGICGI.pm-2.93 CGI::CookieCGI.pm-2.93 (comes in the CGI dist) I can't see Apache-AuthenNTLM-2.04 being ported yet, though. Here is the list of modules that are being in progress of being ported: Hi! Apache-AuthenNTLM-2.04 is indeed ported, I guess I just didn't make a formal announcement. People can download it from the CPAN site under my name. speeves cws -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
Re: AuthenNTLM
Brett Hales wrote: I am having problems with Apache-AuthenNTLM-0.23. In apache's error.log I am getting the following errors reported. AuthenNTLM: timed out while waiting for lock (key = 23754) This also seems to cause the web server to go _very_ slow. I have looked through the AuthenNTLM.pm and found the section where this is evaluated. There is a comment above it. # smb aborts any connection that where no user is looged on as soon as somebody # tries to open another one. So we have to make sure two request, do not start # two auth cycles at the same time. To avoid a hang of the whole server we wrap it with # a small timeout Maybe this is actually happening and I am getting two auth cycles. Does anybody have an idea why this is happening? Thanks, It's possible, but seems unlikely. Is this happening constantly? Also, try messing with the PerlSetVar ntlmsemkey and PerlSetVar ntlmsemtimout values. ntlmsemkey turns serialization on/off, and ntlmsemtimout sets the timeout for the Apache server to wait for the semaphore, (which serializes the requests to the SMB server). speeves cws -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
Re: Apache::AuthenNTLM module with HP/Apache
Antony Batten wrote: Randy, OK thanks, I'll give that a try. I think we can compile the module against 5.6.1 It's just that we can't change the 5.6.1 install as it would break our support agreement with HP (so I am told) ... I presume we just have to 'install' the module in a different place after compiling it... Thanks v. much to all for helping me with this. Rgds, Antony -Original Message- From: Randy Kobes [mailto:[EMAIL PROTECTED] Sent: 14 August 2003 07:23 To: Antony Batten Cc: 'Shannon Eric Peevey'; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Apache::AuthenNTLM module with HP/Apache On Wed, 13 Aug 2003, Antony Batten wrote: Shannon, Thanks very much for the quick response. Here's the info you wanted (I hope): HP-UX_Apache-based_Web_Server/2.0.46 (Unix) mod_perl/1.99_09 Perl/v5.6.1 DAV/2 configured Can my career be saved? ;0) Thanks again, Antony. -Original Message- From: Shannon Eric Peevey [mailto:[EMAIL PROTECTED] Sent: 13 August 2003 14:41 To: Antony Batten Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Apache::AuthenNTLM module with HP/Apache Antony Batten wrote: [ .. ] We are trying to use the Apache::AuthenNTLM perl module with HP/Apache and mod_perl. We have prevented mod_perl from running our cgi-perl scripts (by using Apache directives to only use mod_perl for *PL files), as we want to use 5.8 for this, and the HP-supplied mod_perl is tied to 5.6.1 Everything installs ok the server starts ok. However, we get the following errors in the errorlog: [Fri Aug 08 13:39:47 2003] [error] failed to resolve handler `Apache::AuthenNTLM' [Fri Aug 08 13:39:47 2003] [error] [client 30.254.43.59] Can't find 'boot_Authen__Smb' symbol in /opt/perl5.8/lib/site_perl/5.8.0/ PA-RISC1.1/auto/Authen/Smb/Smb.sl Compilation failed in require at /opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/Apache/AuthenNTLM.pm line 29. BEGIN failed--compilation aborted at /opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/Apache/AuthenNTLM.pm line 29. Compilation failed in require at (eval 5) line 3. I'm not sure I'm following your setup - is the mod_perl you're trying to use here compiled under Perl 5.6.1? And Apache::AuthenNTLM was compiled under Perl 5.8.0? That combination probably won't work in principle, as 5.6.1 and 5.8.0 are binary incompatible. If you're tied to mod_perl compiled under 5.6.1, try compiling and using an Apache::AuthenNTLM compiled under 5.6.1. Thanks, Randy! (I just woke up in the middle of the night with the same answer :)) ) Yes, use the perl binary that points to 5.6.1 when you run /path/to/perl5.6.1 Makefile.PL. (Running the rest of the install as normal, of course ;) ) This will place the module in the appropriate location for your mod_perl, that apache is using, to find it. speeves cws
Re: Apache::AuthenNTLM module with HP/Apache
Antony Batten wrote: Hi, Sorry to direct email you, but I am desperate, and was hoping the solution to the problem below would be a quick one from the people who wrote the module ;) Thanks, Antony. Appologies if this is no longer your domain, but [posted to comp.infosystems.www.servers.unix comp.lang.perl.modules] We are trying to use the Apache::AuthenNTLM perl module with HP/Apache and mod_perl. We have prevented mod_perl from running our cgi-perl scripts (by using Apache directives to only use mod_perl for *PL files), as we want to use 5.8 for this, and the HP-supplied mod_perl is tied to 5.6.1 Everything installs ok the server starts ok. However, we get the following errors in the errorlog: [Fri Aug 08 13:39:47 2003] [error] failed to resolve handler `Apache::AuthenNTLM' [Fri Aug 08 13:39:47 2003] [error] [client 30.254.43.59] Can't find 'boot_Authen__Smb' symbol in /opt/perl5.8/lib/site_perl/5.8.0/ PA-RISC1.1/auto/Authen/Smb/Smb.sl Compilation failed in require at /opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/Apache/AuthenNTLM.pm line 29. BEGIN failed--compilation aborted at /opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/Apache/AuthenNTLM.pm line 29. Compilation failed in require at (eval 5) line 3. Looks an odd error, as the symbol seems to be there (I am no programmer though :) [EMAIL PROTECTED] $ nm /opt/perl5.8/lib/site_perl/5.8.0/PA-RISC1.1/auto/Authen/Smb/Smb.sl | grep boot boot_Authen__Smb |30816|extern|entry | boot_Authen__Smb |30936|extern|code |$CODE$ Does anyone know what is causing the problem? We are really stumped here and I am up against a deadline to get this stuff working. All help greatly appreciated perl version 5.8.0 mod_perl version 5.6.1 Apache::AuthenNTLM version 2.04 Server version: HP Apache-based Web Server/2.0.43 Can you give us the correct version of mod_perl? (It should be 1.2x or 1.99x) thanks, speeves cws
Apache-AuthPerLDAP beta port uploaded
Hi! I just wanted to see of Henrik Strom was on this list (I have ported your Apache-AuthPerLDAP, and wonder how you want to integrate the changes into your existing module.) Also, I have ported Apache-AuthPerLDAP to work with both versions of mod_perl, but am running out of time to set up the test environment. If some of you could test the new module, and send documentation of any problems with either mod_perl 1 or 2 to me, that would be greatly appreciated :) I have uploaded the ported module to CPAN, and you should be able to find it at: http://search.cpan.org/author/SPEEVES/ later today. Thanks for your help!!! speeves cws The uploaded file Apache-AuthPerLDAP-2.01.tar.gz has entered CPAN as file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthPerLDAP-2.01.tar.gz size: 4442 bytes md5: 1be5678c357fc98723e60374b47932c1
[MP1 and MP2] Apache-AuthenNIS ported
The uploaded file Apache-AuthenNIS-0.11.tar.gz has entered CPAN as file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthenNIS-0.11.tar.gz size: 4095 bytes md5: cac172a46c5b05034842fad5eed6b9be Apache::AuthenNIS - mod_perl NIS Authentication module has been ported to work with both versions of modperl. thanks, speeves cws
[MP1 and MP2] Apache::AuthzNIS ported
The uploaded file Apache-AuthzNIS-0.11.tar.gz has entered CPAN as file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthzNIS-0.11.tar.gz size: 4305 bytes md5: 37bbbdc320c6bba7318d817e854bc8e1 Apache::AuthzNIS - mod_perl NIS Group Authorization module has been ported to work with both versions of modperl. thanks, speeves
[MP1 and MP2] Apache-AuthenSmb ported
Hi! The uploaded file Apache-AuthenSmb-0.70.tar.gz has entered CPAN as file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthenSmb-0.70.tar.gz size: 4004 bytes md5: ac1b1a29f5070f81efb9f1362b5815dc Apache::AuthenSMB - mod_perl NT Authentication module has now been ported to work with both versions of modperl. I have just uploaded it, so should be available from CPAN in a few hours. thanks, speeves cws
Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?
Stas Bekman wrote: Shannon Eric Peevey wrote: [...] *handler = MP2 ? \handler2 : \handler1; I am leaving the MP2 code in both of the subroutines, as I don't know if there is a prettier way to do this... (I will remove it, if there is not) Although this hasn't been tested extensively, it should be working fine now. thanks for the help! speeves cws PS It did complain about Prototype mismatch: sub Apache::AuthenNTLM::handler vs ($$) at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm until I added the code into both subroutines. I've added a new section to the porting tutorial that shows examples of how to handle this situation: http://perl.apache.org/docs/2.0/user/porting/porting.html#Method_Handlers I changed the code for Apache-AuthenNTLM-2.04 to reflect your example, and it works great! Thanks for the pointer :) speeves cws
re: AuthenNTLM - help
Shannon, i put it working on Solaris, mod_perl, NTLM and mod_jk2 (to comunicate with Tomcat), but unfortunatily, it just works when i access from windows 9x and Linux. When i access by NT/2000/XP, it just doesn't work at all (no validation). So, i decide, for a while, make it work on Linux! I am using Conectiva 8, and it is working fine. Thanks. Shannon Eric Peevey escreveu: Francisco de Assis Tristão wrote: Shannon, i got it configured with apache-1.3.27/mod_ssl/2.8.12 OpenSSL/0.9.6g mod_perl/1.25, all by hand, but it only works fine when i use just http - when i access the pages with https, apache doesn't ask for the user... Have you any idea about what is wrong? The version of apache with mod_ssl i took from sunfreeware, mod_perl and ApacheAuthenNTLM i compiled by myself. Sorry, I don't know why this might be happening... Are you running through a proxy server? I have seen a lot of problems when ntlm authentication through a proxy server... speeves cws I am forwarding this to the modperl list... Please include the list in your replies. thanks, speeves cws
Re: AW: Apache:AuthenNTLM 2.01 with modperl 1.26
Tresp, Wilfried wrote: Hi, works now, thanks, next I'll try it with Apache2. AuthenNTLM was the only reason I have not tried it yet :) Regards, Wilfried -Ursprüngliche Nachricht- Von: Shannon Eric Peevey [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 23. Juli 2003 20:50 An: Tresp, Wilfried Betreff: Re: Apache:AuthenNTLM 2.01 with modperl 1.26 Tresp, Wilfried wrote: Hello Shannon Eric, as far as I understood the changes between Apache::AuthenNTLM 2.01 and the older 0.23 from Gerald Richter your enhancements should make it possible to use the modul with modperl 1.26 and modperl 2 also, is this right? I tried to install your version with Apache 1.26, mod_perl 1.27 running Solaris 8 with Perl 5.6.1 but every time a page is called which requires authentication I get an internal Server Error and the error_log shows the following entry: [Wed Jul 23 20:12:36 2003] [error] Can't locate object method log via package Apache (perhaps you forgot to load Apac he?) at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Apache/AuthenNTLM.pm line 598. Do you know what happens? Regards, Wilfried Tresp Hi! Try this file. Just replace your AuthenNTLM.pm file that the install placed in your perl modules directory with this one. It seems that there was a problem here: if ($type == 1) { 597 --# my $log = $r-log; my $nonce = $self - get_nonce ($r) ; in the first handler subroutine at line 597... I have commented out the line, and it should work now. Thanks for the heads-up :) speeves cws Great!!! I will upload a fixed version to CPAN, and it should be available after a few hours. speeves cws
Re: AW: AW: Apache:AuthenNTLM 2.01 with modperl 1.26
Tresp, Wilfried wrote: Hi Shannon Eric, fine it's already there. I try to run the module with Apache 2.0.47 but it didn't work here. There seems to be problems with my @INC variable but I can not figure out how to fix it. When I try to start the daemon I see only the following error message: # /usr/local/apache2/bin/apachectl start [Thu Jul 24 01:27:30 2003] [error] Can't locate Apache/AuthenSmb.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Apache2 ./Apache2 /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl . /usr/local/apache2/ /usr/local/apache2/lib/perl) at (eval 4) line 3. [Thu Jul 24 01:27:30 2003] [error] Can't load Perl module Apache::AuthenSmb for server netweb.de.kworld.kpmg.com:8000, exiting... The module AuthenSmb.pm doesn't exist but I can not locate the problem. Do you have any hints for me? Hi! Looks to me like you are trying to load Michael Parker's Apache::AuthenSmb module... I don't believe that that mod is ported to mp2. The Authen::Smb module is included with the Apache::AuthenNTLM module, so should have been installed when you ran the script. If you change the module that you are trying to load Apache::AuthenNTLM, does that help? speeves cws PS Can you reply to the modperl mailing list? Thanks :)
Re: AW: AW: Apache:AuthenNTLM 2.01 with modperl 1.26
Tresp, Wilfried wrote: Hi Shannon Eric, forget my last mail. It is simply to late. After changing PerlModule to PerlResponseHandler in httpd.conf everything works now. Great! Only little problem is that I see many error_log entries like the following: [12163] the $self-{smbhandle} is 903424 ntlmdebug is set to 0 Maybe the line 198 of AuthenNTLM.pm is the reason for this: print STDERR [$$] the \$self-{smbhandle} is $self-{smbhandle}\n; Regards, Wilfried Hi! Glad that it's working now :) The entries in the error log are just my debugging crap that I was using when I was porting. I will clean up the code a little more and upload a new version tomorrow. Thanks for all of your input!!! speeves cws
Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?
Though I seem to be chasing it down to a possible problem with the method handler: sub handler ($$) But even with a change to: sub handler : method This is an interesting one. How to make the two coexist in the same code base. Ideally you want to do this: sub handler1 ($$) {} sub handler2 : method {} *handler = MP2 ? \handler2 : \handler1; But probably it'll complain about different prototypes. Or it might just work. Give it a try. Hi! Looks like your example will work, though, it is kind of messy, (probably because I don't completely follow the example). I basically added the handler code into the subroutines as defined: sub handler1 ($$) { my ($class, $r) = @_ ; my $type ; my $nonce = '' ; my $self ; ... } sub handler2 : method { my ($class, $r) = @_ ; my $type ; my $nonce = '' ; ... } *handler = MP2 ? \handler2 : \handler1; I am leaving the MP2 code in both of the subroutines, as I don't know if there is a prettier way to do this... (I will remove it, if there is not) Although this hasn't been tested extensively, it should be working fine now. thanks for the help! speeves cws PS It did complain about Prototype mismatch: sub Apache::AuthenNTLM::handler vs ($$) at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm until I added the code into both subroutines.
Re: modperl2 Apache::HTTP_FORBIDDEN... [long post]
Stas Bekman wrote: Shannon Eric Peevey wrote: use constant MP2 = ($mod_perl::VERSION = 1.99); # test for the version of mod_perl, and use the appropriate libraries BEGIN { if (MP2) { require Apache::Const; require Apache::Access; require Apache::Connection; require Apache::Log; require Apache::RequestRec; require Apache::RequestUtil; apache::Const-import(-compile = ^ This might be a typo, but if you change that to Apache::Const (upper case 'A'), does that help? Fantastic!!! I have been staring at all of the wrong code for way too long... :P Thanks for taking the time to find my error :) I should have a working version by the beginning of next week. I think that this still won't work. The reason: Apache::Const-import(-compile = 'HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK'); only compiles the constants, it doesn't import them. Drop the '-compile =' part, and then they will be imported. -compile tell Apache::Const to not import the constants but to compile them. It did work, in fact. (I was just snoozing on the job... :P ) Thanks, Randy! speeves cws
[mp2] beta of Apache-AuthenNTLM uploaded
The uploaded file Apache-AuthenNTLM-2.01.tar.gz has entered CPAN as file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthenNTLM-2.01.tar.gz size: 50644 bytes md5: f175a98ea668e81df9cc8d6db629facf The purpose of this module is to perform a user authentication via Mircosoft's NTLM protocol. (This module also implements Basic Authentication for all other browsers ). You may download this beta version of Apache-AuthenNTLM from CPAN. It is not a replacement for the existing version on CPAN, but instead will work with either version of modperl. Please, feel free to download it and send me any bug reports... :) thanks, speeves cws
Re: AuthenNTLM - Help
Francisco de Assis Tristão wrote: Shannon, i got it configured with apache-1.3.27/mod_ssl/2.8.12 OpenSSL/0.9.6g mod_perl/1.25, all by hand, but it only works fine when i use just http - when i access the pages with https, apache doesn't ask for the user... Have you any idea about what is wrong? The version of apache with mod_ssl i took from sunfreeware, mod_perl and ApacheAuthenNTLM i compiled by myself. Sorry, I don't know why this might be happening... Are you running through a proxy server? I have seen a lot of problems when ntlm authentication through a proxy server... speeves cws
small doc typo...
Hi! Just perusing: http://perl.apache.org/docs/2.0/devel/core/apache_integration.html#The_Link_Between_mod_perl_and_httpd and found a small typo. STANDARD20_MODULE_STUFF is a standard macro defined in httpd-2.0/include/http_config.h. Currently its main use *if* for attaching Apache version magic numbers, Probably mean, Currently its main use *is *for... thanks, speeves cws
Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?
Stas Bekman wrote: speeves wrote: Hi! Just wondering if Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERROR have been implemented? I have been trying to port Apache::AuthenNTLM, and keep getting: [Tue Jul 15 16:46:08 2003] [error] failed to resolve handler `Apache::AuthenNTLM' [Tue Jul 15 16:46:08 2003] [error] [client 192.168.1.2] Bareword Apache::HTTP_FORBIDDEN not allowed while strict subs in u se at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm line 593. Bareword Apache::HTTP_INTERNAL_SERVER_ERROR not allowed while strict subs in use at /usr/local/lib/perl/5.6.1/Apache/Authe nNTLM.pm line 597. Bareword Apache::HTTP_INTERNAL_SERVER_ERROR not allowed while strict subs in use at /usr/local/lib/perl/5.6.1/Apache/Authe nNTLM.pm line 632. BEGIN not safe after errors--compilation aborted at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm line 671. Compilation failed in require at (eval 10) line 3. in the error_log. I have other constants that are imported from Apache::Const, so do not think that it is a problem with scope... Here is the code: line 593 -- return $self-{ntlmauthoritative} ? (defined($nonce) ? (MP2 ? Apache::HTTP_FORBIDDEN : Apache::Constants::HTTP_ FORBIDDEN) : (MP2 ? Apache::HTTP_INTERNAL_SERVER_ERROR : Apache::Constants::HTTP_INTERNAL_SERVER_ERROR)) : (MP2 ? Apache::DE CLINED : Apache::Constants::DECLINED) ; and line 632 --- # return MP2 ? Apache::HTTP_INTERNAL_SERVER_ERROR : Apache::Constants::HTTP_INTERNAL_SERVER_ERROR ; If you need more, let me know. Have you imported them? use Apache::Const compile -qw(Apache::HTTP_FORBIDDEN); All the available Apache:: constants are listed here: http://perl.apache.org/docs/2.0/api/Apache/Const.html Yeah, unfortunately... :( Though I seem to be chasing it down to a possible problem with the method handler: sub handler ($$) But even with a change to: sub handler : method I'm still not able to access the imported CONSTANTS This is definitely the most complex port that I've done, so is taking me a little while to find all of the buggies... Will keep you posted :) speeves cws
Re: modperl2 Apache::HTTP_FORBIDDEN... [long post]
Have you imported them? use Apache::Const compile -qw(Apache::HTTP_FORBIDDEN); All the available Apache:: constants are listed here: http://perl.apache.org/docs/2.0/api/Apache/Const.html Hi! I have included the bare minimum of the code from the module, (Apache::AuthenNTLM). It is still acting as if I have not imported the modules, but I have changed require to use, moved the use statements into various places of the module to see if they would catch it, and nothing doing... I am at the end of my wits. If someone would have a minute to see if they can see why the Constants within the sub handler would not be found, (though they are imported), that would be a great thanks and help :) I am running apache 2.0.46 and mod_perl 1.99_09, perl 5.6.1 on a Debian machine. Thanks in advance, speeves cws package Apache::AuthenNTLM ; use strict ; use vars qw{$cache $VERSION %msgflags1 %msgflags2 %msgflags3 %invflags1 %invflags2 %invflags3 $debug} ; use warnings ; no warnings 'redefine'; $VERSION = 0.24 ; $debug = 0 ; $cache = undef ; use MIME::Base64 () ; use Authen::Smb 0.95 ; use Socket ; # here is where we start the new code use mod_perl ; # use Apache::Constants qw(:common); # setting the constants to help identify which version of mod_perl # is installed use constant MP2 = ($mod_perl::VERSION = 1.99); # test for the version of mod_perl, and use the appropriate libraries BEGIN { if (MP2) { require Apache::Const; require Apache::Access; require Apache::Connection; require Apache::Log; require Apache::RequestRec; require Apache::RequestUtil; apache::Const-import(-compile = 'HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK'); } else { require Apache::Constants; Apache::Constants-import('HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK'); } } # end modperl code ## sub handler : method # ($$) { my ($class, $r) = @_ ; my $type ; my $nonce = '' ; my $self ; my $conn = $r - connection ; my $connhdr = $r - header_in ('Connection') ; my $fh = select (STDERR) ; $| = 1 ; select ($fh) ; my ($addr, $port) = sockaddr_in ($conn - remote_addr) ; print STDERR [$$] AuthenNTLM: Start NTLM Authen handler pid = $$, connection = $$conn conn_http_hdr = $connhdr main = . ($r - main) . cuser = . $conn - user . ' remote_ip = ' . $conn - remote_ip . remote_port = . unpack('n', $port) . ' remote_host = ' . $conn - remote_host . version = $VERSION\n if ($debug) ; # we cannot attach our object to the connection record. Since in # Apache 1.3 there is only one connection at a time per process # we can cache our object and check if the connection has changed. # The check is done by slightly changing the remote_host member, which # persists as long as the connection does # This has to be reworked to work with Apache 2.0 if (ref ($cache) ne $class || $$conn != $cache - {connectionid} || $conn - remote_host ne $cache-{remote_host}) { $conn - remote_host ($conn - remote_host . ' ') ; $self = {connectionid = $$conn, remote_host = $conn - remote_host} ; bless $self, $class ; $cache = $self ; print STDERR [$$] AuthenNTLM: Setup new object\n if ($debug) ; } else { $self = $cache ; print STDERR [$$] AuthenNTLM: Object exists user = $self-{userdomain}\\$self-{username}\n if ($debug) ; if ($self - {ok}) { $conn - user($self-{mappedusername}) ; # we accept the user because we are on the same connection $type = $self - get_msg ($r); my $content_len = $r - header_in('content-length') ; my $method = $r - method ; print STDERR [$$] AuthenNTLM: Same connection pid = $$, connection = $$conn cuser = . $conn - user . ' ip = ' . $conn - remote_ip . ' method = ' . $method . ' Content-Length = ' . $content_len . ' type = ' . $type . \n if ($debug) ; # IE (5.5, 6.0, probably others) can send a type 1 message # after authenticating on the same connection. This is a # problem for POST messages, because IE also sends a # Content-length: 0 with no POST data. if ($method eq 'GET' || $method eq 'HEAD' || $method eq 'OPTION' || $method eq 'DELETE' || $content_len 0 || $type == 3) { print STDERR [$$] AuthenNTLM: OK because same connection\n if ($debug) ; return MP2 ? Apache::OK : Apache::Constants::OK ; } } } $self - get_config ($r) ;
Re: modperl2 Apache::HTTP_FORBIDDEN... [long post]
use constant MP2 = ($mod_perl::VERSION = 1.99); # test for the version of mod_perl, and use the appropriate libraries BEGIN { if (MP2) { require Apache::Const; require Apache::Access; require Apache::Connection; require Apache::Log; require Apache::RequestRec; require Apache::RequestUtil; apache::Const-import(-compile = ^ This might be a typo, but if you change that to Apache::Const (upper case 'A'), does that help? Fantastic!!! I have been staring at all of the wrong code for way too long... :P Thanks for taking the time to find my error :) I should have a working version by the beginning of next week. speeves cws
Re: module ported and doc addition...
Stas Bekman wrote: Shannon Eric Peevey wrote: [...] Also, you don't realy have to do that. The old ala mp1 style works just fine. use Apache::Const qw(OK DECLINED) sub handler { return OK; } Well... I must have been smoking crack, 'cause I seem to remember a simple: return MP2 ? Apache::OK : OK throwing an error, hence, the change to: MP2 ? Apache::OK : Apache::Constants::OK Now that I test it, though, there doesn't seem to be a problem... :P May be you haven't been importing the constant. These two aren't the same: use Apache::Const qw(OK DECLINED); use Apache::Const -compile = qw(OK DECLINED); the latter only compiles the constants, the former compiles and imports it. [...] Here is the code: BEGIN { if (MP2) { require Apache::Const; require Apache::Access; require Apache::Connection; require Apache::Log; require Apache::RequestRec; require Apache::RequestUtil; Apache::Const-import(-compile = 'HTTP_UNAUTHORIZED','OK'); } else { require Apache::Constants; Apache::Constants-import('HTTP_UNAUTHORIZED','OK'); } } (Or, variations upon it...) As I've said, though, my code is dying with an error on Apache::Constants anymore If I hit it again, I will post the error message that I was getting. thanks, speeves cws
Re: module ported and doc addition...
Stas Bekman wrote: Shannon Eric Peevey wrote: [...] Also, you don't realy have to do that. The old ala mp1 style works just fine. use Apache::Const qw(OK DECLINED) sub handler { return OK; } Well... I must have been smoking crack, 'cause I seem to remember a simple: return MP2 ? Apache::OK : OK throwing an error, hence, the change to: MP2 ? Apache::OK : Apache::Constants::OK Now that I test it, though, there doesn't seem to be a problem... :P May be you haven't been importing the constant. These two aren't the same: use Apache::Const qw(OK DECLINED); use Apache::Const -compile = qw(OK DECLINED); the latter only compiles the constants, the former compiles and imports it. [...] Just started working on Apache-AuthNTLM and came across the cross reference that you posted awhile back. This might be where I got it: sub handler { # ... return MP2 ? Apache::OK : Apache::Constants::OK; } 1; in the mod_perl 1.0 and 2.0 Constants Coexistence section of: http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Constants_ speeves cws
Re: mod_perl 1.0 and 2.0
Chris Faust wrote: There is a 0.92 version of Apache::DBI is mp2 aware (there may even be a later version at this point). We started with mp1 and do to problems we decided to goto mp2 (which turned out to be non mod_perl and apache related), there wasn't any major performance increase or anything like that and I don't remember anything major coming up during the switch (outside of cookies - which always seem to be a problem). I use a bunch of the popular modules like HTML::Template, Image::Magick, DBI, Parse/WriteExcel, Date::Manip etc and I haven't had any problems. Like Sreeji said, its really about your requirements - but the above is my experience, for what its worth. -Chris - Original Message - *From:* Jamie Krasnoo mailto:[EMAIL PROTECTED] *To:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] *Sent:* Wednesday, July 09, 2003 3:49 PM *Subject:* mod_perl 1.0 and 2.0 Hi all, Im currently working on a personal project to get myself back in mod_perl programming order. However Im more used to using mod_perl 1.0 with Apache 1.3.x. Im going through the documentation for mod_perl 2.0 but Im worried that most of the modules I need wont work with mod_perl 2.0. Ive been looking for what modules will and will not work with 2.0 (like Apache::DBI for pooling connections with MySQL). Would it be a better benefit to me to switch over to 2.0? Thanks, Jamie We need more help in porting more mods to go with mp2... too ;) Come join the fray :) speeves cws
Re: AuthenNTLM - Help
Stas Bekman wrote: Francisco de Assis Tristão wrote: Frank, please, i am trying to configure AuthenNTLM on a solaris 2.8 (SPARC) machine. But i did not find any sample about how to configure httpd.conf. May you help me? I had compiled apache 2 version 2.0.46 with ssl suport (i am configuring it with mod_jk and Tomcat too). Do i need to have mod_perl installed? You certainly need to have mod_perl installed. This and other questions are answered at http://perl.apache.org/. However I'm not sure whether this module has been ported to mod_perl 2.0. Therefore you probably need to either port it, or use mod_perl 1.0, in case it wasn't ported yet. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com I am in the process of porting it now. Will hopefully have a working version in the next couple of days. Francisco, check out the documentation using perldoc: perldoc Apache::AuthenNTLM There is an example for the httpd.conf configuration in there. I'll keep you posted on the port, and will announce when and where I have a working version. The author is only excepting patches for the mod, so will probably take a little time for him to get my changes implemented into the indexed version. (Will also keep you posted on that... :) ) speeves cws
Re: module ported and doc addition...
Stas Bekman wrote: Shannon Eric Peevey wrote: Shannon Eric Peevey wrote: Hi! Just wanted to let everyone know that I have just finished porting the Apache-AuthExpire module to work with both modperl1 and 2. It is a: # Small mod_perl handler to provide Authentication phase time outs for # sensitive areas, per realm. There are some issues with konqueror, mozilla and netscape, but should be a simple fix if someone is watching the headers Great, I've updated the online list of ported modules. Thanks :) Possible documentation inclusion...?: When using a ternary conditional in conjunction with a conditional operator, I needed to enclose the statement with parentheses to force the ternary conditional to be executed first. For example: my ($res, $sent_pw) = $r-get_basic_auth_pw; return $res if $res != (MP2 ? Apache::OK : Apache::Constants::OK); # return not OK status if not OK well, this is not a mod_perl issue. '=~' has a higher precedence than '?:' http://www.perldoc.com/perl5.8.0/pod/perlop.html#SYNOPSIS Also, you don't realy have to do that. The old ala mp1 style works just fine. use Apache::Const qw(OK DECLINED) sub handler { return OK; } Well... I must have been smoking crack, 'cause I seem to remember a simple: return MP2 ? Apache::OK : OK throwing an error, hence, the change to: MP2 ? Apache::OK : Apache::Constants::OK Now that I test it, though, there doesn't seem to be a problem... :P Took me a while to catch that... :P speeves cws Is J. J. Horner on this list? (Are you out there...? :)) ) If so, can you contact me about getting permissions to upload the Apache-AuthExpire mod that I have ported? (So it can be indexed by PAUSE.) Also, Stas, is there a way that I can get around having to wait for an author to upload a ported module? I am not adding any functionality except making it work with both versions of modperl, and making additions that the CPAN testers have requested. I have a clear window for now, and would like to keep on porting mods while I have a little extra time... You can always upload a module, however it won't be indexed and then it's going to be a pain to reindex, since you will have to ask Andreas to do that. So I'd get the permissions resolved first. If you can't reach the original author you should email [EMAIL PROTECTED] explaining the situation and asking to give you the right perms (nowadays CPAN supports co-owners of namespaces). Meanwhile upload it somewhere online and post the link here, I'll link to it from: /http://perl.apache.org/products/apache-modules.html Thanks. I have received that permission from Mr. Horner since I have written this email. I have contacted the [EMAIL PROTECTED] gang, but they haven't responded yet. (No problems, as I am about to start on Apache-AuthNTLM.) I will upload another version to CPAN when they give me authorization. :) Also, I have ported: Apache-AuthenPasswd Apache-AuthzPasswd with notices as to the limitations of these modules. (I inherited these with the AuthenNIS mods... Haven't had a chance to port those yet, though.) They have been uploaded and indexed on CPAN. Also need to get excited about getting the authperlldap mod done as well... :) thanks, speeves cws
Re: informational notice in Makefile.PL
Stas Bekman wrote: Shannon, can you please post this follow up to the list? Sorry, thought I got... Eric Peevey wrote: Stas Bekman wrote: Shannon Eric Peevey wrote: Hi! In an attempt to simplify the install process for dependencies with my modules, I have been using the ExtUtils::AutoInstall module. (Great module, BTW :) ) But, with the current state of affairs with mod_perl and its availability from CPAN, I wanted to through an information notice to the effect of, if you are planning to use mod_perl2 and apache2, you will have to answer no here, and manually download it from perl.apache.org... I contacted Autrijus Tang, the maintainer of ExtUtils::AutoInstall, and asked him if it was possible, (I didn't see it documented), and he answered with this: # notify the user about mod_perl 2 BEGIN { print q{ NOTICE * If you are planning to use mod_perl2 and Apache2, please, do not answer yes when prompted to install mod_perl. You will need to download mod_perl2 manually from http://perl.apache.org/download/index.html * } } I placed it after the first BEGIN block and voila! I am communicating :) Are you talking about the dependencies list? by 'the current state of affairs with mod_perl 2.0', you mean that it's not indexed by PAUSE. It's available from CPAN. Actually, once it gets indexed by CPAN it'll break all the other modules which specify mod_perl (1.0) as a dependency and won't work with 2.0. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com Hi! Since I am automating the download for the dependencies in the Makefile.PL, I need to let the people know that they cannot automatically download mod_perl 2 using my makefile. They will instead need to download it from the appropriate site and install it manually. That is why I am putting a notice in the Makefile.PL. speeves cws
Re: Stupid question of the day...
Randy Kobes wrote: On Wed, 25 Jun 2003 [EMAIL PROTECTED] wrote: I've built and installed a new Apache (2.0.46) with mod_ssl and mod_perl... My goal is authentication via NIS, so I have the following in an .htaccess file: AuthName TEST AuthType Basic PerlAuthenHandler Apache::AuthenNIS; require valid-user My efforts, however, have been thwarted by the following error message: Wed Jun 25 15:44:54 2003] [error] failed to resolve handler `Apache::AuthenNIS;' [Wed Jun 25 15:44:55 2003] [error] [client xxx.xxx.xxx.xxx] Can't locate object method boot via package mod_perl::boot at /opt/apache/lib/perl/Apache/Constants.pm line 8. Compilation failed in require at /opt/apache/lib/perl/Apache/AuthenNIS.pm line 4. BEGIN failed--compilation aborted at /opt/apache/lib/perl/Apache/AuthenNIS.pm line 4. Compilation failed in require at (eval 6) line 1. Apache::Constants is a mod_perl 1 package, whereas you're using mod_perl 2 (for Apache 2). If use of Apache::compat isn't enough to get this working, some porting of the module may be required - see the discussion of porting Apache Perl modules from mod_perl 1 to 2 at http://perl.apache.org/. Feel free to contact me, as well. I have contacted the author about porting the module, and if I can use you as a test environment, I can this ported rather quickly :) (I don't have a NIS environment for me to test on, but I can make the changes, and you can test the install for me, and then we can get this mod to work for both versions of modperl...) Anyone have an installation of apache 1 that is using NIS for authentication? (I will need to be able to test the ported mod for compatibility with modperl 1, as well.) speeves cws PS We should probably attack Apache::AuthzNIS at the same time... It isn't much more work :)
Re: Apache::AuthenNTLM problems
Brett Hales wrote: On Fri, 2003-06-13 at 01:53, Luiz Carlos (Paulista) wrote: Hi, I´m trying to install Apache in a Linux Machine, with mod_perl and AuthenNTLM. I want to authenticate users from a Windows 2000 domain. I don´t want them to be prompted for their username and password. These are the softwares I have installed: Red Hat Linux 8.0, Samba -2.2.8(use winbind for authentication), Apache 2.0.45, mod_perl-1.99_09, Apache-AuthenNTLM-023. My test directory is configured like this: Alias /ntlm/ /home/httpd/ntlm/ Directory /home/httpd/ntlm/ PerlAuthenHandler Apache::AuthenNTLM AuthType ntlm,basic AuthName NTLM-AREA Require valid-user PerlAddVar ntdomain sede BATUTAS PerlSetVar defaultdomain sede PerlSetVar ntlmdebug 1 /Directory Also I have included in httpd.conf the following statements for mod_perl LoadModule perl_module modules/mod_perl.so PerlRequire /home/httpd/perl/startup.pl PerlSwitches -wT I am not expert neither in Linux nor in Perl and I would apreciate any sugestions. I have this successfully working with Mod_Perl 1.27 When you get this working can you please test something for me, change your Windows password to include a : (colon). I believe that there is a bug in the AuthenNTLM module and would like somebody else to verify this. Thanks, Luiz Carlos -8-- Start Bug Report 8-- 1. Problem Description: When I try to access the URL the following error is received by IE 6.0 browser: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.0.45 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.45 OpenSSL/0.9.6b Server at catapulta Port 80 The error loged in error_log is: Use of uninitialized value. [Fri May 30 07:24:37 2003] [error] [client 192.168.1.73] Can't call method connection on an undefined value at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache/AuthenNTLM.pm line 480. Line 480 in AuthenNTLM.p is the following: sub handler ($$) { my ($class, $r) = @_ ; my $type ; my $nonce = '' ; my $self ; my $conn = $r - connection ; my $connhdr = $r - header_in ('Connection') ; (LINE 480 REPORTED IN THE BROWSWER) my $fh = select (STDERR) ; $| = 1 ; select ($fh) ; I have also noticed that the handle module AuthenNTLM.pm (line 32) was trying to use Apache::Constants. This module does not exist. So, I changed it to Apache::Const. After that I have been faced to the error in line 480. 2. Used Components and their Configuration: *** using lib/Apache/BuildConfig.pm *** Makefile.PL options: MP_AP_PREFIX = /usr/local/apache2 MP_COMPAT_1X = 1 MP_GENERATE_XS = 1 MP_LIBNAME = mod_perl MP_USE_DSO = 1 MP_USE_STATIC = 1 *** /usr/local/apache2/bin/httpd -V Server version: Apache/2.0.46 Server built: Jun 2 2003 11:21:42 Server's Module Magic Number: 20020903:3 Architecture: 32-bit Server compiled with -D APACHE_MPM_DIR=server/mpm/prefork -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT=/usr/local/apache2 -D SUEXEC_BIN=/usr/local/apache2/bin/suexec -D DEFAULT_PIDLOG=logs/httpd.pid -D DEFAULT_SCOREBOARD=logs/apache_runtime_status -D DEFAULT_LOCKFILE=logs/accept.lock -D DEFAULT_ERRORLOG=logs/error_log -D AP_TYPES_CONFIG_FILE=conf/mime.types -D SERVER_CONFIG_FILE=conf/httpd.conf *** /usr/bin/perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 2002 i686 i686 i386 gnulinux ' config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localhost [EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef
informational notice in Makefile.PL
Hi! In an attempt to simplify the install process for dependencies with my modules, I have been using the ExtUtils::AutoInstall module. (Great module, BTW :) ) But, with the current state of affairs with mod_perl and its availability from CPAN, I wanted to through an information notice to the effect of, if you are planning to use mod_perl2 and apache2, you will have to answer no here, and manually download it from perl.apache.org... I contacted Autrijus Tang, the maintainer of ExtUtils::AutoInstall, and asked him if it was possible, (I didn't see it documented), and he answered with this: # notify the user about mod_perl 2 BEGIN { print q{ NOTICE * If you are planning to use mod_perl2 and Apache2, please, do not answer yes when prompted to install mod_perl. You will need to download mod_perl2 manually from http://perl.apache.org/download/index.html * } } I placed it after the first BEGIN block and voila! I am communicating :) Hope this helps someone. speeves cws
module ported and doc addition...
Hi! Just wanted to let everyone know that I have just finished porting the Apache-AuthExpire module to work with both modperl1 and 2. It is a: # Small mod_perl handler to provide Authentication phase time outs for # sensitive areas, per realm. There are some issues with konqueror, mozilla and netscape, but should be a simple fix if someone is watching the headers Possible documentation inclusion...?: When using a ternary conditional in conjunction with a conditional operator, I needed to enclose the statement with parentheses to force the ternary conditional to be executed first. For example: my ($res, $sent_pw) = $r-get_basic_auth_pw; return $res if $res != (MP2 ? Apache::OK : Apache::Constants::OK); # return not OK status if not OK Took me a while to catch that... :P speeves cws
Re: module ported and doc addition...
Shannon Eric Peevey wrote: Hi! Just wanted to let everyone know that I have just finished porting the Apache-AuthExpire module to work with both modperl1 and 2. It is a: # Small mod_perl handler to provide Authentication phase time outs for # sensitive areas, per realm. There are some issues with konqueror, mozilla and netscape, but should be a simple fix if someone is watching the headers Possible documentation inclusion...?: When using a ternary conditional in conjunction with a conditional operator, I needed to enclose the statement with parentheses to force the ternary conditional to be executed first. For example: my ($res, $sent_pw) = $r-get_basic_auth_pw; return $res if $res != (MP2 ? Apache::OK : Apache::Constants::OK); # return not OK status if not OK Took me a while to catch that... :P speeves cws Is J. J. Horner on this list? (Are you out there...? :)) ) If so, can you contact me about getting permissions to upload the Apache-AuthExpire mod that I have ported? (So it can be indexed by PAUSE.) Also, Stas, is there a way that I can get around having to wait for an author to upload a ported module? I am not adding any functionality except making it work with both versions of modperl, and making additions that the CPAN testers have requested. I have a clear window for now, and would like to keep on porting mods while I have a little extra time... Thanks! speeves cws
doc discrepancy?
Hi! Just doing some late night reading, and found something in the second paragraph under the PerlAuthenHandler heading in the following webpage: http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlAuthenHandler !--- Otherwise the handler returns *|Apache::AUTH_REQUIRED|* to indicate that the user has not authenticated successfully. --- According to: http://perl.apache.org/docs/2.0/user/porting/compat.html#Deprecated_Constants AUTH_REQUIRED is depracated in favor of HTTP_UNAUTHORIZED. Is Apache actually returning AUTH_REQUIRED, which is then aliased behind the scenes? (I have been using HTTP_UNAUTHORIZED successfully in conjunction with both versions of modperl...) thanks, speeves cws
Re: list of ported modules?
Stas Bekman wrote: Shannon Eric Peevey wrote: Hi! Is there a list of CPAN modules that have already been ported to work with mod_perl2? Not at the moment, but it's a great idea. Where should we add it? I suppose that this should be a short-life document and eventually it will be removed. So we can put it anywhere. there is: http://perl.apache.org/products/apache-modules.html we could put a section there. That looks like a great place to me :) (BTW, should we make it dynamically updateable, to encourage participation in the list?) What do we have now: Already ported: --- CGI CGI::Cookie Apache::Peek Apache::AuthNetLDAP Apache::AuthzNetLDAP In the process: Module Porters Apache::MP3 Stas Bekman/Clemens Schrimpe [EMAIL PROTECTED] Apache::Scoreboard Stas Bekman Apache::VMonitor Stas Bekman Apache::AuthPerLDAP Shannon Eric Peevey [EMAIL PROTECTED] Anything else I have missed? If you have ported a module or in the middle of porting please tell us. the latter should list the email of the porter so the interested parties can help with the porting. If so, can I add my two modules to it? (Apache::AuthNetLDAP and Apache::AuthzNetLDAP). are they on CPAN already? Yes :) I uploaded Apache::AuthzNetLDAP yesterday. speeves cws
Apache::Auth*LDAP modules going bye-bye...?
Hi! I have installed Apache::AuthenLDAP into my apache 1.3 test machine, and found that version 0.61 does not work with perl-ldap 0.28 (aka Net::LDAP) Since there has not been an update to this module since July 12, 2001, I think that it is safe to say that there is no interest in continuing to support this module. (BTW, I found the same offending code in Apache::AuthzLDAP.) I have compared the functionality of these two module to Apache::AuthNetLDAP and Apache::AuthzNetLDAP, and found that the latter two modules contain all of the functionality of the Bodnar/Gilmore modules, plus some. (NOTE: Apache::AuthzLDAP does have a NestedGroups functionality that will allow recursive searching through... nested groups ;) Is this useful for anyone? If so, then we can add it into Apache::AuthzNetLDAP.) Therefore, I have come to the conclusion that we will not need to port these modules to modperl2... Any dissenters? Also, after perusing the code in both Apache::AuthPerLDAP and Apache::AuthLDAP, both of which have not been updated in over 4 years, I see that all functionality is also available in Apache::AuthNetLDAP. I also think that I will bypass porting these modules as well. Again, any dissenters? speeves cws
list of ported modules?
Hi! Is there a list of CPAN modules that have already been ported to work with mod_perl2? If so, can I add my two modules to it? (Apache::AuthNetLDAP and Apache::AuthzNetLDAP). thanks, speeves cws
Maintainers of Apache::*LDAP packages...?
Hi! I have just finished porting Apache::AuthNetLDAP to work with both modperl 1 and 2. I have been looking at some of the other packages that are lurking in this same arena, (ie Apache::AuthPerLDAP, Apache::AuthzLDAP, Apache::AuthzNetLDAP, Apache::AuthenLDAP, etc.), and was wondering what the general thoughts were about porting these as well...? Or, since they are all similar, should I focus on subsuming all of the modules into the more appropriately named Apache::AuthenLDAP and Apache::AuthzLDAP? Thanks, -- Shannon Eric Peevey - speeves Computer Systems Manager UNT - Central Web Support (940)369-8876 - This mail sent through IMP: http://horde.org/imp/
Re: Simple DAV Server?
Trevor Phillips wrote: On Wednesday 11 June 2003 05:13, you wrote: Trevor Phillips wrote: I'm quite suprised at the limited amount of custom DAV server uses. I mean, here's a protocol for editing content over HTTP, which to me screams as an ideal solution for, say, editing full HTML content within a DB/CMS. I think the problem with webDAV, as a protocol through which to manipulate web pages, lies in the fact that it is difficult to manipulate dynamic content without sending the rendered content to the client, instead of the true source. (Phew!! That was long winded... :P ) The only way that I have found to do it, is to either break the web server, (ie publish to a web server that doesn't have the dynamic language engine installed), or... (I don't know of another solution that works... :( ) I'm aware of the issue, but don't see it as a show-stopper. You could use an alternate URL to direct DAV handling to a different handler. ie; To view: /path/to/content/ To edit: /dav/path/to/content/ ... where the module associated with /dav/ knows how to retrieve the raw content (be it files, or a map to DB-stored content) of the normal path. When viewing the content, you could provide links to the edit version of the URL. This is probably not the appropriate venue for a discussion on webDAV, but I feel that this type of work-around, which I use, is not appropriate. I think that there will need to be an addition to HTTP, which will define the difference between a GET for viewing content, and a GET for publishing... Since webDAV is a standard, it should be possible to argue the need for such a device. If we can get that device introduced into HTTP, then after a time, client applications will be altered to work thus, and voila!! Until then, I find this approach to be less than satisfactory speeves cws
Re: modules that work with both modperl1 and 2
Stas Bekman wrote: speeves wrote: Stas Bekman wrote: [...] http://search.cpan.org/src/STAS/Apache-Peek-1.01/t/response/TestApachePeek/basic.pm This source code was the saving grace for me. If we could add the link to: http://search.cpan.org/src/STAS/Apache-Peek-1.01/t/response/TestApachePeek/basic.pm into the documentation, that would be great. hat did it!!! Thank you so much for your patience and help with all that I am working on here. After I test these changes on modperl 1 tomorrow, I should be able to upload it to CPAN, and it will be ready for prime-time... (fingers crossed ;) ) Based on your porting experience if you have additions/corrections to these two documents: http://perl.apache.org/docs/2.0/user/porting/porting.html http://perl.apache.org/docs/2.0/user/porting/compat.html please submit those here. BTW, I have updated the info on the constants: http://perl.apache.org/docs/2.0/user/porting/compat.html#mod_perl_1_0_and_2_0_Constants_Coexistence __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com Also, it would probably be nice to have a link from: http://perl.apache.org/docs/2.0/user/porting/porting.html#Making_Code_Conditional_on_Running_mod_perl_Version to http://perl.apache.org/docs/2.0/user/porting/compat.html#mod_perl_1_0_and_2_0_Constants_Coexistence that would help the porter to understand the overall picture of what needs to be done to allow the single code-base to work with both mod_perls... Finally, I found that the PAUSE server did not recognize the $VERSION number, (returned as undef), until I placed it above the BEGIN {} block as following: package Apache::AuthNetLDAP; use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use Net::LDAP; use mod_perl; require Exporter; @ISA = qw(Exporter AutoLoader); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. @EXPORT = qw( ); $VERSION = '0.21'; # setting the constants to help identify which version of mod_perl # is installed use constant MP2 = ($mod_perl::VERSION = 1.99); # test for the version of mod_perl, and use the appropriate libraries BEGIN { if (MP2) { require Apache::Const; require Apache::Access; require Apache::Connection; require Apache::Log; require Apache::RequestRec; require Apache::RequestUtil; Apache::Const-import(-compile = 'HTTP_UNAUTHORIZED','OK'); } else { require Apache::Constants; Apache::Constants-import('HTTP_UNAUTHORIZED','OK'); } } # Preloaded methods go here. #handles Apache requests sub handler { ... } Thanks again for all of your help! If you know of any modules that need porting in a like manner, feel free to contact me and I would be happy to help out. speeves cws
modules that work with both modperl1 and 2
Hi! Just wondering if anyone knows of a perl module that is coded to work with modperl1 and 2? I am hitting a wall in getting my module to do that, and want to cheat a little off of someone who already has... ;) thanks, speeves cws PS Am having problems with the compile time loading of modules depending on the existence of either modperl1 or 2... use dies and require is not importing the symbols correctly at runtime... My bad for not completely understanding how to use require. (Am trying to work this out as we speak.) Thanks again!
Re: modules that work with both modperl1 and 2
Perrin Harkins wrote: On Mon, 2003-06-09 at 12:12, Shannon Eric Peevey wrote: PS Am having problems with the compile time loading of modules depending on the existence of either modperl1 or 2... use dies and require is not importing the symbols correctly at runtime... If you read the docs for use (perldoc -f use), you will see that use is just like: BEGIN { require Module; import Module LIST; } If you want to import things correctly when using require, you have to call import yourself. - Perrin Yeah, I've been messing with that, but it seems to me that I need something similar to a preprocessor directive, where I can load the appropriate use MODULE lines into the module bases upon which version of modperl they have installed. Is it possible to use the BEGIN {} subroutine as this? speeves cws
Re: modules that work with both modperl1 and 2
Perrin Harkins wrote: On Mon, 2003-06-09 at 13:57, Shannon Eric Peevey wrote: Yeah, I've been messing with that, but it seems to me that I need something similar to a preprocessor directive, where I can load the appropriate use MODULE lines into the module bases upon which version of modperl they have installed. Is it possible to use the BEGIN {} subroutine as this? You don't need a preprocessor. You can call require inside an if/else conditional, unlike use() statements which run at compile time and skip the conditional logic. For example: if ($mod_perl::VERSION = 1.99) { require Apache2::Module; import Apache2::Module; } else { require Apache1::Module; import Apache1::Module; } You can put that whole construct in a BEGIN block if you want to. That will make it run before the rest of the code in the current package. - Perrin Ok, I'm back... :( Here is the code, modified to use require: use mod_perl; # setting the constants to help identify which version of mod_perl # is installed use constant MP2 = ($mod_perl::VERSION = 1.99); # test for the version of mod_perl, and use the appropriate libraries # if (!MP2) { use Apache::Constants qw(:common); } if (MP2) { require Apache::Const; import Apache::Access; require Apache::Access; import Apache::Access; require Apache::Connection; import Apache::Connection; require Apache::Log; import Apache::Log; require Apache::RequestRec; import Apache::RequestRec; require Apache::RequestUtil; import Apache::RequestUtil; } Here is the code that is coughing up the error: 102 #Look for user based on UIDAttr 103 104my $attrs = ['dn']; 105 $mesg = $ldap-search( 106 base = $basedn, 107 scope = 'sub', 108 filter = ($uidattr=$user), 109 attrs = $attrs 110 ); 111 112 if (my $error = $mesg-code()) 113{ 114 $r-note_basic_auth_failure; 115 MP2 ? $r-log_error(user $user: LDAP Connection Failed: $error,$r-uri) : $r-log_reason(us er $user: LDAP Connection Failed: $error,$r-uri); 116 MP2 ? return Apache::Log-HTTP_UNAUTHORIZED : return Apache::Constants-HTTP_UNAUTHORIZED; 117} 118 119unless ($mesg-count()) 120{ 121 $r-note_basic_auth_failure; 122 MP2 ? $r-log_error(user $user: user entry not found for filter: $uidattr=$user,$r-uri) : $ r-log_reason(user $user: user entry not found for filter: $uidattr=$user,$r-uri); 123 MP2 ? return Apache::Log-HTTP_UNAUTHORIZED : return Apache::Constants-HTTP_UNAUTHORIZED; 124} And, here is the error that I am getting in the Apache2 logs, (using mod_perl 1.99_09) [Mon Jun 09 13:45:30 2003] [error] user asdf: user entry not found for filter: uid=asdf/ [Mon Jun 09 13:45:30 2003] [error] [client 127.0.0.1] Can't locate object method HTTP_UNAUTHORIZED via package Apache::Log (perhaps you forgot to load Apache::Log?) at /usr/local/share/perl/5.6.1/Apache/AuthNetLDAP.pm line 123. As you can see, it is running everything up to the HTTP_UNAUTHORIZED constant... If you have any ideas, I would greatly appreciate it. :) Thanks, speeves cws PS. As a matter of fact, I get the same error when using use instead... (Possibly a screwed perl or mod_perl installation? I'm running debian woody, apache 2.0.46, perl 5.6.1, mod_perl 1.99_09.)