[DIGEST] mod_perl digest 11/19/2000
-- mod_perl digest November 19, 2000 - November 25, 2000 -- Recent happenings in the mod_perl world... Features o mod_perl status o module announcements o mailing list highlights o FAQ of the week o links mod_perl status o mod_perl - stable: 1.24_01 (released October 10, 2000) [1] - development: 1.24_02-dev [2] o Apache - stable: 1.3.14 (released October 13, 2000) [3] - development: 1.3.15-dev [4] o Perl - stable: 5.6 (released March 23, 2000) [5] - development: 5.7 [6] module announcements o HTTP::GHTTP 1.0 - a lightweight HTTP client library based on the gnome libghttp library [7] mailing list highlights It was another relatively slow week... o Some discussion on the future of libapreq - such as possible ToDo items, various bugs that need attention, and the possibility of a new maintainer - has been started [8] o SDBM_File, BerkeleyDB, and DB_File are compared in an interesting thread discussing a new caching module MLDBM::Sync [9] [10] [11] o A patch was submitted to DBI::ProxyServer and Net::Daemon which together allow for a tricky DBI connection pooling scheme based on DBI::connect_cached() [12] o A minor bug was found in Apache::test [13] FAQ of the week o After restarting Apache I can't see the changes I made to my handlers or other perl modules - how do I get mod_perl to see the changes? Sending Apache the HUP signal, via apachectl restart or kill -HUP, only reads changes to your httpd.conf file - it does not refresh content of the perl modules themselves. This makes module development a bit more tedious so, of course, there are some easy solutions available. Apache::StatINC is included in the base mod_perl distribution, but is not recommended for production use due to its rather large overhead. Apache::Reload, available on CPAN, is a modified version of Apache::StatINC that allows for greater control over reload behavior. The PerlFreshRestart directive is also available, but frequently reported to be less than fully stable. links o The Apache/Perl Integration Project [14] o mod_perl documentation [15] o mod_perl modules on CPAN [16] o mod_perl homepage [17] o mod_perl list archives [18] [19] happy mod_perling... --Geoff [EMAIL PROTECTED] -- [1] http://perl.apache.org/dist/ [2] http://perl.apache.org/from-cvs/modperl/ [3] http://www.apache.org/dist/ [4] http://dev.apache.org/from-cvs/apache-1.3/ [5] http://www.perl.com/pub/language/info/software.html#stable [6] http://www.perl.com/pub/language/info/software.html#devel [7] http://forum.swarthmore.edu/epigone/modperl/horgunkhon [8] http://forum.swarthmore.edu/epigone/modperl/clendcharal [9] http://forum.swarthmore.edu/epigone/modperl/rixfrasmoi [10] http://forum.swarthmore.edu/epigone/modperl/syspexclar [11] http://forum.swarthmore.edu/epigone/modperl/stultwelddwimp [12] http://forum.swarthmore.edu/epigone/modperl/clojixbang [13] http://forum.swarthmore.edu/epigone/modperl/maysolsnimp [14] http://perl.apache.org [15] http://perl.apache.org/#docs [16] http://www.perl.com/CPAN-local/modules/by-module/Apache/ [17] http://www.modperl.com [18] http://forum.swarthmore.edu/epigone/modperl/ [19] http://archive.covalent.net/modperl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OFF] strace
I'm trying to debug an intermittant problem on a Dec Unix server, and have gotten to the point where I need to use strace. On Dec Unix, strace wants a module ID, not a process ID. Anyone here familiar with Dec Unix? Steve Cochran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
replacing a directory specific legacy CGI
Good morning, gang. As we migrate to mod_perl, we have one major CGI that is scattered all over the site. It is directory local and reads config files to adjust its output. Currently we have one copy in cgi-bin and quite literally hundreds of symlinks to it from all over the site. We want to rewrite this in modperl, but I was concerned about the memory usage of cacheing each local copy. If we put all the pertinent code into a single module and just make all the local versions call a processing method, won't the actual working code still be retained in the module namespace? Since the interpreter is embedded in the server, that should mean that all the little cached versions are just something like "sub handler { Module-method; }", right? It just has to compile and store the hook? Is that worth worrying about, or am I misinterpreting? Many thanks, and happy holidays. =o) __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OFF] strace
On Mon, Nov 27, 2000 at 10:36:15AM -0500, Stephen A. Cochran wrote: I'm trying to debug an intermittant problem on a Dec Unix server, and have gotten to the point where I need to use strace. On Dec Unix, strace wants a module ID, not a process ID. Anyone here familiar with Dec Unix? Well, that strace under DEC Unix is not what you think, it is a System V streams trace utility. As far as I know there is no system call trace utility on DEC Unix. -- Jens-Uwe Mager HELIOS Software GmbH Steinriede 3 30827 Garbsen Germany Phone: +49 5131 709320 FAX:+49 5131 709325 Internet: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using MHonArc inside of mod_perl
I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. It was suggested by Earl Hood (author of MHonArc) that I tie a string to a filehandle and then dup the filehandle to STDOUT. This sounds great, but I am unsure where to place the code that will allow for this or how this needs to be done with mod_perl. (I read perltie and perlopentut, but it didn't light any bulbs). I got some results, but none that produced the desired results. The closest was getting the output to be directed to the resulting HTML page, but not the variable. I saw a email from 97 in the mod_perl archives that discussed untie *STDOUT and then retying it back to Apache after the section of code was complete, but it showed STDOUT being linked to a file open, how could I assign that to a tied string then a filehandle as suggested by Earl Hood? Is anything like this bulit into mod_perl or another module at this time? http:[EMAIL PROTECTED] The process_input function is running under mod_perl. If any other information is needed please let me know. I have a horribly ugly hack working currently, but it prevents MHonArc from running in a normal manner (i.e. processing mailinglists) Aaron Johnson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_perl-1.24_01 problems under AIX
It was suggested that someone on this list may be able to help with this. I seem to be having difficulty in getting mod_perl to build. I have tried two different versions (mod_perl-1.24 and mod_perl-1.24_01) but both seem to exhibit problems but not the same problems. Platform is an IBM RISC6000 running AIX 4.2.1 and egcs1.1.1 compiler. Apache is apache_1.3.14 and it builds okay. perl Makefile.PL Error Output for sanity check cd ..; gcc -DAIX=42 -U__STR__ -DAIX_BIND_PROCESSOR -DUSE_HSREGEX -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED -DMOD_PERL -lm -o helpers/dummy helpers/dummy.c `perl /home/wrm/packages/mod_perl-1.24/src/modules/perl/ldopts ` Note (probably harmless): No library found for -ldb gcc: installation problem, cannot exec `cpp': No such file or directory gcc: file path prefix `/usr/local/lib/gcc-lib/E:/usr/local/lib/perl5/5.00502/aix/CORE/perl.exp/egcs-2.91.60/' never used make: The error code from the last command is 1. Any assistance or suggestions would be appreciated. Regards Bill -- William R. Mattil | Micro$ofts definition of 24x7 is 24 Hours Sr. System Aministrator | out of 7 days (972) 399-4106 | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxy adding headers
On Mon, 27 Nov 2000, Sander van Zoest wrote: Unfortunately, it seems that when I proxy I get the above added so I have to serve streaming audio directly from the mod_perl server, which is less than ideal in terms of resource use. If you mena you rewrite to mod_proxy, then mod_proxy does not fill headers{in} it simply ships what it gets from the remote server with the content and ships that. You would need to hack mod_proxy for it parse the headers and provide them to you in the normal request_rec structures. I have don't this before, but do not have rights to the code to post the patch, sorry. :-( Actually, something is _adding_ headers and I want it to stop doing it. It may not be mod_proxy, perhaps it is mod_rewrite. I really don't know. -dave /*== www.urth.org We await the New Sun ==*/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Apache::DBI under mod_perl!!
I had some similar problem before. It was caused by the "PerlFreshRestart on". Comment this line out and see what happens. Jason -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Edmar Edilton da Silva Sent: Thursday, November 23, 2000 5:40 AM To: [EMAIL PROTECTED] Subject: Problem with Apache::DBI under mod_perl!! Hi all, I have installed on the my machine the following modules: apache 1.3.12-2 perl-5.00503-10 mod_perl 1.21-10 DBI 1.14 Apache::DBI 0.87 For enable the mod_perl module, I added the below code in the configuration file of apache ("httpd.conf"): # If the perl module is installed, this will be enabled. IfModule mod_perl.c PerlFreshRestart On Alias /perl-bin/ /home/httpd/perl-bin/ Location /perl-bin SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader On Options +ExecCGI /Location /IfModule For load the Apache::DBI module, I also added this line in the "httpd.conf" file: PerlRequire /etc/httpd/conf/startup.pl Inside of "startup.pl" file, I added the following code: #!/usr/bin/perl use strict; # Extend @INC if needed use lib qw(/dir/foo /dir/bar); # Make sure we are in a sane environment. $ENV{MOD_PERL} or die "not running under mod_perl!"; # For things in the "/perl-bin" URL use Apache::Registry; # Load Perl modules of your choice here # This code is interpreted *once* when the server starts use Apache::DBI (); $Apache::DBI::DEBUG = 2; $Apache::AuthDBI::DEBUG = 2; use DBI (); # Tell me more about warnings use Carp (); $SIG{__WARN__} = \Carp::cluck; # Load CGI.pm and call its compile() method to precompile # (but not to import) its autoloaded methods. use CGI (); CGI-compile(':all'); #Initialize the database connections for each child Apache::DBI-connect_on_init ("dbi:Oracle:ora8", "travel", "travel", { PrintError = 1, # Warn() on errors RaiseError = 0, # Don't die on error AutoCommit = 1, # Commit executes immediately } ); But, when I try loading a HTML page of WWW server, the server refuse my request. I think that the problem is in the WWW server that don't load their child process because to the Apache::DBI to be with some problem. During the installation of all the modules didn't have any problem. The apache start correctly, but when I try stoping them, I get a error message that the process failed. Locking the configuration files, can anyone tell me what is happening? Any help will very appreciated. Edmar Edilton da Silva Bacharel em Ciência da Computacão - UFV Mestrando em Ciência da Computacão - UNICAMP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: replacing a directory specific legacy CGI
--- "Randal L. Schwartz" [EMAIL PROTECTED] wrote: "Paul" == Paul [EMAIL PROTECTED] writes: Paul Good morning, gang. Paul As we migrate to mod_perl, we have one major CGI that is Paul scattered all over the site. It is directory local and Paul reads config files to adjust its output. Currently we Paul have one copy in cgi-bin and quite literally Paul hundreds of symlinks to it from all over the site. Paul We want to rewrite this in modperl, but I was Paul concerned about the memory usage of cacheing Paul each local copy. Huh? If you're talking about using Apache::Registry, STOP. Just write a module, define it as the handler for each of those directory contents, and you're done. Apache::Registry is meant as a stopgap until you learn to write real handlers. You've just now graduated. :) Oh, my you mean, just install a default handler that does what that CGI has been doing? ...lol, that's too easy, Randall. Surely something must go wrong! LOL!!! Honestly, it hadn't occurred to me. There is one problem, though -- currently, the server uses the precedence of index files to decide how to handle things. The CGI is our default, but we don't use it in all directories, and I'd rather not have to hardcode them into the httpd.conf -- though I could assign the handler in a local .htaccess, couldn't I! Then each directory would have the .htaccess file telling to use that handler (or not)? Between that and the Embperl I just installed -- but mostly that -- I think you just solved my problem. Many thanks. Paul PS -- I *just* finally found the "Schwartzian Transform" in "Mastering Algorithms with Perl". Let me add my own pat to your semi-famous back. It really is an elegant solution to a common problem. ;o] PH __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using MHonArc inside of mod_perl
On Mon, 27 Nov 2000, Aaron Johnson wrote: I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. It was suggested by Earl Hood (author of MHonArc) that I tie a string to a filehandle and then dup the filehandle to STDOUT. This sounds great, but I am unsure where to place the code that will allow for this or how this needs to be done with mod_perl. (I read perltie and perlopentut, but it didn't light any bulbs). I got some results, but none that produced the desired results. The closest was getting the output to be directed to the resulting HTML page, but not the variable. How about tie()? Something that I've just added to the guide: http://perl.apache.org/guide/porting.html#STDIN_STDOUT_and_STDERR_streams I saw a email from 97 in the mod_perl archives that discussed untie *STDOUT and then retying it back to Apache after the section of code was complete, but it showed STDOUT being linked to a file open, how could I assign that to a tied string then a filehandle as suggested by Earl Hood? Is anything like this bulit into mod_perl or another module at this time? http:[EMAIL PROTECTED] The process_input function is running under mod_perl. If any other information is needed please let me know. I have a horribly ugly hack working currently, but it prevents MHonArc from running in a normal manner (i.e. processing mailinglists) Aaron Johnson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://jazzvalley.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxy adding headers
On Mon, 27 Nov 2000, Dave Rolsky wrote: Actually, something is _adding_ headers and I want it to stop doing it. It may not be mod_proxy, perhaps it is mod_rewrite. I really don't know. Normally the mod_proxy code doesn't touch the headers, it simply sends the headers on from the remote server you are proxying too. I doubt it is mod_rewrite but it could be. The extra headers are probably coming from your remote server you are proxying to. -- Sander van Zoest [[EMAIL PROTECTED]] Covalent Technologies, Inc. http://www.covalent.net/ (415) 536-5218 http://www.vanzoest.com/sander/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxy adding headers
On Mon, 27 Nov 2000, Sander van Zoest wrote: Normally the mod_proxy code doesn't touch the headers, it simply sends the headers on from the remote server you are proxying too. I doubt it is mod_rewrite but it could be. The extra headers are probably coming from your remote server you are proxying to. I don't think so. If I do a telnet to the proxy server (port 80, no mod_perl) I get the extra headers. If I telnet to the mod_perl enabled server (port 12345), I get what I want (no extra headers). -dave /*== www.urth.org We await the New Sun ==*/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_perl-1.24_01 problems under AIX
On Mon, Nov 27, 2000 at 01:30:42PM -0600, William R. Mattil wrote: I seem to be having difficulty in getting mod_perl to build. I have tried two different versions (mod_perl-1.24 and mod_perl-1.24_01) but both seem to exhibit problems but not the same problems. Platform is an IBM RISC6000 running AIX 4.2.1 and egcs1.1.1 compiler. Apache is apache_1.3.14 and it builds okay. perl Makefile.PL Error Output for sanity check cd ..; gcc -DAIX=42 -U__STR__ -DAIX_BIND_PROCESSOR -DUSE_HSREGEX -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED -DMOD_PERL -lm -o helpers/dummy helpers/dummy.c `perl /home/wrm/packages/mod_perl-1.24/src/modules/perl/ldopts ` Note (probably harmless): No library found for -ldb gcc: installation problem, cannot exec `cpp': No such file or directory gcc: file path prefix `/usr/local/lib/gcc-lib/E:/usr/local/lib/perl5/5.00502/aix/CORE/perl.exp/egcs-2.91.60/' never used make: The error code from the last command is 1. You are using a different compiler to compile mod_perl and perl itself, this is not going to work. The perl build procedure was done using the IBM C compiler and it adds -bE:/path/to/perl.exp to the command line to build perl, but this compiler option means something completely different to gcc, causing the strange error. If you want to use gcc to build mod_perl, you will also have to use gcc to build perl itself. -- Jens-Uwe Mager HELIOS Software GmbH Steinriede 3 30827 Garbsen Germany Phone: +49 5131 709320 FAX:+49 5131 709325 Internet: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Proxy adding headers
On Mon, 27 Nov 2000, Dave Rolsky wrote: On Mon, 27 Nov 2000, Sander van Zoest wrote: Normally the mod_proxy code doesn't touch the headers, it simply sends the headers on from the remote server you are proxying too. I doubt it is mod_rewrite but it could be. The extra headers are probably coming from your remote server you are proxying to. I don't think so. If I do a telnet to the proxy server (port 80, no mod_perl) I get the extra headers. If I telnet to the mod_perl enabled server (port 12345), I get what I want (no extra headers). Ah, are you trying to send ICY headers or something? mod_proxy only knows of HTTP and sends the appropriate status itself rather then what it gets from the remote server. This will also require some hacks in mod_proxy to make it aware of the protocol you are trying to proxy. Cheers, -- Sander van Zoest [[EMAIL PROTECTED]] Covalent Technologies, Inc. http://www.covalent.net/ (415) 536-5218 http://www.vanzoest.com/sander/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Proxy adding headers
On Mon, 27 Nov 2000, Sander van Zoest wrote: Ah, are you trying to send ICY headers or something? mod_proxy only knows of HTTP and sends the appropriate status itself rather then what it gets from the remote server. This will also require some hacks in mod_proxy to make it aware of the protocol you are trying to proxy. That is the exact problem. Ok, the chances of me hacking mod_proxy are next to nil. At least now I know what I can't do to fix the problem though ;) -dave /*== www.urth.org We await the New Sun ==*/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache-server_root_relative not found?
Installed Apache with mod_perl on Mandrake 7.2: [Mon Nov 27 17:44:43 2000] [notice] Apache/1.3.14 (Unix) mod_perl/1.24_01 mod_ssl/2.7.1 OpenSSL 0.9.6 configured -- resuming normal operations Installed Apache::MP3 from Lincoln Stein, that works fine. In an effort to start learning the details of mod_perl, I bought the Writing Apache Modules... book and started following the directions: In /usr/local/apache/conf/httpd.conf IfModule mod_perl.c Include conf/modperl.conf /IfModule In conf/modperl.conf PerlRequire conf/modperl_startup.pl PerlFreshRestart On In modperl_startup.pl (chmod 755) #!/usr/bin/perl BEGIN { use Apache (); use lib Apache-server_root_relative('libperl'); ## /usr/local/apache/libperl created } use Apache::Registry (); use Apache::Constants (); use CGI qw (-compile :all); use CGI::Carp (); 1; Doing a graceful with apachectl causes a core dump. Nothing is written to error_log. perl -cw modperl_startup.pl returns: Can't locate object method "server_root_relative" via package "Apache" at conf/modperl_startup.pl line 5. mod_perl was built with EVERYTHING=1. Is there something I missed? Some module I should be installing? I checked the Errata for the book without success. Any help would be greatly appreciated. S - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Does mod_perl have anything to do with KeepAlive?
Hi All - I'm hoping for some enlightenment about how KeepAlive is implemented in Apache and whether KeepAlive even comes into play when front-end and back-end mod_perl servers communicate with each other via HTTP. Suppose front-end server A is handling user requests. In the process of handling a front-end request, suppose I use LWP or equivalent to make a HTTP request from A to a back-end server B to get some data that is needed. Assuming all the right headers are set for KeepAlive to work (content length, etc.), can the connection between A and B even take advantage of KeepAlive for the next time A makes the same request to B? One problem is that I'm not sure what processes would actually be "keeping" the ends of the "kept alive" connections. At each end, would it be the parent httpd process, or the individual httpd child process that made/answered the request? I'm thinking that if A had to fork a CGI that in turn talked to B, the kept-alive connection would be lost as soon as the CGI process on A died (socket timeouts notwithstanding). But what if the request from A to B is made from within a mod_perl module, or within an Apache::Registry script? Along the same line of thought (assuming this has made any sense so far), what happens when you throw ProxyPass/ProxyPassReverse into the mix? What (if anything) can be done to take advantage of KeepAlive then? Larry Leszczynski [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT: Asians and ModPerl
I'd be curious to know (please email me privately) about who is Asia is using mod_perl and why aren't you guys posting to the list? There's an extraordinary amount of traffic here from UK, USA, and Canada with some sprinkling around the world, but I am curious to know who in Asia is listening in. There are a lot of us in SE Asia who are frustrated that the various .pm groups are usually set up by one person from a yahoo-style email address that never holds meetings and some don't even respond to email anymore. In Singapore and Malaysia, Java seems to have had so much government backing that a lot of IT professionals are into Java but not into Perl. Anyway, I just wanted to take a poll to find out if I am wrong and if there are some good solid pockets of Perl people in SE Asia. Later, Gunther __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Web Technology Company http://www.extropia.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I redirect STDOUT to a string WAS Using MHonArc inside of mod_perl
After one response and my own re-read of my first email, it appears that I have asked far too vague a question. The correct question is: How do I redirect STDOUT to a string? A suggestion was to tie a string to a filehandle and dup the filehandle to STDOUT. Is that valid? If it is, how in blue blazes do I do that? I read the perltie docs, the perlopentut and others I just don't see it. I will re-read them and hope my light bulb works. If anyone can point me to another source of information I would be grateful. Are there any modules for such oddness? I am posting to the mod_perl list in case there are any gotchas doing this under mod_perl. I realize it is border line off topic. I have MHonArc doing what I need it to, but it required a butcher knife when all I think I need is a butter knife. Aaron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxy adding headers
Dave Rolsky [EMAIL PROTECTED] writes: On Mon, 27 Nov 2000, Sander van Zoest wrote: Normally the mod_proxy code doesn't touch the headers, it simply sends the headers on from the remote server you are proxying too. I doubt it is mod_rewrite but it could be. The extra headers are probably coming from your remote server you are proxying to. I don't think so. If I do a telnet to the proxy server (port 80, no mod_perl) I get the extra headers. If I telnet to the mod_perl enabled server (port 12345), I get what I want (no extra headers). Technically mod_proxy doesn't generate headers (here I'm taking the simple case of a non-cacheing http request). After stripping the connection header, it simply passes the headers it got from the backend server right on along to r-connection via ap_proxy_send_hdr_line (or ap_proxy_send_headers for cached files IIRC). Moreover if your backend server calls ap_send_http_header during its response, it *must* return a Server and Date field unless your request is assbackwards. See the src for ap_basic_http_header in src/main/http_protocol.c. mod_proxy will upgrade assbackwards requests to HTTP/1.0 before passing them along to the backend server, which may explain why the date field shows up in your telnet experiments. Why not post the full output of your telnet sessions so we can see what is really going on? HTH. -- Joe Schaefer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I redirect STDOUT to a string WAS Using MHonArc insideof mod_perl
FYI this is not mod_perl related. You'll want the IO::String package. If the perl function you are calling is just printing to the default filehandle (which I'm guessing it does), you should be able to just 'select' the IO::String object: my $str; my $str_fh = IO::String-new($str); my $old_fh = select($str_fh); # call MHonArc or whatever here print_stuff() # reset default fh to previous value select($old_fh) if defined $old_fh; --Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxy adding headers
On 27 Nov 2000, Joe Schaefer wrote: mod_proxy will upgrade assbackwards requests to HTTP/1.0 before passing them along to the backend server, which may explain why the date field shows up in your telnet experiments. Why not post the full output of your telnet sessions so we can see what is really going on? Actually, this totally explains the problem, as did Sander's previous post. I'm attempting to use Apache as a non-HTTP server (sending ICY headers for streaming MP3 instead). So yes, its an assbackwards request and its upgrading it. Which is annoying. It would be nice if this were configurable in mod_proxy.c. Maybe I will have to look at the code. But I'm afraid of C. -dave /*== www.urth.org We await the New Sun ==*/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxy adding headers
Dave Rolsky [EMAIL PROTECTED] writes: I'm afraid of C. Don't be. (perl is C with cream and sugar added ;) Grab a copy of Kernighan and Ritchie's _The C Programming Language_ (it's authoritative, and all of 274 pages cover to cover). Then start monkeying around in src/modules/proxy/proxy_http.c and/or src/main/http.protocol.c and see what you can cook up. Tweaking and/or commenting out a few lines should do the trick. Just be sure to back up your apache tree before you start tinkering. Best. -- Joe Schaefer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using MHonArc inside of mod_perl
Perhaps you just need to use Apache::Filter? If not, you can cannibalize some of the code in Apache::Filter, it re-ties STDOUT. [EMAIL PROTECTED] (Aaron Johnson) wrote: I am trying to get the MHonArc package to work in conjunction with an in house module. When MHonArc (http://www.mhonarc.org) is run and told to process a single file instead of a directoy full of files, it sends the output to STDOUT which inside of mod_perl in this case is the browser. I am using the process_input() function as outlined in the MHonArc mailing list archives. I need to save the output to a variable. It was suggested by Earl Hood (author of MHonArc) that I tie a string to a filehandle and then dup the filehandle to STDOUT. This sounds great, but I am unsure where to place the code that will allow for this or how this needs to be done with mod_perl. (I read perltie and perlopentut, but it didn't light any bulbs). I got some results, but none that produced the desired results. The closest was getting the output to be directed to the resulting HTML page, but not the variable. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Proxy adding headers
On Mon, 27 Nov 2000, Sander van Zoest wrote: Ah, are you trying to send ICY headers or something? mod_proxy only knows of HTTP and sends the appropriate status itself rather then what it gets from the remote server. This will also require some hacks in mod_proxy to make it aware of the protocol you are trying to proxy. Well, I guess C is easier than I thought. I got it working via a new config directive for mod_proxy, ProxyAddHeaders. By default its true and this means that mod_proxy will add minimal headers for wack responses from the proxy server (like HTTP 0.9 or ICY or whatever). However, if you turn it off it will _not_ add these headers. There is a bug in the current state of the code in that if the caching code is called, it will add a Date header if none exists. I'm currently working around this by turning off caching. I'm going to see if there is interest in the Apache core team in having this submitted as a patch. Is so, I'll work around the remaining bug. In the meantime, if anybody on this list is interested I can send you my current patch, which is against 1.3.12. Its not many lines so porting it to a different Apache version should be trivial. -dave /*== www.urth.org We await the New Sun ==*/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxy adding headers
Dave's company could also *pay* someone to do what he wants. It would probably take about a day of someone at Covalent (probably less) to whip something up to stop doing the headers (and they would probably be able to feed the change back into the mod_proxy part of the Apache CVS directly so others would benefit). At 10:10 PM 11/27/2000 -0500, Joe Schaefer wrote: Dave Rolsky [EMAIL PROTECTED] writes: I'm afraid of C. Don't be. (perl is C with cream and sugar added ;) Grab a copy of Kernighan and Ritchie's _The C Programming Language_ (it's authoritative, and all of 274 pages cover to cover). Then start monkeying around in src/modules/proxy/proxy_http.c and/or src/main/http.protocol.c and see what you can cook up. Tweaking and/or commenting out a few lines should do the trick. Just be sure to back up your apache tree before you start tinkering. Best. -- Joe Schaefer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Web Technology Company http://www.extropia.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help! Objects are disappearing!
Here's the situation: I have a master module, which 'use's other objects in same hierarchy. It creates the objects and assings references of them to the local variables. Everything compiles, even works. That main module receives requests and directs to one of the created objects, passing CGI object and request object... But on second run it disappears. All function calls fail because it says it can't call function on undef object. Help? Pavel -- Bask in the glow of the digital silence http://www.vancouver.yi.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help! Objects are disappearing! - FALSE ALERT
Actually was creating empty entries in the hash, and then using them, damn. Pavel -- Bask in the glow of the digital silence http://www.vancouver.yi.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Proxy adding headers
On Tue, 28 Nov 2000, Gunther Birznieks wrote: Dave's company could also *pay* someone to do what he wants. It would probably take about a day of someone at Covalent (probably less) to whip something up to stop doing the headers (and they would probably be able to feed the change back into the mod_proxy part of the Apache CVS directly so others would benefit). Great, as soon as I can find a company willing to fund my work on a personal MP3 server I'll be all set ;) Actually, I already did most of the patch and I sent a message to the new-httpd list to discuss the possibility of making this a part of a future release. Of course, if someone at Covalent wants to help that's great too. And for the record, it took a lot less than a day. About 1.5-2 hours, I'd say. -dave /*== www.urth.org We await the New Sun ==*/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]