Re: Apache::Registry RFE
Of course there was an error... At 9:54 PM -0700 5/30/2000, Michael Blakeley wrote: $r-log_error($errsv) if $Apache::RegistryYA::AutoLog; s/RegistryYA/Registry I'm also having second thoughts about the binary nature of this thing... I'd forgotten that $errsv might well be a text message like: Can't locate object method foo via package "Apache" at... which I'd quite like to see in the log. So maybe... $ diff -w Registry.pm.orig Registry.pm 26a27,28 $Apache::Registry::AutoLog ||= 32768; 155c157,160 $r-log_error($errsv); --- { local $^W = 0; $r-log_error($errsv) if $Apache::Registry::AutoLog 0+$errsv } This way, setting $Apache::Registry::AutoLog = 300 gives me the behavior I want (no extra log lines for 302, 304, 500) while still letting "true" eval errors through. The default value should come pretty close to the original behavior. -- Mike
Fw: Re: Wierd problem with redirect
-Original Message- From: Eric Cholet [EMAIL PROTECTED] To: ___cliff rayman___ [EMAIL PROTECTED] Date: Tue, 30 May 2000 23:57:13 +0200 Subject: Re: Wierd problem with redirect On Tue, May 30, 2000 at 02:30:36PM -0700, ___cliff rayman___ wrote: actually \n\r\ is really how it is supposed to be. i am sure you will find it in the RFC's. most browsers seem to be okay with \n's only. Actually it's \r\n, unless you're on a Mac :-) -- Eric Cholet
Modifying of Apache::Session File
Hi, We've got an application where on initial login we're creating the session file. Subsequently, we want to add more hash values into this session file. Immediately after creation if we add values to the session file, these values get stored. After a few pages we tried to modify the existing session file, by First, tie-ing the values to a session hash Second, Modifying the session hash. At the point of modifying the session, the program just hangs waits indefintely. Can anybody help us out with this problem. Murali Differentiated Software Solutions Pvt. Ltd., 176, Gr. Floor, 6th Main 2nd Block RT Nagar Bangalore - 560 032 India Ph: 91 80 3431470 email : diffs+AEA-vsnl.com http://www.diffs-india.com
Perl Section questions
I have two questions about perl sections: 1) Has setting an entry in the %ENV hash in a perl section the same effect as using a SetEnv (or PerlSetEnv) directive (What btw is the difference between SetEnv and PerlSetEnv, both seem to effect %ENV in the same way.) 2) If the order of directives in a Location section matters (see recent discussion on Apache::PerlVINC), does that mean I cannot use Perl Sections to configure that because the order of hash keys is unreliable. Kees
Help with Apache::SSI Apache::Filter in Apache::ASP
Hi, I'm new here. I apologize in advance if I'm posting this wrongly or to the wrong list and for the messy 'cut and paste' job on the error_log below. I haven't been able to find a solution for a start-up problem I'm having with a new Apache::ASP install and would appreciate any help or clues greatly. Apache::ASP's test script 'ssi_filter.ssi' fails. It includes the header, the gifs and prints two lines of text then balks at the Virtual include: table width=100%trtd !--#include virtual="%="$demo-{file}?virtual=1"%" -- /td/tr/table I built a static Apache 1.3.12 with mod_perl 1.22 nite before last. mod_perl was built, tested and 'make install'ed with EVERYTHING=1. stdout showed that PERL_STACKED_HANDLERS tested ok and was enabled. I installed both Apache::SSI and Apache::Filter. Then I installed Apache::ASP. It liked what it found. I did 'cp -r /site/eg' from src to Apache's htdocs/, I set 'AllowOverride All' for the htdocs directory and the eg directory in httpd.conf, and everything else seems to work ok, except the file 'session_query_parse.asp' which works fine sometimes and throws an error at other times. Ownership in eg is 1001.bin and permissions are chmod 0777 for site/eg under Apache's DocumentRoot. Apache is owned by nobody.nobody. I haven't tried to config httpd.conf yet (except for the 'AllowOverride All' directive) because reading some of Joshua Chamas replies in this list's archives seems to indicate that's not necessary for the test scripts in site/eg. Man says there's a problem with SSI needing to be the last include, but indicated that simple directives like !--#fsize--, !--#flastmod-- should not be a problem. All the other scripts work great and I can't wait to dig into mod_perl and Apache::ASP. I'd just like to find out if I've got a good install before I try to break it. Thanks again, montefin ssi_filter.ssi presented the following in error_log: [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] RUN ASP (v0.18) for /usr/local/apache-ASP/htdocs/site/eg/ssi_filter.ssi [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] loaded module Apache::Filter [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] GlobalASA package Apache::ASP::Demo [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] compiling global.asa Apache::ASP::Demo [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] global.asa routines - Application_OnEnd: 1; Application_OnStart: 1; Script_OnEnd: 1; Script_OnStart: 1; Session_OnEnd: 1; Session_OnStart: 1; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] opening lock file /tmp/asp_demo/server/internal.lock [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] opening lock file /tmp/asp_demo/server/application.lock [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] created $Application - Count: 20; Session73d41e9eb24306295fa1e2b08f64d311: ?; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] session id from cookie: 73d41e9eb24306295fa1e2b08f64d311 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] refreshing 73d41e9eb24306295fa1e2b08f64d311 with timeout 959759203 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] session timed out, clearing [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] opening lock file /tmp/asp_demo/73/73d41e9eb24306295fa1e2b08f64d311.lock [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] Session_OnEnd - session: 73d41e9eb24306295fa1e2b08f64d311; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] executing Session_OnEnd [Wed May 31 01:26:43 2000] [error] [asp] [4815] Session Ending :) in ./eg/global.asa 73d41e9eb24306295fa1e2b08f64d311 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] state 73d41e9eb24306295fa1e2b08f64d311 locks: 1, unlocks: 1 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] refreshing 73d41e9eb24306295fa1e2b08f64d311 with timeout 959759203 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] setting internal data for state 73d41e9eb24306295fa1e2b08f64d311 - s tate_db: SDBM_File; state_serializer: Data::Dumper; timeout: 959759203; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] opening lock file /tmp/asp_demo/73/73d41e9eb24306295fa1e2b08f64d311.lock [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] tieing session 73d41e9eb24306295fa1e2b08f64d311 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] tied session - Count: 10; Ended: 3; Started: 3; onstart: 959754256; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] clearing starting session [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] forcing groups cleanup [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] testing internal time for cleanup groups [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] group check 73 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] skipping delete self - id: 73d41e9eb24306295fa1e2b08f64d311; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] state 73 locks: 0, unlocks: 0 [Wed May 31 01:26:43 2000]
socket problems
Hi, i'm using mod_perl to run a Unix domain socket client to connect to a server (wriiten in C). When i run the server and run the perl client as a stand-alone perl program it connects to the socket just fine and exchanges the relevant information. When i put the same lines into a mod_perl program, I keep getting the following error in the error_log: null:Can't connect to /home/tom/ipc/echo_socket: Connection refused at /home/tom/ipc/mpipc.pl line21 Here are the lines i use (which work for a standalone perl program!) in the script mpipc.pl use Apache::Request (); use Socket; use strict; my $r = shift; my $apr = Apache::Request-new($r); gather info from request obj here! socket(CLIENT,PF_UNIX,SOCK_STREAM,0); connect(CLIENT,sockaddr_un("/home/tom/ipc/echo_socket")) or die "Cant connect to /home/tom/ipc/echo_socket: $!"; Above line is where the script fails as it can't connect! I set the permissions on the socket file to rwx for everybody! i.e. chmod 777 echo_socket but i still am refused a connection to it! (I also know IO::Socket may be an option but when i tried using it in a standalone perl program it absolutely refuses to connect to the C server) My question is does anybody know why i can't connect to this socket from a mod-perl script even though the above code connects fine from an ordinary perl program? Apache/1.3.12 (Red Hat linux) mod_perl/1.21 Perl 5.00503 Any help would be greatlt appreciated! Thomas. Thomas Reilly Software Consultant, Distributed Software Consultancy Ltd., Ballybrit Business Park,Galway,Ireland. Tel: +353 (91) 760541 Fax: +353 (91) 760542 e-mail: [EMAIL PROTECTED] web: http://www.dscie.com
Re: Help with Apache::SSI Apache::Filter in Apache::ASP
[Wed May 31 01:26:44 2000] [error] [asp] [4815] [debug] state 73d41e9eb24306295fa1e2b08f64d311 locks: 9, unlocks: 9 [Wed May 31 01:26:44 2000] [error] Can't locate object method "run" via package "Apache" at /usr/lib/perl5/site_perl/5.005/A pache/SSI.pm line 181. Great problem report. I appreciate the error_log output with Debug -2. Apache::ASP is running, and the problem occurs at Apache::SSI in this code: sub ssi_include { my ($self, $args) = @_; my $subr = $self-find_file($args); -- unless ($subr-run == OK) { $self-error("Include of '@{[$subr-filename()]}' failed: $!"); } return; } So why wouldn't the *run routine for Apache be loaded properly? I have no idea frankly, but this is reminiscent of general RedHat DSO problems, so you might try to recompile statically at the end of this ordeal. Finally if the virual thing isn't working for you, you can still have file includes with !--#include file=""-- and can pass @args to it like % $Response-Include('file.inc', @args); % such that the file is executed like a subroutine. Good luck, Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 montefin wrote: Hi, I'm new here. I apologize in advance if I'm posting this wrongly or to the wrong list and for the messy 'cut and paste' job on the error_log below. I haven't been able to find a solution for a start-up problem I'm having with a new Apache::ASP install and would appreciate any help or clues greatly. Apache::ASP's test script 'ssi_filter.ssi' fails. It includes the header, the gifs and prints two lines of text then balks at the Virtual include: table width=100%trtd !--#include virtual="%="$demo-{file}?virtual=1"%" -- /td/tr/table I built a static Apache 1.3.12 with mod_perl 1.22 nite before last. mod_perl was built, tested and 'make install'ed with EVERYTHING=1. stdout showed that PERL_STACKED_HANDLERS tested ok and was enabled. I installed both Apache::SSI and Apache::Filter. Then I installed Apache::ASP. It liked what it found. I did 'cp -r /site/eg' from src to Apache's htdocs/, I set 'AllowOverride All' for the htdocs directory and the eg directory in httpd.conf, and everything else seems to work ok, except the file 'session_query_parse.asp' which works fine sometimes and throws an error at other times. Ownership in eg is 1001.bin and permissions are chmod 0777 for site/eg under Apache's DocumentRoot. Apache is owned by nobody.nobody. I haven't tried to config httpd.conf yet (except for the 'AllowOverride All' directive) because reading some of Joshua Chamas replies in this list's archives seems to indicate that's not necessary for the test scripts in site/eg. Man says there's a problem with SSI needing to be the last include, but indicated that simple directives like !--#fsize--, !--#flastmod-- should not be a problem. All the other scripts work great and I can't wait to dig into mod_perl and Apache::ASP. I'd just like to find out if I've got a good install before I try to break it. Thanks again, montefin ssi_filter.ssi presented the following in error_log: [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] RUN ASP (v0.18) for /usr/local/apache-ASP/htdocs/site/eg/ssi_filter.ssi [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] loaded module Apache::Filter [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] GlobalASA package Apache::ASP::Demo [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] compiling global.asa Apache::ASP::Demo [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] global.asa routines - Application_OnEnd: 1; Application_OnStart: 1; Script_OnEnd: 1; Script_OnStart: 1; Session_OnEnd: 1; Session_OnStart: 1; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] opening lock file /tmp/asp_demo/server/internal.lock [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] opening lock file /tmp/asp_demo/server/application.lock [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] created $Application - Count: 20; Session73d41e9eb24306295fa1e2b08f64d311: ?; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] session id from cookie: 73d41e9eb24306295fa1e2b08f64d311 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] refreshing 73d41e9eb24306295fa1e2b08f64d311 with timeout 959759203 [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] session timed out, clearing [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] opening lock file /tmp/asp_demo/73/73d41e9eb24306295fa1e2b08f64d311.lock [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] Session_OnEnd - session: 73d41e9eb24306295fa1e2b08f64d311; [Wed May 31 01:26:43 2000] [error] [asp] [4815] [debug] executing Session_OnEnd [Wed May 31 01:26:43 2000] [error] [asp]
Re: Help with Apache::SSI Apache::Filter in Apache::ASP
[EMAIL PROTECTED] (Joshua Chamas) wrote: [Wed May 31 01:26:44 2000] [error] [asp] [4815] [debug] state 73d41e9eb24306295fa1e2b08f64d311 locks: 9, unlocks: 9 [Wed May 31 01:26:44 2000] [error] Can't locate object method "run" via package "Apache" at /usr/lib/perl5/site_perl/5.005/A pache/SSI.pm line 181. Great problem report. I appreciate the error_log output with Debug -2. Apache::ASP is running, and the problem occurs at Apache::SSI in this code: sub ssi_include { my ($self, $args) = @_; my $subr = $self-find_file($args); -- unless ($subr-run == OK) { $self-error("Include of '@{[$subr-filename()]}' failed: $!"); } return; } Wow, I just fixed this bug last night! See if the version at http://mathforum.com/~ken/modules/Apache-SSI/SSI.pm works any better. The bug is actually just a bad error message that's triggered when an !--#include-- tag doesn't have either of the 'file' or 'virtual' parameters. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Changes to module code only take effect if perl program updated
I'm trying to get up to speed with mod_perl and have been playing around with Apache::StatINC so that any perl modules I update get reloaded. From what I can see in the error_log file it does get re-loaded, but the changes don't seem to take effect until I touch my perl program that 'uses' this module. Why? The other thing I notice in the error_log file (after I have touched my perl program) are warnings such as 'Subroutine CounterMain redefined at (eval 24) line 4'. Finally, I never notice the parent httpd process reload my module always the child processes - as per the error_log file eg: Apache::StatINC: process 25685 reloading Counter.pm Any help, advice, explanation would be appreciated. I am using the following : apache 1.3.12, mod_perl 1.24, perl 5.6.0 on Solaris 2.6 I've added the following to httpd.conf : # # For Karl's testing # Alias /karlperl//export/apache/karltest/perl/ PerlSetEnv PERL5LIB/export/apache/karltest/perl PerlSetEnv PERLDB_OPTS "NonStop=1 LineInfo=/tmp/karltest.db.out AutoTrace=1 frame=2" PerlWarnon PerlModule Apache::Registry PerlModule Apache::DB PerlModule Apache::StatINC Location /karlperl # PerlFixupHandler Apache::DB SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI PerlSendHeader On PerlInitHandler Apache::StatINC PerlSetVar StatINCDebug On #PerlSetVar StatINC_UndefOnReload On #order mutual-failure #allow from 165.168.176.23 /Location Thanks Karl *** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. ***
Re: Modifying of Apache::Session File
On Wed, 31 May 2000, Differentiated Software Solutions Pvt. Ltd. wrote: Hi, We've got an application where on initial login we're creating the session file. Subsequently, we want to add more hash values into this session file. Immediately after creation if we add values to the session file, these values get stored. After a few pages we tried to modify the existing session file, by First, tie-ing the values to a session hash Second, Modifying the session hash. At the point of modifying the session, the program just hangs waits indefintely. Can anybody help us out with this problem. You must have leaked some session objects, and now you are holding stale locks. It is a frequent problem. If you are using a global for the session object, don't do that. Also don't make a circular reference to the session object. -jwb
Jez 'n' Di?
I got a very strange response from [EMAIL PROTECTED] in response to a previous posting to this board. "jez" responded with an "anti spamming notice"! It said the message was tossed into /dev/null, and that it was either because I sent a "ms-tnef" attachment (I sent no attachment at all) or because I was using Word (something I preach against, lol! =o) The message ended with "If neither of the above are the case, then we just don't want to talk to you!!" I don't understand. I post from Yahoo Mail, typing into a TEXTAREA via a NetScape browser, and have never had this problem before. I realise that's not a mod_perl problem, but is it a mod_perl posting problem? Did I do something odd? I've even been trying to remember to turn off my signature file (though I still try to tag something in by hand). Paul http://math.ucr.edu/home/baez/physics/occam.html __ Do You Yahoo!? Send instant messages get email alerts with Yahoo! Messenger. http://im.yahoo.com/
Re: CGI/mod_perl strangeness...
"Trevor" == Trevor Phillips [EMAIL PROTECTED] writes: Trevor Thing is, this is from an Apache Perl module using mod_perl, Trevor not from a CGI using CGI.pm (as this line is printed to Trevor stderr when you supposedly run a CGI from the command Trevor prompt). A code clip would help ... Otherwise, to get CGI.pm to prompt for values, you must be running in '-debug' mode. Try using the '-no_debug' pragma and see if the condition persists: use CGI qw/-no_debug/; Peace.
Re: Jez 'n' Di?
I got a very strange response from [EMAIL PROTECTED] in response to a previous posting to this board. "jez" responded with an "anti spamming notice"! It said the message was tossed into /dev/null, and that it was either because I sent a "ms-tnef" attachment (I sent no attachment at all) or because I was using Word (something I preach against, lol! =o) The message ended with "If neither of the above are the case, then we just don't want to talk to you!!" I wouldn't take it personnally :-) If *you* received a bounce, instead of the list's envelope sender, then it means it's a very broken mail server. If this happens repeatedly the list admin will unsubsribe the offending user. -- Eric
RE: Wierd problem with redirect
On Tue, 30 May 2000, Jerrad Pierce wrote: I'm running into an odd redirect ptoblem myself, I'm issuing: HTTP/1.1 302 Moved Temporarily\n\r Date: Tue 30 May 2000 18:18:07 GMT\n\r Server: Apache/1.311\n\r Set-Cookie: SESSION_ID=4177a0c9ae2b278decd6038901b28a2a; path=/; expires=Thu, 1-Jan-70 00:20:00 GMT;\n\r Location: /\n\r If you don't follow the HTTP specification, you can't expect the browser to do the right thing. "/" is not a valid URI for a Location. According to RFC 2616, the Location must be an absolute URI: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 In RFC 2396, an absolute URI is defined as: absoluteURI = scheme ":" ( hier_part | opaque_part ) So your method is not valid, and you deserve whatever the browser does to you. You should do this instead: Location: http://mysite.com/\n\r Regards, Jeffrey
RE: [ANNOUNCE] Apache::Session 1.51
Which version of Storable module do I need for Session 1.51? Storable-0.6.11 ? it's still under beta testing. Thanks James
RE: elusive, disappearing notes?
I've seen this before and always thought to attribute it to mod_dir creating a new request to properly map / to /index.html since any notes set are for the lifetime of the request only, the new request (representing /index.html) would/should have no notes... this makes sense in my head, but my head is weird - I could be wrong... HTH --Geoff -Original Message- From: Roger Espel Llima [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 31, 2000 1:46 PM To: [EMAIL PROTECTED] Subject: elusive, disappearing notes? I have a TransHandler that's setting a note with $r-notes("something", "something") the first time it runs. When I give it a directory ($r-uri is something like "/whatever/"), then Apache runs my TransHandler several times, where $r-uri looks like "/whatever/", then "/whatever/index.html". Now, the second time the TransHandler runs in the same request (with the /index.html that mod_dir added), it doesn't see the note that the first time left! I've double-checked the code, and made it dump the notes table to stderr, to no avail. The note just goes away. Question: is it supposed to do that? Is there a suggested workaround? Here's a simple test case of a TransHandler that shows this behavior: sub handler { my $r = shift; my $uri = $r-uri; my $notes = $r-notes; print STDERR "Notes init ($uri)!\n"; foreach my $k (keys %$notes) { my $v = $notes-{$k}; print STDERR "NOTE ($k) - ($v)\n"; } print STDERR "-\n"; $r-notes("hello", "world") unless $uri =~ /html/; print STDERR "Notes exit!\n"; foreach my $k (keys %$notes) { my $v = $notes-{$k}; print STDERR "NOTE ($k) - ($v)\n"; } print STDERR "-\n"; return DECLINED; } And the error_log of requesting / on this server: [Wed May 31 19:42:35 2000] [notice] Apache/1.3.12 (Unix) mod_perl/1.21 configure d -- resuming normal operations Notes init (/)! - Notes exit! NOTE (hello) - (world) - Notes init (/)! - Notes exit! NOTE (hello) - (world) - Notes init (/index.html)! - Notes exit! - Notes init (/index.html)! - Notes exit! - -- Roger Espel Llima, [EMAIL PROTECTED] http://www.iagora.com/~espel/index.html
Re: Changes to module code only take effect if perl program updated
On Wed, 31 May 2000, Karl Djemal wrote: I'm trying to get up to speed with mod_perl and have been playing around with Apache::StatINC so that any perl modules I update get reloaded. From what I can see in the error_log file it does get re-loaded, but the changes don't seem to take effect until I touch my perl program that 'uses' this module. Why? Does your Apache::Registry script import anything from this module? If not, it's possible that perl has in-lined your module's subroutines in the Registry script as an optimization during compiling. Those warnings you mentioned usually indicate that. - Perrin
Re: elusive, disappearing notes?
On Wed, May 31, 2000 at 01:57:20PM -0400, Geoffrey Young wrote: I've seen this before and always thought to attribute it to mod_dir creating a new request to properly map / to /index.html since any notes set are for the lifetime of the request only, the new request (representing /index.html) would/should have no notes... this makes sense in my head, but my head is weird - I could be wrong... okay, that makes sense in my head too. I'll just stick the data on a global variable and clear it at the end of the request... thanks! -- Roger Espel Llima, [EMAIL PROTECTED] http://www.iagora.com/~espel/index.html
Re: socket problems
I had similar problems on Windows NT with mod_perl 1.16, Apache 1.3.3 and perl 5.00502. I was connecting to a Linux smtp server from a cgi on an NT web server. On NT, (netstat -s) it showed that "Reset Connections" increased every time the connection failed. It would work the very first time after a re-start - then the would fail every time. Worked fine from comman-line Perl. I'm now testing with perl 5.6.0, Apache 1.3.12 and mod_perl 1.24 and don't have the problem. Hope this helps. Chuck Goehring -Original Message- From: Reilly, Thomas [EMAIL PROTECTED] To: 'mod_perl' [EMAIL PROTECTED] Date: Wednesday, May 31, 2000 4:22 AM Subject: socket problems Hi, i'm using mod_perl to run a Unix domain socket client to connect to a server (wriiten in C). When i run the server and run the perl client as a stand-alone perl program it connects to the socket just fine and exchanges the relevant information. When i put the same lines into a mod_perl program, I keep getting the following error in the error_log: null:Can't connect to /home/tom/ipc/echo_socket: Connection refused at /home/tom/ipc/mpipc.pl line21 Here are the lines i use (which work for a standalone perl program!) in the script mpipc.pl use Apache::Request (); use Socket; use strict; my $r = shift; my $apr = Apache::Request-new($r); gather info from request obj here! socket(CLIENT,PF_UNIX,SOCK_STREAM,0); connect(CLIENT,sockaddr_un("/home/tom/ipc/echo_socket")) or die "Cant connect to /home/tom/ipc/echo_socket: $!"; Above line is where the script fails as it can't connect! I set the permissions on the socket file to rwx for everybody! i.e. chmod 777 echo_socket but i still am refused a connection to it! (I also know IO::Socket may be an option but when i tried using it in a standalone perl program it absolutely refuses to connect to the C server) My question is does anybody know why i can't connect to this socket from a mod-perl script even though the above code connects fine from an ordinary perl program? Apache/1.3.12 (Red Hat linux) mod_perl/1.21 Perl 5.00503 Any help would be greatlt appreciated! Thomas. Thomas Reilly Software Consultant, Distributed Software Consultancy Ltd., Ballybrit Business Park,Galway,Ireland. Tel: +353 (91) 760541 Fax: +353 (91) 760542 e-mail: [EMAIL PROTECTED] web: http://www.dscie.com
RE: [ANNOUNCE] Apache::Session 1.51
On Wed, 31 May 2000, James Xie wrote: Which version of Storable module do I need for Session 1.51? Storable-0.6.11 ? it's still under beta testing. Any version should work. -jwb
push_handlers weirdness...
hi all... I'm not sure if this is related to some of the get/set handler strangeness that I have been seeing lately (as I try to do some weird stacked handler acrobatics), or if it's the result of some closure thing that I really shouldn't be doing... package Test::Test; use Apache::Constants qw( OK ); use strict; sub handler { my $r = shift; warn "outside..." . $r-current_callback . $r-uri; $r-push_handlers(PerlCleanupHandler = sub { warn "inside..." . $r-current_callback . $r-uri; return OK;}); return OK; } 1; anyway, for / = /index.html translation using mod_dir, this PerlInitHandler produces: outside...PerlInitHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 9. outside...PerlInitHandler/index.html at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 9. inside...PerlCleanupHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 10. inside...PerlFixupHandler/index.html at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 10. changing shift() to Apache-request() yields: outside...PerlInitHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 10. outside...PerlHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 10. inside...PerlCleanupHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 11. inside...PerlCleanupHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 11. which still isn't quite right, but sorta like what I might expect when reading through mod_dir code and the ap_internal_redirect docs... I tried playing around with setting $r in the anon subroutine too, but I still can't get push_handlers to push code to the cleanup phase for the internal redirect... I guess the question I have is what's being shift()ed that for that second pass and if the problem is just my code, mod_perl, mod_dir, or not-a-problem/expected behavior... fun, eh? --Geoff
Re: push_handlers weirdness...
On: Wed, 31 May 2000 17:04:05 EDT Geoffrey Young wrote: hi all... I'm not sure if this is related to some of the get/set handler strangeness that I have been seeing lately (as I try to do some weird stacked handler acrobatics), or if it's the result of some closure thing that I really shouldn't be doing... package Test::Test; use Apache::Constants qw( OK ); use strict; sub handler { my $r = shift; warn "outside..." . $r-current_callback . $r-uri; $r-push_handlers(PerlCleanupHandler = sub { warn "inside..." . $r-current_callback . $r-uri; return OK;}); return OK; } 1; anyway, for / = /index.html translation using mod_dir, this PerlInitHandler produces: outside...PerlInitHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 9. outside...PerlInitHandler/index.html at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 9. inside...PerlCleanupHandler/ at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 10. inside...PerlFixupHandler/index.html at /usr/lib/perl5/site_perl/5.005/Test/Test.pm line 10. Hi Geoff, Isn't this what's expected? The first time through (for "/") you push code onto the CleanupHandler stack. Then there's a subrequest (by mod_dir, although I'm just guessing here) to check for "/index.html", which causes another code ref to be pushed onto the CleanupHandler stack. At the completion of the subrequest, the original request is completed, having two code refs to evaluate once it reaches the Cleanup "phase", one for the original "/" and one for the "/index.html". Or am I totally missing your point :) --kip
[OT] Bean::*?
Hi all, Okay, this is a rather ridiculous question. I spent the weekend implementing a property based object model in Java. However, after I finished, someone in my company laughingly pointed out that I had just re-invented Java beans. While there were some minor advantages to the model I came up with, the overwhelmingly richer feature set of the java.beans.* framework made my efforts redundant at best. One of the advantages, however, is that the object model I was working on would translate very nicely to Perl. In fact, the language independent nature of this (other than OO being a requirement) was the real reason I bothered with it at all. My question is this -- has anyone written an implementation of the Java Bean standard in Perl? I don't think we need to have a major debate about the shortcomings of beans on the mod_perl list. But I am wondering if anyone has pulled this off yet. If we left out the event driven parts of the bean spec, and just focused on the property side of things, this could be a rather short project to get the core down. I'd like to see the Perl version be API compatable with the Java version. There is no need to take it much further. Thoughts? Flames? :) -DeWitt
installation of GTop and Scoreboard
We're trying to install Apache::GTop and Apache::Scoreboard. On our machines, we have RedHat 6.2 (2.2.14-5.0), Perl 5.00503, and mod_perl 1.21. We're having installation problems with both modules. Below is output from the installation of both. If you have any suggestions, my coworkers and I would certainly appreciate it! Thank you, Alex Algard [EMAIL PROTECTED] - OUTPUT FROM GTop.pm - [root]# perl Makefile.PL Note (probably harmless): No library found for -lgtop Note (probably harmless): No library found for -lgtop_sysdeps Note (probably harmless): No library found for -lgtop_common Note (probably harmless): No library found for -lgtop Note (probably harmless): No library found for -lgtop_sysdeps Note (probably harmless): No library found for -lgtop_common [root]# make Skip blib/lib/GTop.pod (unchanged) Skip blib/lib/GTop.pm (unchanged) make[1]: Entering directory `/www/GTop-0.10/Server' cc -c -I/usr/lib/glib/include -Dbool=char -DHAS_BOOL -I/usr/local/include -O 2 -m486 -fno-strength-reduce-DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fp ic -I/usr/lib/perl5/5.00503/i386-linux/CORE io.c In file included from io.c:24: daemon.h:27: glibtop.h: No such file or directory daemon.h:28: glibtop/error.h: No such file or directory daemon.h:29: glibtop/gnuserv.h: No such file or directory daemon.h:31: glibtop/open.h: No such file or directory daemon.h:32: glibtop/union.h: No such file or directory daemon.h:33: glibtop/xmalloc.h: No such file or directory daemon.h:34: glibtop/version.h: No such file or directory daemon.h:35: glibtop/command.h: No such file or directory daemon.h:36: glibtop/parameter.h: No such file or directory make[1]: *** [io.o] Error 1 make[1]: Leaving directory `/www/GTop-0.10/Server' make: *** [subdirs] Error 2 - OUTPUT FROM Scoreboard.pm - [root]# perl Makefile.PL Writing Makefile for Apache::DummyScoreboard Writing Makefile for Apache::Scoreboard [root]# make make[1]: Entering directory `/www/Apache-Scoreboard-0.10/Dummy' /usr/bin/perl -I/usr/lib/perl5/5.00503/i386-linux -I/usr/lib/perl5/5.00503 /usr/lib/perl5/5.00503/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.00503/ExtUtils/typemap -typemap typemap DummyScoreboard.xs xstmp.c mv xstmp.c DummyScoreboard.c Error: 'Apache' not in typemap in DummyScoreboard.xs, line 122 Please specify prototyping behavior for DummyScoreboard.xs (see perlxs manual) make[1]: *** [DummyScoreboard.c] Error 1 make[1]: Leaving directory `/www/Apache-Scoreboard-0.10/Dummy' make: *** [subdirs] Error 2
Re: [OT] Bean::*?
On Wed, 31 May 2000, DeWitt Clinton wrote: My question is this -- has anyone written an implementation of the Java Bean standard in Perl? I don't think we need to have a major debate about the shortcomings of beans on the mod_perl list. But I am wondering if anyone has pulled this off yet. If we left out the event driven parts of the bean spec, and just focused on the property side of things, this could be a rather short project to get the core down. Maybe I'm just being thick, but if you leave out the event driven parts of the spec, what's left that isn't just an ordinary Perl class? You can easily make classes to hold data using Class::Struct or Class::MethodMaker. Is it just that you want a safer way to do introspection than looking at the data structure the class is made from? Maybe you want the Class::Fields module from CPAN. - Perrin
Problem running httpd.. mod_perl 1.24 (DSO) and other DSOs
Hi, I'm building a new box (FreeBSD 4.0-RELEASE, w/ 5.005_03) with a largely DSO-driven Apache. I've got mod_perl 1.24 built as a DSO, and it runs fine. [Since this is a production box located about 100 miles from me, maintained over a modem(!) I'd really rather not reinstall Perl.. 5.005_03's what comes out of the box with FreeBSD 4.0-RELEASE, and I'm trying to keep this machine as generic as possible. Mod_perl's going in as a DSO because I'm using the same basic apache build for 4 jails -- some with mod_perl, some without.] However, when I add in a few other DSOs, httpd coredumps. The gdb output for httpd -X: - Program received signal SIGSEGV, Segmentation fault. 0x2810d654 in tzset () from /usr/lib/libc.so.4 (gdb) bt #0 0x2810d654 in tzset () from /usr/lib/libc.so.4 #1 0x2810d76b in localtime () from /usr/lib/libc.so.4 #2 0x2810dc25 in ctime () from /usr/lib/libc.so.4 #3 0x2812b8f2 in .cerror () from /usr/lib/libc.so.4 #4 0x2825cd21 in _thread_fd_lock_debug () from /usr/lib/libc_r.so.4 #5 0x2825a5ee in ioctl () from /usr/lib/libc_r.so.4 #6 0x2812b356 in tcgetattr () from /usr/lib/libc.so.4 #7 0x281299c6 in isatty () from /usr/lib/libc.so.4 #8 0x28129106 in __smakebuf () from /usr/lib/libc.so.4 #9 0x281197c3 in __srefill () from /usr/lib/libc.so.4 #10 0x281196a0 in __srget () from /usr/lib/libc.so.4 #11 0x2833e2c5 in Perl_sv_gets () from /usr/lib/libperl.so.3 #12 0x283647b1 in Perl_filter_read () from /usr/lib/libperl.so.3 #13 0x2836586f in Perl_yylex () from /usr/lib/libperl.so.3 #14 0x28360178 in Perl_yyparse () from /usr/lib/libperl.so.3 #15 0x2837871d in perl_parse () from /usr/lib/libperl.so.3 #16 0x282c2b1c in perl_startup () from /app/pkg/apache/libexec/libperl.so #17 0x282c2643 in perl_module_init () from/app/pkg/apache/libexec/libperl.so #18 0x8055dc8 in ap_init_modules () #19 0x806018b in main () #20 0x804e8b5 in _start () - The modules are pretty much skeletons, but link in the MySQL client library: apxs -c -L/app/pkg/mysql/lib/mysql/ -I/app/pkg/mysql/include/ \ -lmysqlclient -lm mod_aroma.c Right now, my workaround is NOT loading mod_perl.so. However, that's not a great solution! =) The mod_aroma module works fine when mod_perl isn't in there. This behaviour also happens when I use the DSO version of mod_auth_mysql at ftp.kcilink.com/pub I've got !clue. Any idea what it could be? Thanks in advance, Tom -- Tom Gidden Gid's Games e: [EMAIL PROTECTED]
RE: Re: Mod_perl X cgi Script
Hi guy!! Thanks for your reply!! and sorry for my english :) But, i need to run another script (not embperl script).. ex: I have a script (convert.pl) and any requests calling files with extension .com (ex: index.com) my script calling converte.pl. ex: | |index.com |- |converte.pl|---|return html result| | Ok ? do you understand me now ? Thanks again and best regards. Robson On Tue, 30 May 2000, wrote: not sure i understand this completely. i am assuming that you want embperl to work for only part of your site - yet it is handling for the whole site. if that's not what you meant - perhaps you need to rephrase. first of all - i think you need to use: Files ~ *\.shtml$ OR FilesMatch *\.shtml$ THEN, either change the extension for the embperl stuff only such as: *.ep OR limit the embperl to a particular directory Directory /path/to/embperl/stuff FilesMatch *\.shtml$ stuff /FilesMatch /Directory around the Files ~ or Filesmatch -- ___cliff [EMAIL PROTECTED] Robson Paiva Gomes wrote: Hi all, I Have problems to setup my apache with mod_perl 1.22 to run a perl script... I need to always execute one script that .com will be called archives with the extension. With HTML::Embperl (and mod_perl) is easy... in my configuration file, just add some lines (ex): Files *.shtm PerlSetEnv EMBPERL_OBJECT_BASE base.shtm PerlSetEnv EMBPERL_FILESMATCH "\.shtm$" SetHandler perl-script PerlHandler HTML::EmbperlObject Options ExecCGI /FilesAnd always that I execute archives with the extension .shtm it calls base.shtm. But I do not want to use the EMBPERL. To put I did not find correct documentation on the subject. sombeone could help me? Thanks for any quick reply and regards from Brazil. Robson
Apache::Session and blessed references
I can't seem to get Apache::Session to save the blessedness of an object. Is this an oversight on my part, a limitation of the module, a limitation of the database, or an intentional design decision? Conceptually, it seems as though an objects blessing is stored in a different place in the Perl guts than its contents. Is the problem just that Apache::Session never saves this information to the database? Has anyone else had occasion to do this? An example in Perl: # %session is a hash tied to a DB with Apache::Session 1.51 package main; my $dog_obj = { name = 'Fido', breed = 'Mutt' }; bless ($dog_obj, 'Dog'); $dog_obj-bark(); $session{my_dog} = $dog_obj; # The following line dies with an error: # cannot call method bark on unblessed reference. $session{my_dog}-bark(); package Dog; sub bark { my $self = shift; print "Woof! I'm $self-{name}"; }
Re: %udat persistence problem...S.O.S.
you might want to try: my $therequest=$r-the_request; my($host,$uri) = $therequest=~m!http://([^/]+)(.*))!; unless($host=~m!xyz\.com!){ $r-content_type('text/html'); $r-header_out(Location = "http://www.xyz.com$uri"); return REDIRECT; } you can probably also get mod_rewrite to do this for you very easily as well. -- ___cliff [EMAIL PROTECTED] "Hello!" wrote: sirs, i met a problem on EMBPERL_COOKIE_DOMAIN, which i set it to "xyz.com" for example. the IP address of my www.xyz.com is 123.99.88.77. %udat fails to be persistent if the URL entered in browser's Location box is http://123.99.88.77, very possibly because the domain part is "99.88.77" which is different from "xyz.com" i set for EMBPERL_COOKIE_DOMAIN so that the browser won't return the cookie EMBPERL_UID. i uncomment PerlSetEnv EMBPERL_COOKIE_DOMAIN but it still not work. or, how can i know entered URL is 123.99.88.77 (not SERVER_NAME) so that i can redirect the browser to www.xyz.com? is there any elegant remedy for such kind of user ignorance? thanks.huang-ming - Original Message - From: Gerald Richter To: Hello ; Embperl@Perl. Apache. Org Sent: Friday, May 12, 2000 2:04 PM Subject: RE: %udat persistence problem...S.O.S. I'm sorry I didn't read the mailing list, because I don't know how to get the list. Look at http://perl.apache.org/embperl/Embperl.pod.15.html#Feedback_and_Bug_ReportsGerald
Re: %udat persistence problem...S.O.S.
thanks a lot. but, does the_request() contain the host part (ie. 123.99.88.77for my case)of entered URL? it seems to contain only method, uri, and protocol only. huang-ming - Original Message - From: ___cliff rayman___ [EMAIL PROTECTED] To: Hello! [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, June 01, 2000 8:24 AM Subject: Re: %udat persistence problem...S.O.S. you might want to try: my $therequest=$r-the_request; my($host,$uri) = $therequest=~m!http://([^/]+)(.*))!; unless($host=~m!xyz\.com!){ $r-content_type('text/html'); $r-header_out(Location = "http://www.xyz.com$uri"); return REDIRECT; } you can probably also get mod_rewrite to do this for you very easily as well. -- ___cliff [EMAIL PROTECTED] "Hello!" wrote: sirs, i met a problem on EMBPERL_COOKIE_DOMAIN, which i set it to "xyz.com" for example. the IP address of my www.xyz.com is 123.99.88.77. %udat fails to be persistent if the URL entered in browser's Location box is http://123.99.88.77, very possibly because the domain part is "99.88.77" which is different from "xyz.com" i set for EMBPERL_COOKIE_DOMAIN so that the browser won't return the cookie EMBPERL_UID. i uncomment PerlSetEnv EMBPERL_COOKIE_DOMAIN but it still not work. or, how can i know entered URL is 123.99.88.77 (not SERVER_NAME) so that i can redirect the browser to www.xyz.com? is there any elegant remedy for such kind of user ignorance? thanks.huang-ming - Original Message - From: Gerald Richter To: Hello ; Embperl@Perl. Apache. Org Sent: Friday, May 12, 2000 2:04 PM Subject: RE: %udat persistence problem...S.O.S. I'm sorry I didn't read the mailing list, because I don't know how to get the list. Look at http://perl.apache.org/embperl/Embperl.pod.15.html#Feedback_and_Bug_ReportsGerald
Re: %udat persistence problem...S.O.S.
your right - sorry. i hadn't tried it - i was reading Apache Modules and did not read it correctly. i also tried variations of Apache::URI parse to get a hostname, but that did not seem to work on my development server. it is back several revs however. cliff Hello wrote: thanks a lot. but, does the_request() contain the host part (ie. 123.99.88.77 for my case) of entered URL? it seems to contain only method, uri, and protocol only. huang-ming- Original Message -From: ___cliff rayman___ [EMAIL PROTECTED]To: Hello! [EMAIL PROTECTED]; [EMAIL PROTECTED]Sent: Thursday, June 01, 2000 8:24 AMSubject: Re: %udat persistence problem...S.O.S. you might want to try: my $therequest=$r-the_request; my($host,$uri) = $therequest=~m!http://([^/]+)(.*))!; unless($host=~m!xyz\.com!){ $r-content_type('text/html'); $r-header_out(Location = "http://www.xyz.com$uri"); return REDIRECT; } you can probably also get mod_rewrite to do this for you very easily as well. -- ___cliff [EMAIL PROTECTED] "Hello!" wrote: sirs, i met a problem on EMBPERL_COOKIE_DOMAIN, which i set it to "xyz.com" for example. the IP address of my www.xyz.com is 123.99.88.77. %udat fails to be persistent if the URL entered in browser's Location box is http://123.99.88.77, very possibly because the domain part is "99.88.77" which is different from "xyz.com" i set for EMBPERL_COOKIE_DOMAIN so that the browser won't return the cookie EMBPERL_UID. i uncomment PerlSetEnv EMBPERL_COOKIE_DOMAIN but it still not work. or, how can i know entered URL is 123.99.88.77 (not SERVER_NAME) so that i can redirect the browser to www.xyz.com? is there any elegant remedy for such kind of user ignorance? thanks.huang-ming - Original Message - From: Gerald Richter To: Hello ; Embperl@Perl. Apache. Org Sent: Friday, May 12, 2000 2:04 PM Subject: RE: %udat persistence problem...S.O.S. I'm sorry I didn't read the mailing list, because I don't know how to get the list. Look at http://perl.apache.org/embperl/Embperl.pod.15.html#Feedback_and_Bug_ReportsGerald -- ___cliff [EMAIL PROTECTED]
Re: %udat persistence problem...S.O.S.
never mind. i turned to $req_rec-hostname() and it finally returned what i wanted, 123.99.88.77. related API document can be found on the book, "Writing Apache modules with Perl and C". thanks anyway. huang-ming - Original Message - From: ___cliff rayman___ [EMAIL PROTECTED] To: Hello [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, June 01, 2000 10:47 AM Subject: Re: %udat persistence problem...S.O.S. your right - sorry. i hadn't tried it - i was reading Apache Modules and did not read it correctly. i also tried variations of Apache::URI parse to get a hostname, but that did not seem to work on my development server. it is back several revs however. cliff Hello wrote: thanks a lot. but, does the_request() contain the host part (ie. 123.99.88.77 for my case) of entered URL? it seems to contain only method, uri, and protocol only. huang-ming- Original Message -From: ___cliff rayman___ [EMAIL PROTECTED]To: Hello! [EMAIL PROTECTED]; [EMAIL PROTECTED]Sent: Thursday, June 01, 2000 8:24 AMSubject: Re: %udat persistence problem...S.O.S. you might want to try: my $therequest=$r-the_request; my($host,$uri) = $therequest=~m!http://([^/]+)(.*))!; unless($host=~m!xyz\.com!){ $r-content_type('text/html'); $r-header_out(Location = "http://www.xyz.com$uri"); return REDIRECT; } you can probably also get mod_rewrite to do this for you very easily as well. -- ___cliff [EMAIL PROTECTED] "Hello!" wrote: sirs, i met a problem on EMBPERL_COOKIE_DOMAIN, which i set it to "xyz.com" for example. the IP address of my www.xyz.com is 123.99.88.77. %udat fails to be persistent if the URL entered in browser's Location box is http://123.99.88.77, very possibly becausethe domain part is "99.88.77" which is different from "xyz.com" i setfor EMBPERL_COOKIE_DOMAIN so that the browser won't return the cookieEMBPERL_UID. i uncomment PerlSetEnv EMBPERL_COOKIE_DOMAIN but it stillnot work. or, how can i know entered URL is 123.99.88.77 (not SERVER_NAME) so that i can redirect the browser to www.xyz.com? is there any elegant remedy for such kind of user ignorance? thanks.huang-ming - Original Message - From: Gerald Richter To: Hello ; Embperl@Perl. Apache. Org Sent: Friday, May 12, 2000 2:04 PMSubject: RE: %udat persistence problem...S.O.S. I'm sorry I didn't read the mailing list, because I don't know how to get the list. Look at http://perl.apache.org/embperl/Embperl.pod.15.html#Feedback_and_Bug_ReportsGerald -- ___cliff [EMAIL PROTECTED]
Re: Modifying of Apache::Session File
Hi, We've solved the problem. I don't know whether this is the way. We untie every time before we tie again and then change the hash. This seems to work. Is this the correct way of modifying the contents. Our session hash is not global. (Hope session object and hash are the same). Session hash is only local to the functions. We are using a file to store the values. Murali -Original Message- From: Jeffrey W. Baker [EMAIL PROTECTED] To: Differentiated Software Solutions Pvt. Ltd. [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: 01 June 2000 09:12 Subject: Re: Modifying of Apache::Session File On Wed, 31 May 2000, Differentiated Software Solutions Pvt. Ltd. wrote: Hi, We've got an application where on initial login we're creating the session file. Subsequently, we want to add more hash values into this session file. Immediately after creation if we add values to the session file, these values get stored. After a few pages we tried to modify the existing session file, by First, tie-ing the values to a session hash Second, Modifying the session hash. At the point of modifying the session, the program just hangs waits indefintely. Can anybody help us out with this problem. You must have leaked some session objects, and now you are holding stale locks. It is a frequent problem. If you are using a global for the session object, don't do that. Also don't make a circular reference to the session object. -jwb
test for mod_perl? for IIS?
I'm working on a project that has been running as CGI on Netscape and IIS. We were told to port to mod_perl on Apache. Now it seems we must also run on CGI on IIS and on Apache: three platforms total. Testing $ENV{'GATEWAY_INTERFACE'} allows us to detect CGI, but (correct me if I'm wrong) not whether that CGI is on Apache or IIS. What I'd like to know is the "right way" to test, from within a script, * whether one is running under mod_perl? Currently we're doing if($ENV{'GATEWAY_INTERFACE'} =~ /^CGI-Perl\//) { $MOD_PERL = 1; } else { $MOD_PERL = 0; } * whether one is running under IIS? Please reply directly to me as well as the list/group (I subscribe the digest), and TIA, [EMAIL PROTECTED]
Human readable flatfiles
Hello, I would like to ask a question about maintaining human readable flatfiles in general. I have a perl (non-modperl) program that needs some input data. Currently, it reads in the data by "require"ing another perl script that has statements to set the variables (as global variables). I did it this way so that I can easily edit the include file if I want to change values, and I can even put code in the include file to calculate values. But, I am finding that this does not work in modperl under "use strict". Apparently, code in a file called by require is not in the same variable scope. (If "use strict" is off, it works sometimes but other times the variables come out with the values from the previous invocation.) Here is an example of what I currently have: $series = $ENV{'QUERY_STRING'}; require "series_$series.i"; (do something with the variables $series_name, $series_prefix) and inside series_ranma.i, I have: $series_name = 'Ranma 1/2'; $series_prefix = 'Ranma'; @series_data = ( insert list here ); but this does not work, since in modperl the required file has a different variable scope. Two ideas I am thinking of are: (1) make series_$series.i into a text file instead, like this: Ranma 1/2 Ranma insert list here and read it in with fopen(SERIES, "series_$series.i") and SERIES. But then I wouldn't be able to put perl code inside it and it is less clear. (2) make series_$series.i into a subroutine that returns its values. I can require it, and then call the subroutine and get the return values, but this seems kind of kludgy to me. Does anyone have a better suggestion for maintaining human readable flatfiles containing data to be read? Is there a good CPAN module for it perhaps? Thanks, -Philip Mak ([EMAIL PROTECTED]) P.S. When replying to this message, please make sure my e-mail address is in the to field. I'm not sure if I'm subscribed to this mailing list or not. It seems to keep kicking me off or something, because I haven't been receiving any mail from it.
RE: [ANNOUNCE] Apache::Session 1.51
On Wed, 31 May 2000, James Xie wrote: Thanks. I have the storable module installed but I got the following error messages when I try to run "make test". Do I need to create the sessions database manually? I don't see it when I run the "mysqlshow" command. I have mySQL installed. The test suite is nonportable. You can safely ignore any database-related problems. Suggestions about making portable database test scripts are welcome. -jwb
RE: [ANNOUNCE] Apache::Session 1.51
The test suite is nonportable. You can safely ignore any database-related problems. Suggestions about making portable database test scripts are welcome. I think that DBD::CSV comes standard with DBI, would testing using that work ? -- robin b. In which level of metalanguage are you now speaking?
Re: Human readable flatfiles
I have a perl (non-modperl) program that needs some input data. Currently, it reads in the data by "require"ing another perl script that has statements to set the variables (as global variables). I did it this way so that I can easily edit the include file if I want to change values, and I can even put code in the include file to calculate values. But, I am finding that this does not work in modperl under "use strict". Apparently, code in a file called by require is not in the same variable scope. (If "use strict" is off, it works sometimes but other times the variables come out with the values from the previous invocation.) You need to read up a little on modules and "require" in Perl5. The quick and dirty solution is to use "do" instead of require. That will solve your immediate problem, but you'll still be reading the files every time which might eventually become a performance hit. What I do when I have things like config files is make actual unique packages of them. For example: (In My/Module.pm) package My::Module; # don't use strict here $foo = 7; (In some other program) use My::Module; print "$My::Module::foo\n"; Honestly though, your example makes it look like you'd be better off with dbm files and Tie::MLDBM or something. - Perrin
Re: Urgent: remove password from server cert?
(Ralf: Documentation bug, see below for details) This is addressed in the FAQ: http://www.modssl.org/docs/2.6/ssl_faq.html#ToC31 . "When you can be sure that your server is secure enough you perform two steps: 1. Remove the encryption from the RSA private key (while perserving the original file): $ cp server.key server.key.org $ openssl rsa -in server.key.org -out server.key 2. Make sure the server.key file is now only readable by root: $ chmod 400 server.key Now server.key will contain an unencrypted copy of the key. If you point your server at this file it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on that file are really such that only root or the web server user can read it (preferably get your web server to start as root but run as another server, and have the key readable only by root)." Ralf: document bug, it says "preferably get your webserver to start as root but run as another server". That should read '...as another user". --- Mat Butler, Winged Wolf [EMAIL PROTECTED] SPASTIC Web Engineer SPASTIC Server Administrator Begin FurryCode v1.3 FCWw5amrsw A- C+ D H+++ M+[servercoder] P+ R++ T+++ W Z++ Sm++ RLCT/M*/LW* a cl/u/v+ !d e- f h++ iwf+++ j p-+ sm++ End FurryCode v1.3 On Wed, 31 May 2000, Paul wrote: In a sudden (and late) moment of epiphany, I just realized (while writing a note to our CSA to please put the new server's startup in the machines boot cycle) that when we reboot (*every* monday morning in the wee hours) it's not terribly likely that anyone's going to be around to feed the password to the startup query. This really needs to be automated. Help? =o) Paul = Friends are those who, when you must inconvenience them, are less bothered by it than you. ;o] __ Do You Yahoo!? Send instant messages get email alerts with Yahoo! Messenger. http://im.yahoo.com/ __ Apache Interface to OpenSSL (mod_ssl) www.modssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager[EMAIL PROTECTED]
Urgent: remove password from server cert?
In a sudden (and late) moment of epiphany, I just realized (while writing a note to our CSA to please put the new server's startup in the machines boot cycle) that when we reboot (*every* monday morning in the wee hours) it's not terribly likely that anyone's going to be around to feed the password to the startup query. This really needs to be automated. Help? =o) Paul = Friends are those who, when you must inconvenience them, are less bothered by it than you. ;o] __ Do You Yahoo!? Send instant messages get email alerts with Yahoo! Messenger. http://im.yahoo.com/
Re: hang time, segfaults
Cliff WoolleyCentral Systems Software AdministratorWashington and Lee Universityhttp://www.wlu.edu/~jwoolley/ Work: (540) 463-8089Pager: (540) 462-2303 [EMAIL PROTECTED] 05/30/00 10:51AM It hangs a lot, especially on page reloads. Sometimes it deliverspages perfectly, other times it takes half a minute. The other day theerror log piled up with several dozen segfault child expirations whilechecking it from a coworkers desk, which probably explains the emptydocument pages he kept getting. I have no real clue why. Check your SSLRandomSeed and SSLSessionCache settings. Your SSLRandomSeed might be set to a blocking source of entropy (such as /dev/random as opposed to /dev/urandom on some platforms). You might be using a DBM Session Cache and be using a broken DBM library. What are these set to for you? The one thing amiss I can find is probably just ignorance on my part.When I telnet to the server, it's return output includes numbers that Iam not seeing in my web pages, which are no logical part of the outputthat I understand, and aren't there from the normal server. GET / HTTP/1.1 (** I send request headers **)Host: buda.bst.bls.comHTTP/1.1 302 Found (** It responds correctly **)Date: Tue, 30 May 2000 14:39:03 GMTServer: Apache/1.3.12 (Unix) mod_perl/1.23 mod_ssl/2.6.4 OpenSSL/0.9.5aLocation: https://buda.bst.bls.com:8443/Transfer-Encoding: chunked NOTE THIS HEADER. Content-Type: text/html; charset=iso-8859-115a (** but what is this? **)!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"HTMLHEADTITLE302 Found/TITLE/HEADBODYH1Found/H1The document has moved AHREF="https://buda.bst.bls.com:8443/"here/A.PHRADDRESSApache/1.3.12 Server at AHREF="mailto:[EMAIL PROTECTED]m"bos04111.al.bst.bls.com/A Port 8080/ADDRESS/BODY/HTML0 (** and this? **) The "extra" numbers denote the beginning and end of a chunk in the chunked encoding of the body of the response. (Transfer-Encoding: chunked). If you had a long response, it could be in multiple chunks. That's all. So no, they're not part of the web page, and yes, they are correct. =-) This is completely unrelated to slowness/hangs/segfaults. Hope this helps. --Cliff