Re: SUCCESS: libapreq working in Mac OS X
> "Joe" == Joe Schaefer <[EMAIL PROTECTED]> writes: Joe> OTOH, I'd like to solicit some feedback on yet another installation Joe> process- first making libapreq a shared library, and then linking Joe> the Perl interfaces to *that* library (instead of libapreq.a). Beware. When I made mod_perl a .so, and then loaded that, I could not load any other .so's from there, making all XS modules fail. So having an .so call an .so might not work. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
htaccess and mime types
Title: htaccess and mime types Hi all, A real newbie here with a question. I'm using an htaccess file to protect a directory of large gifs and sounds. Here is what i've written: - AuthUserFile /dev/null AuthGroupFile /dev/null RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://www.myserver.com [NC] RewriteCond %{HTTP_REFERER} !^http://myserver.com [NC] RewriteRule /* http://www.myserver.com/error.mv [R,L] - The problem i'm having is, somebody may try to directly access my directory looking for a file named "lookatme.gif", they get forwarded to the error page, but the browser receives the error page and downloads it as "lookatme.gif". Of course when the person tries to open it they get an error message because the received file is not a ".gif" file but html text. I'm reading my Apache bible and the section on MIME types and my question is: Is there a way to modify the htaccess file so that regardless of the file requested (".gif", ".wav", ".jpg", etc.) they would receive a file recognizable as an html document or a plain text file when clicked on? Any help would be greatly appreciated, Paul Williams -- == http://www.StuckMic.com/america -- The American Code Remembering the attack on America http://www.StuckMic.com -- MIVA Powered Aviation and Air Traffic Control discussion and chat. http://www.WavSounds.com -- Thousands of funny wavs, fully searchable.
Re: SUCCESS: libapreq working in Mac OS X
On Friday, February 22, 2002, at 09:58 AM, Joe Schaefer wrote: > In the interim I'll try and maintain the "experimental" versions. > Stas has been kind enough to work on adding a test suite to libapreq, > which will very likely be included in the next release. That'll be MUCH appreciated. That's been a big stumbling block in trying to figure out what the deal is with libapreq on OS X. > OTOH, I'd like to solicit some feedback on yet another installation > process- first making libapreq a shared library, and then linking > the Perl interfaces to *that* library (instead of libapreq.a). I think that sounds like a better approach than the current one, I'll try to give it a shot. I'm moving out of my apartment in the next few days though, so I might not get to it for a while. Remind me if necessary. -Ken
Re: [Samba authorization]
Write a test script using Authen::Smb and run it from the commandline. You can copy-paste the synopsis portion of the Authen::Smb documentation (i.e. perldoc Authen::Smb). If (you can connect and and authenticate from the commandline) { the problem resides in your mod_perl installation, # either an @INC problem, or re-install mod_perl. } else { problem with your Perl installation # re-install Perl } -Carlos Andrew Afliatunov wrote: > > Carlos Ramirez wrote: > > > Here are some fixes I incorporated into my private copy of > > Authen::Smb and Apache::AuthenSmb modules. These changes > > are based on some discussion I found in the modperl > > mailing list posted on Thu, 16 Sep 1999 by Matt Arnold. I > > basically copied Matt's suggestions and added them in. > > I was getting the same error messages but after I > > incorporated theses changes, it to fixed the problem on > > SUN Sparc Solaris 2.5.1..2.8. > > > > =Begin Snippet from mailing list > > > > The resulting additions to Authen::Smb look like this: > > > > use Fcntl qw(:flock); > > ... > > open S, "> /full/path/to/AuthenSmb.lck" or die "Can't open > > AuthenSmb.lck: $!\n"; > > flock S, LOCK_EX; > > my $res = Valid_User($username, $password, $server, $backup, $domain); > > > > close S; > > > > In short, I ended up adding > > the following two lines to Apache::AuthenSmb. > > > > use Memoize; > > memoize('Authen::Smb::authen'); > > > > =End of Snippet > > > > I contacted the author of Apache::AuthenSmb (a long time > > ago) and asked him if he could add these changes into > > the module. He stated he no longer has access to machines > > where he can test his module and asked me to post > > it in the modperl mailing list (which I never did). > > I used this module extensively in our environment and > > have also added some other nice features. Anyhow, if > > the author can no longer maintain it, i'd be glad ty > > update it ;) > > > > Since, this fix also requires that Authen::Smb to be > > modified, maybe the author of the cool Authen::Smb module > > add some option to allow a lock file or force it to use a > > lock file (??). > > > > Something along the lines: > > sub authen { > > my @args = @_; > > > > # Truncate everything to length 80 to avoid poor coding practices in the > > # smbvalid.a (buffer overflows) PMK--fixme in smbvalid.a when possible. > > for my $i ( 0..$#args ) { > > $args[$i] = substr($args[$i], 0, 80); > > } > > > > my($username, $password, $server, $backup, $domain, $lockfile) = @args; > > my $res; > > if ($lockfile) { > >open L, "> $lockfile" or die "Can't open AuthenSmb.lck: $!\n"; > >flock L, LOCK_EX; > >$res = Valid_User($username, $password, $server, $backup, $domain); > >close L; > > } > > else { > >$res = Valid_User($username, $password, $server, $backup, $domain); > > } > > > > return $res; > > } > > > > > > Anyhow, hope this helps. > > > > > > Please, let's continue discussing my problem. Remind you, that I > > > > installed mod_perl, Authen-Smb-0.91 and Apache-AuthenSmb-0.60 for > > > > authorization in apache against NT server. And I get this error in > > > > apache error.log file: > > > > "Undefined subroutine &Apache::AuthenSmb::handler called". > > > > In discussion we stopped at the point that I have wrong Smb.so file, > > > > because when I put "PerlModule Apache::AuthenSmb" in my httpd.conf file > > > > I get > > > > -- > > > > Syntax error on line 346 of /usr/local/apache/conf/httpd.conf: > > > > Can't load > > > > '/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/Authen/Smb/Smb.so' > > > > for > > > > module Authen::Smb: ld.so.1: /usr/local/apache/bin/httpd: fatal: > > > > relocation error: file > > > > /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/Authen/Smb/Smb.so: > > > > symbol main: referenced symbol not found at > > > > /usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206. > > > > at /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5 > > > > Compilation failed in require at > > > > /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5. > > > > BEGIN failed--compilation aborted at > > > > /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5. > > > > Compilation failed in require at (eval 3) line 3. > > > > -- > > > > when making 'apachectl configtest'. I tried to reinstall AuthenSmb with > > > > its default options (default Makefile.PL), - no success. > > > > Maybe I must install it with some different from default options? Who > > > > knows what are such options? What is configurable there? Or what may be > > > > done with my Smb.so in oder Authen:Smb to understand it? > > > > > > > > > > > > Hi! > I did suggested changes: > In Authen::Smb added lines 'use Fcntl qw(:flock);' and > -- > open S, "> /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Authen/AuthenSmb.lck" > or die "Can't open AuthenSmb.lck: $!\n"; > flo
Re: [OT] Perl compillation
El Vie 22 Feb 2002 13:47, Mithun Bhattacharya escribió: > Could someone tell me the right place to ask questions regarding > problems faced during compillation of perl 5.6.1 on i686 using gcc 3.0 > on a RedHat 7.2 installation. > > For the curious folks these are the steps I followed > -- > tar xzf stable.tar.gz > cd perl-5.6.1/ > rm -f config.sh Policy.sh > sh Configure -de > make > -- > > everything works fine till now - it even says go ahead and run make > test. but thats where the fun stuff happens. Make test fails 52 of the > 205 tests and a sample of the error message is as follows. > > -- > lib/syslfs...Can't load '../lib/auto/Fcntl/Fcntl.o' for module > Fcntl: ../lib/auto/Fcntl/Fcntl.o: ELF file's phentsize not the expected > size at ../lib/XSLoader.pm line 75. > at ../lib/Fcntl.pm line 220 > Compilation failed in require at lib/syslfs.t line 14. > BEGIN failed--compilation aborted at lib/syslfs.t line 15. > FAILED at test 0 > lib/syslog...Can't load '../lib/auto/Socket/Socket.o' for module > Socket: ../lib/auto/Socket/Socket.o: ELF file's phentsize not the > expected size at ../lib/XSLoader.pm line 75. > -- > > A google search tells me something very fundamental has gone wrong in > the installation as in the system is trying to load a file as a shared > library when it isnt - although that doesnt really help me isolate or > debug the problem. > > Ofcourse a search of the perl-beginner list archive didnt help. > > > > Regards > Mithun I am running RedHat 7.2 and i'am without problems installing perl 5.6.1. I checked ther version and is 2.96. [root@hans images]# gcc --version 2.96 [root@hans images]# ¿Du you upgrade manually gcc ? May be can downgrade to 2.96 to test. Hans Poo
Re: SUCCESS: libapreq working in Mac OS X
Ged Haywood <[EMAIL PROTECTED]> writes: > Hi there, > > On 22 Feb 2002, Joe Schaefer wrote: > > > 3) Install libapreq.so.1.0.0 (to /usr/local/lib) using: > > > > % ./configure > > % make > > % make install > > > > 4) Now install Apache::Request and Apache::Cookie using > > > > % perl Makefile.PL > > % make > > % make install > > Should that be > > % make > % su > # make install Sure. -- Joe Schaefer
Re: SUCCESS: libapreq working in Mac OS X
Hi there, On 22 Feb 2002, Joe Schaefer wrote: > John Siracusa <[EMAIL PROTECTED]> writes: [snip,snip] > 3) Install libapreq.so.1.0.0 (to /usr/local/lib) using: > > % ./configure > % make > % make install > > 4) Now install Apache::Request and Apache::Cookie using > > % perl Makefile.PL > % make > % make install Should that be % make % su # make install ? 73, Ged.
[OT] Perl compillation
Could someone tell me the right place to ask questions regarding problems faced during compillation of perl 5.6.1 on i686 using gcc 3.0 on a RedHat 7.2 installation. For the curious folks these are the steps I followed -- tar xzf stable.tar.gz cd perl-5.6.1/ rm -f config.sh Policy.sh sh Configure -de make -- everything works fine till now - it even says go ahead and run make test. but thats where the fun stuff happens. Make test fails 52 of the 205 tests and a sample of the error message is as follows. -- lib/syslfs...Can't load '../lib/auto/Fcntl/Fcntl.o' for module Fcntl: ../lib/auto/Fcntl/Fcntl.o: ELF file's phentsize not the expected size at ../lib/XSLoader.pm line 75. at ../lib/Fcntl.pm line 220 Compilation failed in require at lib/syslfs.t line 14. BEGIN failed--compilation aborted at lib/syslfs.t line 15. FAILED at test 0 lib/syslog...Can't load '../lib/auto/Socket/Socket.o' for module Socket: ../lib/auto/Socket/Socket.o: ELF file's phentsize not the expected size at ../lib/XSLoader.pm line 75. -- A google search tells me something very fundamental has gone wrong in the installation as in the system is trying to load a file as a shared library when it isnt - although that doesnt really help me isolate or debug the problem. Ofcourse a search of the perl-beginner list archive didnt help. Regards Mithun
Re: SUCCESS: libapreq working in Mac OS X
John Siracusa <[EMAIL PROTECTED]> writes: > > On Thursday, February 14, 2002, at 04:44 PM, John Siracusa wrote: > >> Next, I downloaded all the source code. Note that I'm using Joe > >> Schaefer's "special" versions of apache and libapreq. > > > > Will their changes be merged into the main distro soon? > > That's a question for Joe, I think... For the pending 1.0 release, I'm pretty sure the answer is no. We don't understand the problem with libapreq on OS X well enough to try and support it, yet. In the interim I'll try and maintain the "experimental" versions. Stas has been kind enough to work on adding a test suite to libapreq, which will very likely be included in the next release. Perhaps by then we'll have this OS X loader problem nailed as well. OTOH, I'd like to solicit some feedback on yet another installation process- first making libapreq a shared library, and then linking the Perl interfaces to *that* library (instead of libapreq.a). Here are the steps: 1) build mod_perl + apache as normal (do NOT use the experimental versions I've been providing, and be sure your modperl config options include support for Apache::Table). 2) Grab the soon-to-be-released version of libapreq-1.0 from Jim's webpage: http://www.apache.org/~jimw/libapreq-1.0.tar.gz 3) Install libapreq.so.1.0.0 (to /usr/local/lib) using: % ./configure % make % make install 4) Now install Apache::Request and Apache::Cookie using % perl Makefile.PL % make % make install You might need to use "ldconfig" to tell ld.so where libapreq's shared library is. 5) report successes/failures using this approach on OS X to [EMAIL PROTECTED] Thanks again. -- Joe Schaefer
hvrv2table in mod_perl stops me using mod_php DSO
Hi, I'm trying to get the php module to work on Apache_1.3.22 under AIX 4.3.3. This works OK if I load mod_perl dynamically, but if I build mod_perl in statically, when httpd loads libphp4.so it gives a segmentation error. I've tried recompiling but that's made no difference. Everything was compiled using the Visual Age C compiler 5.0.2.0 (including my perl installation which is version 5.005_03). I've run a debug on it and it always seems to hit hvrv2table which appears to be a function in mod_perl. Unfortunately I can't tell from the debugger which line of code this is. Are there any known problems with this function? JS. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
Re: When handlers misfire
On Thursday 21 February 2002 05:21 pm, Rick Myers wrote: > On Feb 21, 2002 at 15:23:04 -0800, Milo Hyson wrote: > > On Wednesday 20 February 2002 07:55 pm, Geoffrey Young wrote: > > > > If the redirected request needs that session > > > > data, there's a small chance it won't be there yet. > > > > > > have you seen this? I don't recall this ever coming up before (which > > > doesn't mean it can't happen :) > > > > Yes, I have seen it happen. Quite frequently in fact. My investigation > > into the problem is how I discovered the cleanup handler wasn't doing its > > job in time. > > Want to see something even more interesting? Let your > debugging warnings mention the pid that caused the log > entry and let it run a while on a production server. I see > stuff like... To add to all of this, since installing the fixup and cleanup/log handlers, I've noticed problems shutting down Apache. When running apachectl stop, I see numerous messages in the logs about the child processes not shutting down and having to be SIGKILLed. Yesterday however, I relocated my session management code into Apache::Registry. This seems to solve all my problems. In fact, it may even open a few additional doors :) -- Milo Hyson CyberLife Labs, LLC