Re: Cookies, CGI::App, and mod_perl
On Fri, Aug 01, 2003 at 01:14:44PM -0400, Perrin Harkins wrote: On Fri, 2003-08-01 at 13:04, petersm wrote: When running under mod_perl the cookie is no where to be seen. Do some debugging. Look at the traffic going back and forth. Test it with GET or lynx. See if the cookie header is being sent. To elaborate a little on this thread: I find ethereal http://www.ethereal.com/ useful for debugging situations like this. Certain browsers (that I won't name) behave in quirky ways that GET or lynx won't emulate, so it's often worth running ethereal in the background whilst using your site with various browsers, then analysing TCP streams in ethereal to see exactly what's happening. Tom
Re: caching questions
Sorry to step in here, but could I use any of the caching modules you mentionned in mod_perl2? thx tom Am Mon, 2003-07-21 um 21.45 schrieb Perrin Harkins: On Sun, 2003-07-20 at 15:47, Patrick Galbraith wrote: One thing that my code does is check to see if it's cache has been updated to the db, which I wish I could really have some sort of cache that's in one place in memory (as opposed to each child process). Well, you can't, unless you use threads. I know there's IPC, and also memcached. I've used IPC::Shareable before, but don't know if that's the route I'd wanna go. It's not. IPC::Shareable is very slow. If you want to share data, use Cache::FileCache, Cache::Mmap, MLDBM::Sync, or IPC::MM. Has anyone implemented a good caching system that sets up a global cache that you don't have to check constantly because you happen to have been served out by a child that doesn't have the latest cache from DB? One single memory object? The systems I listed above all use a shared cache that will have the same data regardless of which process accesses it. - Perrin
Use mod_perl2 in production environment?
Hi guys, within the next 2 months I have to create an webapplication from scratch using mod_perl for a customer. The customer wanted to host the application at his provider which refuses the installation of Apache2+mod_perl2 because he considers them to be Beta-Software whereas he considers Apache1+mod_perl1 under Win32 to be stable. My job is it now to write a response to our customer and I want to have some information from developers and/or users about the stability of Apache2+mod_perl2+Unix and Apache1+mod_perl1+Win32. thx Tom
RE: mod_perl not sending cookies
Usually when I have this problem the path and/or domain is incorrect. Try it without either. Tom -Original Message- From: Andrew Fritz [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 12:25 PM To: [EMAIL PROTECTED] Subject: mod_perl not sending cookies I'm using Apache:AuthCookie. I have set up a basic test site. It appears that AuthCookie never send the cookie even though the call to: $r-err_headers_out-add(Set-Cookie = $cookie); is there. If I modify the call to include a simple cookie: $r-err_headers_out-add(Set-Cookie = 'a=b'); it works. The value of $cookie is: jza70AuthHandler_JZA70=\Thisisatest\; expires=Tue, 11 Mar 2003 06:33:50 GMT; path=/thisisatest; domain=jza70 The expires field is from a log of a few days ago, but was valid (about 24 hours in the future) when it was sent. Any thoughts are apreciated. Andrew Fritz
RE: mod_perl not sending cookies
Andrew, Ya need to remember to CC the group as well. Copied from an oldish Netscape spec: -- domain=DOMAIN_NAME When searching the cookie list for valid cookies, a comparison of the domain attributes of the cookie is made with the Internet domain name of the host from which the URL will be fetched. If there is a tail match, then the cookie will go through path matching to see if it should be sent. Tail matching means that domain attribute is matched against the tail of the fully qualified domain name of the host. A domain attribute of acme.com would match host names anvil.acme.com as well as shipping.crate.acme.com. Only hosts within the specified domain can set a cookie for a domain and domains must have at least two (2) or three (3) periods in them to prevent domains of the form: .com, .edu, and va.us. Any domain that fails within one of the seven special top level domains listed below only require two periods. Any other domain requires at least three. The seven special top level domains are: COM, EDU, NET, ORG, GOV, MIL, and INT. The default value of domain is the host name of the server which generated the cookie response. path=PATH The path attribute is used to specify the subset of URLs in a domain for which the cookie is valid. If a cookie has already passed domain matching, then the pathname component of the URL is compared with the path attribute, and if there is a match, the cookie is considered valid and is sent along with the URL request. The path /foo would match /foobar and /foo/bar.html. The path / is the most general path. If the path is not specified, it as assumed to be the same path as the document being described by the header which contains the cookie. -Original Message- From: Andrew Fritz [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 7:07 PM To: Tom Murphy Subject: Re: mod_perl not sending cookies Bingo! That did it. I removed the path and domain and it works. No, the dumb questions: any idea what they should be set to to make it work. I'm testing with my hosts file modified to point to a local virtual host (jza70) instead of going to a real DNS accessable domain name (jza70.com). Is that the issue or am I missunderstanding what the domain field is specifying. I thought it specified the owner of the cookie. I'm not sure about the path field. Andrew Tom Murphy wrote: Usually when I have this problem the path and/or domain is incorrect. Try it without either. Tom -Original Message- From: Andrew Fritz [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 12:25 PM To: [EMAIL PROTECTED] Subject: mod_perl not sending cookies I'm using Apache:AuthCookie. I have set up a basic test site. It appears that AuthCookie never send the cookie even though the call to: $r-err_headers_out-add(Set-Cookie = $cookie); is there. If I modify the call to include a simple cookie: $r-err_headers_out-add(Set-Cookie = 'a=b'); it works. The value of $cookie is: jza70AuthHandler_JZA70=\Thisisatest\; expires=Tue, 11 Mar 2003 06:33:50 GMT; path=/thisisatest; domain=jza70 The expires field is from a log of a few days ago, but was valid (about 24 hours in the future) when it was sent. Any thoughts are apreciated. Andrew Fritz
PerlCleanupHandler called from default-handler
I have written a Apache::DBILogger style log mechanism. It is enabled via the perl.conf in the Server context as: PerlCleanupHandler NC::LogHandler It works correctly, except for the fact that request handle by the default-handler do not call this handler. The mod_perl cookbook makes note that: ..a C module has to specifically want this processing to occur-it is not called automatically. How do I allow for this handler to be called on all requests? Note I also tried this as a PerlLogHandler to no avail. TIA, Tom Murphy
RE: crazy problem
Here's the gist ... when I run some code which looks like ... my result = `/usr/local/bin/matlab input_file.m`; ... from a perl CGI, then matlab (a commercial math package) segfaults. However, when I run it from mod_perl on the same server it runs fine (it runs fine from the command line, btw). Sounds like a dynamic lib problem. W/o knowing your OS its hard to say what variable Apache is setting but try looking at one of these SHLIB_PATH,LD_LIBRARY_PATH. For anyone who may have Matlab available, btw, this is only with Matlab 6. Matlab 5 (which we no longer have a license for) works just fine. Yup, I suspect Matlab 6 requires a newer shared library of some sort. Cheers, Tom Murphy
Access to ap_send_fd_length in 1.0
I have a client for whom I manage documents, some of which are in pdf format. The documents are not in the web tree, and are served based on custom access etc., and some are encrypted on the files system. I am successfully do all this, and ultimately use send_fd to send the file(s). The client has noticed that through the managed process, the time to view the pdf is longer than viewing the same file through the default handler. I have discovered that this is most likely due to the fact that Apache is byteserving the file, allowing the first page to be viewed even though the complete file has not been downloaded. The complete time to download between the default handler and my handler are quite close, but the document comes up for partial view much quicker with the default handler. I have been able to use Apache::File to modify my handler to recognize when a byteserving request has come in ( using ap_set_byterange), and access the ap_each_byterange call to decode the header. However, it does not seem like the ap_send_fd_length is mod_perl accessible. Is there any issue with adding access to this API function? Also, will I have a problem setting the PARTIAL_CONTENT response? With the clients encrypted documents, I have the documents in memory only. I would like to use the send_fb/send_fb_length call in a similar fashion. I haven't done any XS/guts type programming, so I'm hoping this will be a relatively simple task. Thanks for any pointers, Tom Murphy
Re: Problems with Apache::compat and german special chars
one more patch on Apache::compat. When SUBMITING-Forms a whitespace(\s+) is replaced by +. We have to retransform this. Am Son, 2002-12-08 um 21.46 schrieb Tom Schindl: Problems with Apache::compat CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread cut-- [Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c format wrapped at /usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm line 217. , referer: http://localhost/discussion-board cut-- When I copy the lines of interest into a small perl program and execute it, everything works perfectly. What's going wrong there? cut-- map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/, $string, -1 cut-- thx tom -- Tom Schindl [EMAIL PROTECTED] bestsolution.at 215,216c215,218 $string =~ s/\+/ /g; return map { s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $_; } split /[=;]/, $string, -1; --- return map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/, $string, -1;
Re: Can't find Apache::ModuleConfig
Am Mon, 2002-12-09 um 03.06 schrieb Stas Bekman: Tom Schindl wrote: Thanks Stas. The documentation on perl.apache.org pointed me in a wrong direction (e.g. Apache::DBIPool (http://perl.apache.org/docs/2.0/user/overview/overview.html#Apache__DBIPool)) --cut- use strict; use Apache::TIPool (); use Apache::ModuleConfig (); use DBI (); --cut- Maybe one could mark the things not implemented yet with a big comment and remove things which will never implemented. I'm thinking of Apache::TIPool, Apache::ModuleConfig, ... . I'm planning to revamp these old docs all at once. Sounds good. Do you know how long this will take? May I ask more question? 1) How can I read params sent via GET or POST? In mod_perl-1.2x this was done via $r-param(bla). Apache::RequestRec does not provide such an method. For now use CGI.pm, till Apache::Request gets ported to 2.0. Apache::compat also provides methods to retrieve the params couldn't I use them? Although they're a little bit buggy (see my posting from yesterday Problems with Apache::compat and german special chars ). 2) Will Apache::TIPool ever implemented? Not in the way it's described in the overview, but yes should be implemented at some point. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com -- b e s t s o l u t i o n . a tEDV Systemhaus GmbH Thomas SchindlProject Management mobile ++43/664/314 59 58 Anton-Rauch-Str.6aA-6020 Innsbruck fax ++43/512/935834 http://www.bestsolution.at phone ++43/512/935834 signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Re: Can't find Apache::ModuleConfig
Thanks Stas. The documentation on perl.apache.org pointed me in a wrong direction (e.g. Apache::DBIPool (http://perl.apache.org/docs/2.0/user/overview/overview.html#Apache__DBIPool)) --cut- use strict; use Apache::TIPool (); use Apache::ModuleConfig (); use DBI (); --cut- Maybe one could mark the things not implemented yet with a big comment and remove things which will never implemented. I'm thinking of Apache::TIPool, Apache::ModuleConfig, ... . May I ask more question? 1) How can I read params sent via GET or POST? In mod_perl-1.2x this was done via $r-param(bla). Apache::RequestRec does not provide such an method. 2) Will Apache::TIPool ever implemented? thx tom Am Son, 2002-12-08 um 10.27 schrieb Stas Bekman: Tom Schindl wrote: Hi, I've installed perl-5.8.0, Apache2.0.43 and mod_perl-1.99_07. Now I want to use Apache::ModuleConfig but I can't find it anywhere. I've installed everything like it was shown on perl.apache.org. What have I done wrong? Any ideas? When looking at my old perl-5.6.1 installation with apache-1.3.x and mod_perl-1.2x, I found the module. Where has it gone now, do I have to use another module instead? mod_perl 2.0 has a much improved configuration customization framework. You implement everything in perl now. There is no more Apache::ModuleConfig, but there is Apache::Module. Since the change is very significant, I don't think we will be able to provide a back compatibility layer for this one. I'm working on the documentation for the custom configuration, but I still didn't finish in as I encountered bugs, which aren't resolved yet. So, either wait a bit, till I finish the doc. Or if you are in hurry, look at t/response/TestDirective/perlloadmodule* for examples. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com -- Tom Schindl [EMAIL PROTECTED] signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Problems with Apache::compat and german special chars
Problems with Apache::compat CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread cut-- [Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c format wrapped at /usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm line 217. , referer: http://localhost/discussion-board cut-- When I copy the lines of interest into a small perl program and execute it, everything works perfectly. What's going wrong there? cut-- map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/, $string, -1 cut-- thx tom -- b e s t s o l u t i o n . a tEDV Systemhaus GmbH Thomas SchindlProject Management mobile ++43/664/314 59 58 Anton-Rauch-Str.6aA-6020 Innsbruck fax ++43/512/935834 http://www.bestsolution.at phone ++43/512/935834 signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Re: Problems with Apache::compat and german special chars
I've found a work around for the problem, i would call it a patch because i don't know yet which side affects this replacement has. I have replaced cut--- return map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/, $string, -1; cut--- by cut--- return map { s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $_; } split /[=;]/, $string, -1; cut--- I don't know if pack has any advantages still I know that HTML::Entities converts characters this way, so it should work in most situations. Still does anybody know what's wrong with pack into mod_perl although it works in perl itself without any problems. I've also added a diff. thx tom Am Son, 2002-12-08 um 21.46 schrieb Tom Schindl: Problems with Apache::compat CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread cut-- [Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c format wrapped at /usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm line 217. , referer: http://localhost/discussion-board cut-- When I copy the lines of interest into a small perl program and execute it, everything works perfectly. What's going wrong there? cut-- map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/, $string, -1 cut-- thx tom -- Tom Schindl [EMAIL PROTECTED] signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Re: Problems with Apache::compat and german special chars
Sorry here's the diff which includes one more thing: When SUBMITING-Forms a whitespace(\s+) is replaced by +. We have to retransform this. tom Am Son, 2002-12-08 um 22.39 schrieb Tom Schindl: I've found a work around for the problem, i would call it a patch because i don't know yet which side affects this replacement has. I have replaced cut--- return map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/, $string, -1; cut--- by cut--- return map { s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $_; } split /[=;]/, $string, -1; cut--- I don't know if pack has any advantages still I know that HTML::Entities converts characters this way, so it should work in most situations. Still does anybody know what's wrong with pack into mod_perl although it works in perl itself without any problems. I've also added a diff. thx tom Am Son, 2002-12-08 um 21.46 schrieb Tom Schindl: Problems with Apache::compat CGI-PARAM-STRING: header=%DC%DC%DC%DCbody=%D6%D6%D6%D6type=save_thread cut-- [Sun Dec 08 21:39:09 2002] [error] [client 127.0.0.1] Character in c format wrapped at /usr/bestsolution/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache2/Apache/compat.pm line 217. , referer: http://localhost/discussion-board cut-- When I copy the lines of interest into a small perl program and execute it, everything works perfectly. What's going wrong there? cut-- map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/, $string, -1 cut-- thx tom -- Tom Schindl [EMAIL PROTECTED] 215,216c215,218 $string =~ s/\+/ /g; return map { s/%([0-9a-fA-F]{2})/chr(hex($1))/ge; $_; } split /[=;]/, $string, -1; --- return map { s/%([0-9a-fA-F]{2})/pack(c,hex($1))/ge; $_; } split /[=;]/, $string, -1; signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Can't find Apache::ModuleConfig
Hi, I've installed perl-5.8.0, Apache2.0.43 and mod_perl-1.99_07. Now I want to use Apache::ModuleConfig but I can't find it anywhere. I've installed everything like it was shown on perl.apache.org. What have I done wrong? Any ideas? When looking at my old perl-5.6.1 installation with apache-1.3.x and mod_perl-1.2x, I found the module. Where has it gone now, do I have to use another module instead? thx tom -- Tom Schindl [EMAIL PROTECTED] signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Re: adding company Foo uses mod_perl ads
You're absolutely right about this, more importantly that IT manglement tends to be really impressed by that.It doesn't seem to matter how many advantages I espouse to my managers here, nothing convinces them more quickly than Company X uses mod_perl. Kinda like they're not willing to come up with their own decisions :) I find that We used at eToys works far better than reasons *why* we used it. You know you're going to have a bad day when you see the sun come up. Over the curb. Brian Nilsen [EMAIL PROTECTED] On Tue, 26 Nov 2002, Stas Bekman wrote: As I was leaving Vegas I saw that billboard saying: Adidas uses SAP And I suppose that they run a bunch of similar ads using other big companies names. I think this is an interesting approach of advertising, where instead of advertising the merits of your product or going down on your competitors, you use a concrete example of a well known company that uses your software. So I thought to myself that in addition to our collection of: http://perl.apache.org/outstanding/sites.html http://perl.apache.org/outstanding/success_stories/index.html it'd be interesting to add some small ads similar to the ones used by SAP, though on the left menu bar at perl.apache.org, rather than billboards. e.g. TicketMaster uses mod_perl InternetMovieDatabase uses mod_perl Slashdot uses mod_perl etc. Of course if folks are willing to put them on their sites, that would be great too. But my point here is that when an IT person comes to perl.apache.org but who is still not convinced that mod_perl is something that he wants, this kind of local ads can help to make the right decision :) I guess a simple ImageMagic/GD script that glues the name on the prepared base and doing some color alternation will do the work of making several such ads without manual labour. And then we can randomly spread these at the perl.apache.org pages. Of course it'd be cool to use SVG, but unfortunately we are a long way before major browsers will support it and having users having these newer browsers :( __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: How do I force a 'Save Window?'
On Wed, Nov 20, 2002 at 11:24:33AM +0200, Issac Goldstand wrote: To force the save window is easy - make up your own content subtype (main type application) and set it: Content-Type: application/x-download-this-file-you-stupid-browser Remember to start with an x- as your type is obviously not registered with the IANA. Why not use the application/octet-stream MIME type as recommended in RFC 1521? Tom
[OT] Re: Yahoo is moving to PHP ??
Check out their online map site, they do use Python for that. snippet o' URL: http://maps.yahoo.com/py/maps.py?BFCat=. You know you're going to have a bad day when you see the sun come up. Over the curb. Brian Nilsen [EMAIL PROTECTED] On Thu, 31 Oct 2002, Gunther Birznieks wrote: You would think if they want an anal scripting language they would move to python not PHP. :) John Saylor wrote: Hi ( 02.10.30 03:22 -0500 ) Perrin Harkins: They didn't make their decision on performance though. They seem to have been most influenced by the idea that perl allows too much flexibility in coding style, although I can't see how PHP is going to help with that. Wow, I'd like what *they* had for lunch! Quasi-seriously, as someone who has had to maintain mountains of bad perl code, I know TMTOWTDI can have a downside; but the openness of the language is what has lead to its greatness ...
Re: SSL - mod_gzip - mod_perl = mod_proxy error
On Mon, Oct 21, 2002 at 08:11:16AM -0500, Nigel Hamilton wrote: * Even though your network may be fast - the last mile over a 28.8 K modem can be slow - and compression helps here Most modems use compression protocols such as V.42bis. You don't gain much, if anything, from compressing data sent through such devices, or from using other techniques such as stripping redundant whitespace from HTML. In my experience, most ISDN connections don't use link level compression - techniques such as mod_gzip have some merit in this case. Tom
PerlHandler Inheritance
This is probably a pointless question, but I'm mostly just curious if there is any way to get this to work. I've got two modules, Parent.pm and Child.pm. Parent.pm has a sub handler in it, and Child.pm has Parent in ISA. I can run a little driver script over these two and call Child::handler and have it execute Parent::handler, so I know the inheritance is working. However, if I setup my location directive like this: Location /test_child SetHandler perl-script PerlHandler Child /Location It tells me Undefined subroutine Child::handler called. I'm using Parent Child in startup.pl, and also doing a use Parent; in Child.pm for good measure. Is there any way to get mod_perl to execute the handler in the parent class automatically? Am I just completely missing something?
Re: PerlHandler Inheritance
That was exactly it, prototyping did the trick perfectly. I honestly had no idea that it would even have an effect on this. Thanks! On Fri, 4 Oct 2002, Geoffrey Young wrote: Tom Servo wrote: This is probably a pointless question, but I'm mostly just curious if there is any way to get this to work. I've got two modules, Parent.pm and Child.pm. Parent.pm has a sub handler in it, and Child.pm has Parent in ISA. I can run a little driver script over these two and call Child::handler and have it execute Parent::handler, so I know the inheritance is working. However, if I setup my location directive like this: Location /test_child SetHandler perl-script PerlHandler Child /Location It tells me Undefined subroutine Child::handler called. I'm using Parent Child in startup.pl, and also doing a use Parent; in Child.pm for good measure. Is there any way to get mod_perl to execute the handler in the parent class automatically? Am I just completely missing something? so long as you're preloading Child.pm via startup.pl or PerlModule, you probably just need to prototype your handler: sub handler ($$) { my ($class, $r) = _; } or, with later perls sub handler : method { my ($class, $r) = _; } you're using a feature called method handlers so you can look that up in the mod_perl literature for more information. --Geoff
Re: AxKit under Win32
On Wed, Sep 11, 2002 at 03:42:13PM +0100, Prakash Chatterjee wrote: Does anybody know where I can find information for installing and running AxKit under windows (is this possible?). Searching Google for axkit windows leads to: http://axkit.org/faq.xml (see Can I run AxKit on Windows?) http://www.perl.com/pub/a/2002/03/12/axkit.html?page=2 might also help. Tom
Re: [mp2.0] wrong crypt behavior
Fri, Sep 06, 2002 ve 09:57:01AM +0200 Enrico Sorcinelli napsal(a): On Fri, 6 Sep 2002 08:23:33 +0200 Tom? Prochzka [EMAIL PROTECTED] wrote: Hello, I use own PerlAuthenHandler module to verify users' login and password from database. For comparsion of password user entered and password stored in database is crypt function used. Here is the code: my $real_pass = $d-[0][0]; # crypted password from database my $salt = substr $real_pass,0,2; # salt my $test_pass = crypt $sent_pw,$salt; # in $sent_pw is the password user entered if ($real_pass eq $test_pass) { $r-subprocess_env(REMOTE_USER = $user); return OK; } else { $r-note_basic_auth_failure; return AUTH_REQUIRED; } Problem: Sometimes, although user entered correct password, is authentication rejected. I tried logging values of $real_pass and $test_pass and they differed. When I add line $r-log_reason(User $user tested (.$real_pass./.$test_pass.)...,); just before 'if' statement behavior is most of time correct. Can anybody help me? Thanks. Kacer Hi, It seems to be not a mod_perl related problem. However, try with: $test_pass = crypt $sent_pw,$real_pass; This is what I tried first (it's common in examples). Results were terrible. Kacer
[mp2.0] wrong crypt behavior
Hello, I use own PerlAuthenHandler module to verify users' login and password from database. For comparsion of password user entered and password stored in database is crypt function used. Here is the code: my $real_pass = $d-[0][0]; # crypted password from database my $salt = substr $real_pass,0,2; # salt my $test_pass = crypt $sent_pw,$salt; # in $sent_pw is the password user entered if ($real_pass eq $test_pass) { $r-subprocess_env(REMOTE_USER = $user); return OK; } else { $r-note_basic_auth_failure; return AUTH_REQUIRED; } Problem: Sometimes, although user entered correct password, is authentication rejected. I tried logging values of $real_pass and $test_pass and they differed. When I add line $r-log_reason(User $user tested (.$real_pass./.$test_pass.)...,); just before 'if' statement behavior is most of time correct. Can anybody help me? Thanks. Kacer
Make test failure when installing mod_perl 2.0 on Solaris 8 with Apache 2
tive/perlmodule-vh /export/home/software/apache_download_2_0_39/mod_perl-1.99_04/t/htdocs/testd irective/main /usr/local/lib/ perl5/5.8.0/sun4-solaris /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris /usr/local/lib/perl5/s ite_perl/5.8.0 /usr/local/lib/perl5/site_perl) at (eval 15) line 3. And this is repeated over and over. I have tried to find reference to these errors with no such luck, and would appreciate it if anyone on this list can shed some light on these errors and how I might resolve them. Thanks, Tom
Re: Mod_perl Application Development
On Sun, Aug 18, 2002 at 12:31:03AM +0100, Jonathan Lonsdale wrote: I'm curious to know how people approach application development with mod_perl in situations where there could be dozens of distinct screens/interfaces. I'm currently using the HTML::Template system. When using HTML::Template, I've found its query() method useful to tell the controller what code to call to pass data back to the template: http://perlmonks.org/index.pl?node_id=150608 Tom
__floatdisf: error Compling mod_perl 1.27, apache 1.3.26 on Solaris 8 with gcc 2.95.2
Hello, I'm not having a great day here! :-( Trying to install mod_perl 1.27 with apache 1.3.26 and perl 5.8.0 on Solaris 8 using gcc 2.95.2. I keep getting the following error when I run make test in the mod_perl source tree: letting apache warm up...Syntax error on line 7 of /opt/src/mod_perl-1.27/t/conf/httpd.conf: Cannot load /opt/src/mod_perl-1.27/t/../../apache_1.3.26/src/modules/standard/mod_negotiation.so into server: ld.so.1: ../apache_1.3.26/src/httpd: fatal: relocation error: file /opt/src/mod_perl-1.27/t/../../apache_1.3.26/src/modules/standard/mod_negotiation.so: symbol __floatdisf: referenced symbol not found If I comment out the offending line for mod_negotiation.so I get a similar error on libproxy.so. With both commented out the test completes with : Failed 2/33 test scripts, 93.94% okay. 23/280 subtests failed, 91.79% okay. make: *** [run_tests] Error 29 I think the errors are: internal/http-get.Internal Server Error internal/http-postInternal Server Error My main concern is the first error though. I've tried many options and settings and browsed the archives but I'm still not able to get this working. :-( Any help is appreciated, Tom My Configs:- PATH=/usr/local/bin:/usr/ccs/bin:/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin gcc -v :- Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/specs gcc version 2.95.2 19991024 (release) apache config.status :- CC=gcc \ CFLAGS= -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ LDFLAGS=/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/libgcc.a \ ./configure \ --activate-module=src/modules/perl/libperl.a \ --disable-rule=EXPAT \ --with-layout=opt \ --enable-module=most \ --enable-shared=max \ --with-perl=/usr/local/bin/perl \ $ mod_perl config :- LDFLAGS=`gcc -print-libgcc-file-name` CFLAGS= -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 perl Makefile.PL USE_APACI=1 APACI_ARGS='--with-layout=opt, --enable-module=most, --enable-shared=max, --with-perl=/usr/local/bin/perl' perl -V :- Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=solaris, osvers=2.8, archname=sun4-solaris uname='sunos maserati 5.8 generic_108528-11 sun4u sparc sunw,ultra-250 ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.95.2 19991024 (release)', gccosandvers='solaris2.8' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under solaris Compiled at Aug 12 2002 14:08:36 INC: /usr/local/lib/perl5/5.8.0/sun4-solaris /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl
Possible naming error when extracting mod_perl 2 tarball
Hi, I downloaded the mod-perl 2.0 tarball today from: http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz When I untar'd it: bash-2.03$ tar xf mod_perl-2.0-current.tar It extracted to the following directory: drwxr-x--- 13 software software 512 Jun 21 23:40 mod_perl-1.99_04 I was just wondering if this was correct (i.e mod_perl 2.0 extracting to mod_perl 1.99 directory). After looking at the files it looks like it is mod_perl 2 and therefore just a naming error in the archive - a minor issue, but I thought I would ask. Cheers, Tom
SOLVED: How to access base environment from Perl sections
Perhaps it's obvious but after years of mod_perl, I was blocked, probably because using this basic Perl ability is frowned upon in mod_perl due to performance issues. Of course, during startup, performance isn't an issue. :-) In my case, I wanted to PerlPassEnv all environment variables that began with EWINGZ_ Perl for ( grep { /^EWINGZ_/ } `env` ) { my ($key) = /^([^=]+)/; push PerlPassEnv,$key; } /Perl Stas: I asked this question almost exactly a year ago and nobody answered it. I asked it yesterday, and again nobody answered it. Perhaps this should be the Perl Sections section of the guide? After all, the guide already mentions something very similar to this. -- -- Tom Mornini -- InfoMania Printing and Prepress -- -- ICQ: 113526784, AOL, Yahoo, MSN and Jabber: tmornini
Re: SOLVED: How to access base environment from Perl sections
On Thursday, August 15, 2002, at 07:47 PM, Stas Bekman wrote: Tom Mornini wrote: Perhaps it's obvious but after years of mod_perl, I was blocked, probably because using this basic Perl ability is frowned upon in mod_perl due to performance issues. Of course, during startup, performance isn't an issue. :-) In my case, I wanted to PerlPassEnv all environment variables that began with EWINGZ_ Perl for ( grep { /^EWINGZ_/ } `env` ) { my ($key) = /^([^=]+)/; push PerlPassEnv,$key; } /Perl Stas: I asked this question almost exactly a year ago and nobody answered it. I asked it yesterday, and again nobody answered it. Perhaps this should be the Perl Sections section of the guide? After all, the guide already mentions something very similar to this. Funny, but there are too many things in the guide to remember. The new search feature exposes them all, just remember to use it. I was just about to add your tip, when I've found it http://perl.apache.org/docs/1.0/guide/porting.html#Passing_ENV_variables_to_CGI which was added about 3 years ago: http://perl.apache.org/docs/1.0/guide/Changes.html#05_17_1999_ver_1_11 may be we need to add a xref from the Perl sections section? Yes, that makes sense. I would NEVER have looked there, as: 1) It wasn't in the Perl or Configuration section 2) I wasn't trying to pass environment variables to CGI scripts. :-) I'll have to learn to use the search functionality! I'm not sure if I've said it before, but thanks for doing all that you do for the mod_perl community. I appreciate it. -- -- Tom Mornini -- InfoMania Printing and Prepress -- -- ICQ: 113526784, AOL, Yahoo, MSN and Jabber: tmornini
Perl sections and Apache-request-subprocess_env
I'd like to access the original Apache startup environment variables from within Perl> sections. Through experimentation and reading page 498 of the Eagle that I need to use Apache->Request->subprocess_env to access the original environment in order to do this, as %ENV is cleared at interpreter creation. However, I cannot figure out how to do this in Perl> sections! Apache->Request returns undef (reasonably so, as there is no current request) So, the question is this: How to get the equivalent of $r->subprocess_env from within a Perl> section? -- -- Tom Mornini -- InfoMania Printing Prepress -- -- ICQ: 113526784, AOL: tmornini, Yahoo: tmornini, MSN: tmornini
mod_perl install on SGI
Greetings, I am trying to install mod_perl with apache_1.2.26 on and SGI running 6.5.16. apache was installed from the freeware.sgi.com website using their very nice installer. Unfortunately, the clean up after installation seems to remove the Makefile that is used by mod_perl's Makefile. So running install mod_perl from cpan, I get the question Please tell me wher I can find your apache src [ ../apache_x.x/src] I can't seem to give it a path that works. I know the executable is at /usr/freeware/apache, but that gives the message can't open /Makefile No such file. I've also tried using /var/inst/fw_apache which is the downloaded source file. No dice. Any suggestion would be appreciated. Thanks, Tom Keller Thomas J. Keller, Ph.D. Oregon Health Science University MMI Research Core Facility 3181 SW Sam Jackson Park Rd. Portland, OR, USA, 97239 http://www.ohsu.edu/core
OT Job discussion, was Re: [JOB] Crack OOP Perl whitebox tester wanted
On Saturday, June 22, 2002, at 02:46 AM, Ged Haywood wrote: On Fri, 21 Jun 2002, Zac Morris wrote: Old fashioned is right, Can we decide whether this kind of post is or is not welcome on the List? For what it's worth, my inclusion of the list address on my reply was entirely accidental. When I saw my reply come back on the list, I was very surprised. I apologize for making such a silly mistake. I agree that posting my response to the list was severely off topic and completely inappropriate. -- -- Tom Mornini -- InfoMania Printing and Prepress -- -- ICQ: 113526784, AOL, Yahoo, MSN and Jabber: tmornini
[JOB] Crack OOP Perl whitebox tester wanted
We're 1 year into development of a system that is OO Perl, mod_perl, DBI and DBD::Oracle on Linux. We've spent a lot of energy doing it right and writing tests as we go. This has given us huge benefits in the life of the project, but our current whitebox tester has decided to move to Washington, D.C. so we need somebody to fill his large shoes. If you're a good Perl programmer who has a strong sense of "the way it should be" and can be simultaneously mean, nasty, angry, distrustful and unforgiving to Perl code and the opposite to people then we'd like to talk to you. This person doesn't do new development, per se, but he is responsible for making things better via testing, fixing, documentation and refactoring. This is a full time job at an office in the South Park area of San Francisco, California, USA. Telecommuters are NOT what we have in mind. Call us old fashioned that way. :-) Pay and benefits are good, though it's no longer 1998. :-) Best benefit is working with a small group of people that are highly motivated by doing it right. -- -- Tom Mornini -- eWingz Systems, Inc. -- -- ICQ: 113526784, AOL, Yahoo, MSN and Jabber: tmornini
Knowing your limitation - was Re: [JOB] Crack OOP Perl whitebox tester wanted
Thanks for your response, Zac. Our tech team is very small. I'm the manager of the group, and my management style would best be described as lackadaisical. :-) So, you're right, this requirement is based upon management weakness. I knew that when I posted the job offer. In fact, I even told that to the employee who was leaving for Washington D.C. as the reason why I couldn't keep him on. He understood completely, having worked with me. :-) While I agree that it would be ideal to simply pick the best person for the job, this obviously isn't completely realistic. For instance, we have a certain pay range that we can afford, and that will artificially limit who we can consider. Other people won't even know we have an opening. Others still might have a language or communications barrier that makes it impossible for us to work with them. Notice that this is not actually his deficiency, but ours. If we could just speak (insert language here). I just don't see adding one additional limitation to that by wanting someone to come to the office as all that big a deal. Many people prefer it, and in this economy, help is not scarce and people are willing to go the extra mile. After all, it's not about getting the best person, it's about getting the best work done. If I know that I can't effectively remote manage somebody so it would be silly for me to attempt this in vain. On Friday, June 21, 2002, at 08:30 AM, Zac Morris wrote: Old fashioned is right, and disregarding "telecommuters" is also extreemly short sighted and ultimaty limits your ability to provide the most quality solution...  I work for Cisco Systems in our RTP (NC) office. I work with two different groups, one based in San Jose and the other based in Ontario, as a "virtual team member" (what we call our telecommuter positions). I only bring all this up because I'm in exactly the role you've outlined here, and to be honest I don't think I would BE as successful as I am if I were located directly with either of these teams.  The need to have everyone "all together" is usually indicative of a larger problem in team dynamics, and communications. It usually represents a team in which "charasmatic" leadership is more important than technical know how or ability to get a job done. Now don't get me wrong, for a person to BE a successful "virtual team member" they have to have great communication skills, and be open to working with others in multiple formats to enable the best level of teamwork and participation.  With all this said, and based on my own personal experience in this role, I can tell you that what you're asking for here is a person to walk a VERY shape edge between the need to bring the best and brightest from people, without making it seem "personal". Actually having this role as an "outsider" to the day to day politics and interpersonal sabatoge of most bay area offices (yeah I lived there five years during the "boom") , gives a layer of abstraction that makes the job easier to perform. When someone is questioning things like style, or code effeciency it comes across MUCH easier (more acadimic) when that person is a "talking head", an IM box, or a voice on the telephone. It becomes less "personalized" and easier to "pick and choose" the best componants into a greater whole. It also isolates the individual who may end up doing a lot of refactoring to present the final solution.  Just something to consider. Open youself to the best people in the world and don't accept just the best you can find in your area, and you'll find that you solutions aren't also as limited...  -Zac Morris - Original Message - From: Tom Mornini To: [EMAIL PROTECTED] Sent: Thursday, June 20, 2002 11:30 PM Subject: [JOB] Crack OOP Perl whitebox tester wanted We're 1 year into development of a system that is OO Perl, mod_perl, DBI and DBD::Oracle on Linux. We've spent a lot of energy doing it right and writing tests as we go. This has given us huge benefits in the life of the project, but our current whitebox tester has decided to move to Washington, D.C. so we need somebody to fill his large shoes. If you're a good Perl programmer who has a strong sense of "the way it should be" and can be simultaneously mean, nasty, angry, distrustful and unforgiving to Perl code and the opposite to people then we'd like to talk to you. This person doesn't do new development, per se, but he is responsible for making things better via testing, fixing, documentation and refactoring. This is a full time job at an office in the South Park area of San Francisco, California, USA. Telecommuters are NOT what we have in mind. Call us old fashioned that way. :-) Pay and benefits are good, though it's no longer 1998. :-) Best benefit is working with a small group of people that are highly motivated by doing it right. -- -- Tom Mornini -- eWingz Systems, Inc. -- -- ICQ: 113526784, AOL, Yahoo, MSN and Jabber: tmornini
Re: CGI::Application
On Sunday, June 16, 2002, at 07:02 AM, Eric Frazier wrote: The big points I want to achieve right now, is to make everything I write OOP, separate HTML from code as much as possible, and to not make it impossible to deal with for the people I work with who don't know as much perl as I do. One thing that has proven immensely beneficial on the project that I'm working on now, which is very similar to yours in that it's a complete redo intended to be 'right', is this: Write each page's functionality in a package that is 100% removed, interface-wise, from HTML, then 'glue' that module to HTML (via HTML::Template for output and CGI.pm for input) in a module name identical to, but preceded by Apache:: So, we have a page module like: Functionality in CompanyName::page1, and glue code in Companyname::Apache::page1 Modules NOT under the CompanyName:: namespace cannot be dependent IN ANY WAY on mod_perl, but must be mod_perl clean, of course. This makes the module functionality very easy to test WITHOUT firing up Apache. We have a complete white box test suite that tests at the Perl level, and complete black box test suite that tests at the HTTP level. This proved a good strategy when we decided to implement a SOAP interface to some of our functionality. We made some new glue code in CompanyName::SOAP::page1 that was based on SOAP::Lite and it was just as easy as it should be, with 100% code reuse. -- -- Tom Mornini -- InfoMania Printing and Prepress -- -- ICQ: 113526784, AOL: tmornini, Yahoo: tmornini, MSN: tmornini
Re: Logging under CGI
On Tue, 11 Jun 2002, Sam Tregar wrote: On Mon, 10 Jun 2002, Tom Brown wrote: ?? AFAIK, Files opened in append mode, and written to without buffering, should _not_ get corrupted in any manner that flock would prevent. (basically small writes should be atomic.) Right, and does Perl write with buffering when you call print()? Yes, it does! huh? That's what $| is all about, and $|++ is a pretty common line of code. that should be pretty universal for most UNIXs I've actually never heard this before. I've been taught that if you have multiple processes writing to one file you must use flock() or another equivalent mechanism to prevent overwrites. Do you have a source where I could learn about guaranteed atomic file writes without locking under UNIX? man(2) open. see the O_APPEND option... the only footnote is that it doesn't work properly via NFS... This doesn't cover why small writes are atomic though. And man(2) write doesn't seem to either, but the open man page on my system says O_APPEND The file is opened in append mode. Initially, and before each write, the file pointer is positioned at the end of the file, as if with lseek. O_APPEND may lead to corrupted files on NFS file systems if more than one process appends data to a file at once. This is because NFS does not supAD port appending to a file, so the client kernel has to simulate it, which can't be done without a race condition. which certainly implies that you can expect local files _not_ to get corrupted. p.s. I'm not the only one who considers it impolite to have off-list messages taken back onto the list... I generally don't post AFAIK comments to lists, prefering to keep the signal to noise ratio higher. -sam -- [EMAIL PROTECTED] | Courage is doing what you're afraid to do. http://BareMetal.com/ | There can be no courage unless you're scared. | - Eddie Rickenbacker
Re: Load Balancing, mod_proxy, rewrite problem
I think I had a similar problem. It's a while since I tackled it, so I might be wrong. In any case, I was having problems doing proxy with a rewritemap. My reason for wanting to do this was so I could use the weighting feature of rewritemaps to do weighted load balancing between frontend and backend apaches. I mailed Engelschall, but I hear he gets so much mail about mod_rewrite that it takes him years to respond. In any case, I have a patch to mod_rewrite that fixed the problem for me. The breakdown of the issue was that mod_rewrite wouldn't do a proxy on a subrequest. Be warned: I think this patch causes problems with the automatic adding of trailing /'s on URLs. Tom On Tue, May 14, 2002 at 12:19:44PM -0400, Perrin Harkins wrote: mire wrote: I have code like this: RewriteEngine On RewriteLog /var/site/rewrite.log RewriteMaplb prg:/tmp/lb RewriteRule ^/trta$ http://${lb:prvi|drugi} [proxy,last] and a perl script (a copy from mod_proxy manual) but it doesn't work, it seems like perl script is waiting indeffinetly for input. Sorry, this is not a mod_perl problem. You should try the general Apache user mailing lists, or see if there's a list or newsgroup for mod_rewrite. - Perrin -- Tom Lancaster Red Hat, Inc. [EMAIL PROTECTED] (510)-986-8770 x 354 This patch is necessary to allow rewriterules to be applied to subrequests when they are meant to be proxied. We need this to allow mod_include to get /apps/include/pane.html from the app servers by proxy. --- apache_1.3.19/src/modules/standard/mod_rewrite.c.proxy-subreq Wed Jan 31 20:12:26 2001 +++ apache_1.3.19/src/modules/standard/mod_rewrite.cWed May 23 16:39:47 2001 @@ -1604,10 +1604,10 @@ /* * Ignore this rule on subrequests if we are explicitly - * asked to do so or this is a proxy-throughput or a + * asked to do so or if this is a * forced redirect rule. */ if (r-main != NULL (p-flags RULEFLAG_IGNOREONSUBREQ || - p-flags RULEFLAG_PROXY || +/* p-flags RULEFLAG_PROXY || */ p-flags RULEFLAG_FORCEREDIRECT)) { continue;
Re: Load Balancing, mod_proxy, rewrite problem
On closer examination, I don't think this will solve your problem - this helps when you want to proxy something that's been included via mod_include. Tom On Tue, May 14, 2002 at 09:32:54AM -0700, Tom Lancaster wrote: I think I had a similar problem. It's a while since I tackled it, so I might be wrong. In any case, I was having problems doing proxy with a rewritemap. My reason for wanting to do this was so I could use the weighting feature of rewritemaps to do weighted load balancing between frontend and backend apaches. I mailed Engelschall, but I hear he gets so much mail about mod_rewrite that it takes him years to respond. In any case, I have a patch to mod_rewrite that fixed the problem for me. The breakdown of the issue was that mod_rewrite wouldn't do a proxy on a subrequest. Be warned: I think this patch causes problems with the automatic adding of trailing /'s on URLs. Tom On Tue, May 14, 2002 at 12:19:44PM -0400, Perrin Harkins wrote: mire wrote: I have code like this: RewriteEngine On RewriteLog /var/site/rewrite.log RewriteMaplb prg:/tmp/lb RewriteRule ^/trta$ http://${lb:prvi|drugi} [proxy,last] and a perl script (a copy from mod_proxy manual) but it doesn't work, it seems like perl script is waiting indeffinetly for input. Sorry, this is not a mod_perl problem. You should try the general Apache user mailing lists, or see if there's a list or newsgroup for mod_rewrite. - Perrin -- Tom Lancaster Red Hat, Inc. [EMAIL PROTECTED] (510)-986-8770 x 354 This patch is necessary to allow rewriterules to be applied to subrequests when they are meant to be proxied. We need this to allow mod_include to get /apps/include/pane.html from the app servers by proxy. --- apache_1.3.19/src/modules/standard/mod_rewrite.c.proxy-subreq Wed Jan 31 20:12:26 2001 +++ apache_1.3.19/src/modules/standard/mod_rewrite.c Wed May 23 16:39:47 2001 @@ -1604,10 +1604,10 @@ /* * Ignore this rule on subrequests if we are explicitly - * asked to do so or this is a proxy-throughput or a + * asked to do so or if this is a * forced redirect rule. */ if (r-main != NULL (p-flags RULEFLAG_IGNOREONSUBREQ || - p-flags RULEFLAG_PROXY || +/* p-flags RULEFLAG_PROXY || */ p-flags RULEFLAG_FORCEREDIRECT)) { continue; -- Tom Lancaster Red Hat, Inc. [EMAIL PROTECTED] (510)-986-8770 x 354
Re: cannot build mod_perl-1.99_01 with httpd-2.0.36
% perl Makefile.PL MP_AP_PREFIX=/usr/local/src/apache/httpd-2.0.36 MP_AP_PREFIX needs to be a directory where apache is installed, not the source tree. when apache is installed it puts all headers into the installed include/ directory. Thanks for the info. That didn't seem to work either cd src/modules/perl make make[1]: Entering directory `/usr/local/src/apache/httpd-2.0.36/mod_perl-1.99_01/src/modules/p erl' gcc -I/usr/local/src/apache/httpd-2.0.36/mod_perl-1.99_01/src/modules/perl -I/usr/local/src/ap ache/httpd-2.0.36/mod_perl-1.99_01/xs -I/www/include -fno-strict-aliasing -I/usr/local/include -I/usr/lib/perl5/5.6.1/i386-linux/CORE -DMOD_PERL -O2 -march=i386 -mcpu=i686 -fPIC \ -c mod_perl.c mv mod_perl.o mod_perl.lo In file included from mod_perl.h:4, from mod_perl.c:1: modperl_apache_includes.h:46:22: apr_lock.h: No such file or directory make[1]: *** [mod_perl.lo] Error 1 make[1]: Leaving directory `/usr/local/src/apache/httpd-2.0.36/mod_perl-1.99_01/src/modules/pe rl' make: *** [modperl_lib] Error 2 ...I have no apr_lock.h in /www/includes. Do I need libapreq? If so, that install does not work either: ... apache_cookie.c:117: `c' undeclared (first use in this function) apache_cookie.c:118: invalid lvalue in assignment apache_cookie.c:120: request for member `r' in something not a structure or union apache_cookie.c: At top level: apache_cookie.c:144: parse error before `*' apache_cookie.c: In function `ApacheCookie_parse': apache_cookie.c:147: `retval' undeclared (first use in this function) apache_cookie.c:148: parse error before `)' apache_cookie.c:148: invalid lvalue in assignment apache_cookie.c:151: warning: assignment makes pointer from integer without a cast apache_cookie.c:156: `c' undeclared (first use in this function) apache_cookie.c:182: parse error before `)' apache_cookie.c: At top level: apache_cookie.c:196: parse error before `*' apache_cookie.c: In function `escape_url': apache_cookie.c:198: `p' undeclared (first use in this function) apache_cookie.c:198: `val' undeclared (first use in this function) apache_cookie.c: At top level: apache_cookie.c:230: parse error before `*' apache_cookie.c: In function `ApacheCookie_as_string': apache_cookie.c:232: `array_header' undeclared (first use in this function) apache_cookie.c:232: `values' undeclared (first use in this function) apache_cookie.c:233: `pool' undeclared (first use in this function) apache_cookie.c:233: `p' undeclared (first use in this function) apache_cookie.c:233: `c' undeclared (first use in this function) apache_cookie.c:234: parse error before `char' apache_cookie.c:248: `cookie' undeclared (first use in this function) apache_cookie.c:249: `i' undeclared (first use in this function) apache_cookie.c:256: `retval' undeclared (first use in this function) apache_cookie.c: At top level: apache_cookie.c:265: parse error before `*' apache_cookie.c: In function `ApacheCookie_bake': apache_cookie.c:267: `c' undeclared (first use in this function) make[1]: *** [apache_cookie.lo] Error 1 make[1]: Leaving directory `/usr/local/src/apache/httpd-2.0.36/libapreq-1.0/c' make: *** [all-recursive] Error 1 Any suggestions? Thanks ..Tom _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
cannot build mod_perl-1.99_01 with httpd-2.0.36
Hi, I have recently had to build a new Apache server and mod_perl for my website. OS: Linux RedHat 7.3 (2.4.18-3) I managed to build Apache (DSO) with no problems. However, I cannot subsequently build mod_perl successfully. I have downloaded but NOT built libapreq-1.0 yet. Here is the output of attempts at building mod_perl: % cd /usr/local/src/apache/httpd-2.0.36/ % gunzip mod_perl-1.99_01.tar.gz % tar xf mod_perl-1.99_01.tar % cd mod_perl-1.99_01 % perl Makefile.PL MP_AP_PREFIX=/usr/local/src/apache/httpd-2.0.36 % make make test snip... /usr/local/src/apache/httpd-2.0.36/include/ap_mpm.h:58:29: apr_thread_proc.h: No such file or directory In file included from mod_perl.h:4, from mod_perl.c:1: modperl_apache_includes.h:46:22: apr_lock.h: No such file or directory modperl_apache_includes.h:47:25: apr_strings.h: No such file or directory modperl_apache_includes.h:48:21: apr_uri.h: No such file or directory modperl_apache_includes.h:49:22: apr_date.h: No such file or directory modperl_apache_includes.h:50:25: apr_buckets.h: No such file or directory In file included from modperl_apache_includes.h:53, from mod_perl.h:4, from mod_perl.c:1: ...snip ...it's looking for header files from the apache dist, and exits. I can't figure out what gives here. The last build I did was some time ago (1.3.14 and mod_perl-1.24_01, I believe). Any suggestions? If this requires libapreq first, is there a help URL for it? Thanks alot. ..Tom _ Chat with friends online, try MSN Messenger: http://messenger.msn.com
Re: Solaris 8 lockups
Thank you, and Marc as well, it looks like it was a combination of both version options and having it compiled as a DSO. We've upgraded mod_perl and apache and no longer have mod_perl as a DSO, and except for new error messages popping up (nothing serious, mostly just slightly sloppy coding issues that will be easily fixed), it looks like it's finally stable, at least for the last little while. Thanks again for the help. Brian Nilsen [EMAIL PROTECTED] On Thu, 18 Apr 2002, Jamie LeTual wrote: We had problems with mod_perl compiled as a DSO under Solaris 8. Try it with mod_perl compiled into apache. Peace, Jamie On Thu, Apr 18, 2002 at 10:39:31AM -0700, Tom Servo wrote: We've recently started trying to migrate a number of Solaris 7 machines to Solaris 8, and everything seemed fine for a while. We have each box running its own static, dynamic (mod_perl) and ssl servers, and everything runs fine for 3-7 hours after starting the server. Eventually, however, the mod_perl children just stop responding. If you try to telnet into the port, the connection just hangs why trying to connect...we don't get a refused connection, and it doesn't let you connect to the point where you can issue an HTTP request. It just seems to stop responding and get stuck. Has anyone else run into any of these problems? So far we've had nothing like this happen with Solaris 7 and with Linux, but I can't even think where to start looking on Solaris 8. As a side note, this happened both on boxes that had been upgraded from 7 to 8, as well as boxes that had fresh 8 installs. Brian Nilsen [EMAIL PROTECTED] -- -[sent-from-the-office] ||| | HBE Software, Inc. | Email: [EMAIL PROTECTED] | | http://www.hbesoftware.com | AIM : Reng8tak| | (514) 876-3542 x259| Web : http://jamie.people.hbesoftware.com | --- perl -e 'for($c=0;$c=length unpack(B*,pack(H*,$ARGV[0]));$c+=7){$_=chr((ord packB*,0.substr(unpack(B*,pack(H*,$ARGV[0])),$c,7))+040);print;}' -- 55569d4010674fa9222d200c22d29801441872e2d2
Re: Solaris 8 lockups
We're running Apache 1.3.12, as for the mod_perl version, it's not reported in the logs when the servers start and there doesn't seem to be any source lying around, so I'm not sure how to determine its version number. If you could point me in the right direction on that, I'd appreciate it. It's running on Sparc hardware. Brian Nilsen [EMAIL PROTECTED] On Thu, 18 Apr 2002, Marc Slagle wrote: What version apache/mod_perl are you running? Also, were these intel solaris 7 servers or sparc? We've recently started trying to migrate a number of Solaris 7 machines to Solaris 8, and everything seemed fine for a while. We have each box running its own static, dynamic (mod_perl) and ssl servers, and everything runs fine for 3-7 hours after starting the server. Eventually, however, the mod_perl children just stop responding. If you try to telnet into the port, the connection just hangs why trying to connect...we don't get a refused connection, and it doesn't let you connect to the point where you can issue an HTTP request. It just seems to stop responding and get stuck. Has anyone else run into any of these problems? So far we've had nothing like this happen with Solaris 7 and with Linux, but I can't even think where to start looking on Solaris 8. As a side note, this happened both on boxes that had been upgraded from 7 to 8, as well as boxes that had fresh 8 installs.
Re: Solaris 8 lockups
Nevermind about mod_perl version number, looks like we're running 1.24 Brian Nilsen [EMAIL PROTECTED] On Thu, 18 Apr 2002, Marc Slagle wrote: What version apache/mod_perl are you running? Also, were these intel solaris 7 servers or sparc? We've recently started trying to migrate a number of Solaris 7 machines to Solaris 8, and everything seemed fine for a while. We have each box running its own static, dynamic (mod_perl) and ssl servers, and everything runs fine for 3-7 hours after starting the server. Eventually, however, the mod_perl children just stop responding. If you try to telnet into the port, the connection just hangs why trying to connect...we don't get a refused connection, and it doesn't let you connect to the point where you can issue an HTTP request. It just seems to stop responding and get stuck. Has anyone else run into any of these problems? So far we've had nothing like this happen with Solaris 7 and with Linux, but I can't even think where to start looking on Solaris 8. As a side note, this happened both on boxes that had been upgraded from 7 to 8, as well as boxes that had fresh 8 installs.
Solaris 8 lockups
We've recently started trying to migrate a number of Solaris 7 machines to Solaris 8, and everything seemed fine for a while. We have each box running its own static, dynamic (mod_perl) and ssl servers, and everything runs fine for 3-7 hours after starting the server. Eventually, however, the mod_perl children just stop responding. If you try to telnet into the port, the connection just hangs why trying to connect...we don't get a refused connection, and it doesn't let you connect to the point where you can issue an HTTP request. It just seems to stop responding and get stuck. Has anyone else run into any of these problems? So far we've had nothing like this happen with Solaris 7 and with Linux, but I can't even think where to start looking on Solaris 8. As a side note, this happened both on boxes that had been upgraded from 7 to 8, as well as boxes that had fresh 8 installs. Brian Nilsen [EMAIL PROTECTED]
Re: Sharing Variable Across Apache Children
Is the webserver useful if you have an error that warrants sending a mail? If sending an email means the server is broken having a flood of mails may be a feature. It will be incentive to fix whatever is breaking your server/db. Also, I would strongly recommend keeping your warning system as simple as possible. Why not have the servers output an error message to a file on a single nfs file system and then setup a crontab to watch the file(s)? One machine could run the crontab every minute. 60 mails/min isn't too much unless you are forwarding it to a beeper in which case you could write a quick script to only mail once per unit time. On Wed, Apr 17, 2002 at 11:56:36AM -0400, Benjamin Elbirt wrote: Wow, I never expected the response I got! Well, lets assume that I were to go with the shared memory option anyway... what would the pitfalls be / concerns? The truth is, I don't want a separate system (as per the e-mail about having an error handling server), and I don't want to have to manage the e-mail on the receiving end because I'm not the only person who receives it (didn't mention it, but I guess that's important). Further, I have no control over the mail server that handles the incoming mail so I'd have to handle it on the mail client (Outlook / Netscape Mail) resulting in the same problem I have now. Thanks, Ben Perrin Harkins wrote: Andrew Ho wrote: Your error handlers on your five load-balanced boxes send an HTTP request to this error handling box. That sounds kind of slow, since it requires a network connection to be created every time and some synchronous processing on the other end. It also depends on that box always staying up. I think e-mail is actually a good approach, since it's a robust message queuing system and if you use something like qmail-inject to send the e-mail it takes almost no time at all for mod_perl to finish with it and move on. You just need to process those messages on the other end instead of looking at the raw output, i.e. use Mail::Audit to keep track of the current state and remove duplicate messages. Matt posted something about PPerl yesterday, which could make a Mail::Audit script more efficient by keeping it persistent. - Perrin -- 28 70 20 71 2C 65 29 61 9C B1 36 3D D4 69 CE 62 4A 22 8B 0E DC 3E mailto:[EMAIL PROTECTED] http://thecap.org/
Re: modperl and SQL db select
On Thursday, March 21, 2002, at 01:05 PM, Dave Rolsky wrote: Further on, he was discussing threaded discussion forums and assumed a recursive query. While recursing the DATA is probably (though provabably not always) necessary, there is no need to storm the db with that many queries, since query setup time, queing, and results extraction have noticable time penalties. Extracting the data with a single query and recursing it in RAM is a much more db and cpu friendly idea. This I can agree on, though it is more a limitation of SQL, which provides no meaningful way to do a recursive query. Vanilla SQL, perhaps, but not Oracle's flavor! CONNECT BY PRIOR :-) -- -- Tom Mornini -- eWingz Systems, Inc. -- -- ICQ: 113526784, AOL: tmornini, Yahoo: tmornini, MSN: tmornini
RE: loss of shared memory in parent httpd
On Thu, 14 Mar 2002, Bill Marrs wrote: It's copy-on-write. The swap is a write-to-disk. There's no such thing as sharing memory between one process on disk(/swap) and another in memory. agreed. What's interesting is that if I turn swap off and back on again, what? doesn't seem to me like you are agreeing, and the original quote doesn't make sense either (because a shared page is a shared page, it can only be in one spot until/unless it gets copied). a shared page is swapped to disk. It then gets swapped back in, but for some reason the kernel seems to treat swapping a page back in as copying the page which doesn't seem logical ... anyone here got a more direct line with someone like Alan Cox? That is, _unless_ you copy all the swap space back in (e.g. swapoff)..., but that is probably a very different operation than demand paging. the sharing is restored! So, now I'm tempted to run a crontab every 30 minutes that turns the swap off and on again, just to keep the httpds shared. No Apache restart required! Seems like a crazy thing to do, though. You'll also want to look into tuning your paging algorithm. Yeah... I'll look into it. If I had a way to tell the kernel to never swap out any httpd process, that would be a great solution. The kernel is making a bad choice here. By swapping, it triggers more memory usage because sharing removed on the httpd process group (thus multiplied)... the kernel doesn't want to swap out data in any case... if it does, it means memory pressure is reasonably high. AFAIK the kernel would far rather drop executable code pages which it can just go re-read ... I've got MaxClients down to 8 now and it's still happening. I think my best course of action may be a crontab swap flusher. or reduce MaxRequestsPerChild ? Stas also has some tools for causing children to exit early if their memory usage goes above some limit. I'm sure it's in the guide. -bill -- [EMAIL PROTECTED] | Courage is doing what you're afraid to do. http://BareMetal.com/ | There can be no courage unless you're scared. | - Eddie Rickenbacker
Re: loss of shared memory in parent httpd
No, I can't explain the nitty gritty either. :-) Someone should write up a summary of this thread and ask in a technical linux place, or maybe ask Dean Gaudet. I believe this is a linux/perl issue... stand alone daemons exhibit the same behaviour... e.g. if you've got a parent PERL daemon that fork()s ... swapping in data from a child does _not_ have any affect on other copies of that memory. I'm sure swapping in the memory of the parent before fork()ing would be fine Admittedly, my experience is from old linux kernels (2.0), but I would not be suprised if current ones are similar. I'm sure it is the same on some other platforms, but I haven't used much else for a long time. -- [EMAIL PROTECTED] | Put all your eggs in one basket and http://BareMetal.com/ | WATCH THAT BASKET! web hosting since '95 | - Mark Twain
Re: Urgent: Can we get compiled codes(class files in java) in perl like in java
By 'compiled code ... just like that in Java' do you mean byte code? You may want to look at http://perlmonks.org/index.pl?lastnode_id=864node_id=76685 which I found by searching for 'compiled' at perlmonks.org. Your client is making a strange request. Most people put a higher value on source code than object code, and mod_perl makes source execute as quickly as object code, on average. Side note: please wrap your lines at something like 70 characters. On Thu, Mar 07, 2002 at 11:48:51PM +0530, A.C.Sekhar wrote: Hi all , I need a help. My requirement is like this, we are developing one portal site in perl5(mod_perl)-apache-linux. our client don't want the perl source code. He want only the compiled code. Is it possible to give the compiled code in perl just like that in Java? How can we do that, plz help us in this regard and tell me what to do and how to do? This is a bit urgent... Thanks and Regards A C Sekhar -- mailto:[EMAIL PROTECTED] http://www.ece.utexas.edu/~thecap/ 28 70 20 71 2C 65 29 61 9C B1 36 3D D4 69 CE 62 4A 22 8B 0E DC 3E
Re: How to do connection pooling
On Thu, Feb 28, 2002 at 09:38:39PM +0100, Joachim Zobel wrote: At 02:11 280202 +0530, you wrote: Hi all, How can I maintain the connections in perl? For this I want to use connection pooling to contol the traffic of my site How can I do this in perl? Can anybody help me in this regard? If possible please give the steps included in this Is Apache::DBI what you need? If not, why? It is in fact not about controlling traffic, its about reusing database connections to sve the time needed for a connect There was a discussion of database pooling and reusing DBI connections on Perl Monks today: http://perlmonksorg/indexpl?node_id=148233 Tom
Re: load balancing on apache
At least one person MUST mention Backhand! www.backhand.org I'm working on a project right now that is expected to grow to 100+ servers in the next 12 months. In past projects I've worked on, handling of the log files becomes non-trivial at numbers far below that, so I built the new system to log via Spread (www.spread.org) and it is a wonderful thing to behold. When you start building really big systems, the insignificant things become big things, and the big things become huge! :-) On a side note: we originally used mod_log_spread to log via Spread, but found it to be a fairly nasty solution (lots of errors in the log files, otherwise worked OK) so we instead used good old mod_log_config and piped the output to a Perl program that spreads the logs. -- -- Tom Mornini -- InfoMania Printing Prepress
Re: Perl and Microsoft Excel?
There's probably a far better answer to this than I can give, but if not, an interim solution might be having whoever maintains these Excel files save them as .csv files. Excel can do that, and while you lose all the fancy formatting, it just dumps them in a comma seperated list, then you can split on commas to get the values out of it. Hopefully someone else knows of a CPAN module to work with Excel files, though... Brian Nilsen [EMAIL PROTECTED] On Thu, 29 Nov 2001, Ian wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 In the wide and wonderful world of Microsoft and Linux, I'm in the need of an interesting soloution. I'm presenting this to the list because I've ran out of good ideas. The campus phone system has a 911 database that is in Microsoft Excel format, and they want to be able to take that information, and show it on a webpage, either via a search form, or in one big table. The problem is, they want to do it dynamically...the web server needs to yank it down from a samba share (or ftp), parse it, show it, and terminate. I'm really **really** new at anything perl wise...so I haven't the foggiest clue as to where I should start. I've finally gotten Apache/Mod Perl/Mod SSL installed, and working properly. Are there any modules for pulling information from an excel sheet? How about modules that keep the overworked admin from insanity? Ian - - From RFC 1925: (3) With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBPAa3NHRiiq+WL4fKEQKsRACgutpROPjPllax3Nvfat2R7YERlSQAn35Q 0vwYEFLgdzsz4Dfu98dUJzBy =Qs9B -END PGP SIGNATURE-
Re: [modperl-site design challenge]
On Monday 26 November 2001 10:07, Bill Moseley wrote: ---snip--- Does it need to render well in old browsers? (e.g. netscape 4.08) There's a lot of old browsers out there, but maybe anyone looking at mod_perl would be a bit more up to date... Bill Moseley mailto:[EMAIL PROTECTED] Hi: Think Accessibility! You really should be setting this up for global accessibility and for those with disabilities!Standards begin here, don't you think? Just a thought, Tom
Re: receiving XML by POST
On Mon, 26 Nov 2001, Joshua Chamas wrote: Maarten Stolte wrote: Hello, i'm trying to figure out how to receive an xml message/file/stream(?) using POST, and how to be able to then send that to somewhere else (DBI). We're using MASON, don't know if that is information needed in this, but i saw something about MASON picking up all posts. I believe the usual way to access POST data, $r-content, is only for form data. To get XML data, try this: my $buf = ''; $r-read($buf, $ENV{CONTENT_LENGTH}); This is a general mod_perl API issue, and not necessarily specific to Mason, though Mason may have some other API specific to this. This may in fact collide with Mason form processing if there is any, since a mod_perl application will hang if it tries to read the POST data twice. Mason generally does an automatic read of POST data, specify what form fields you want, and it'll stuff the values into variables named the same as the name fields in the POST data. You should just be able to have the XML be the value for some name/value pair, then do all your XML parsing/DBI work on that value.
Re: Cookie authentication
The aim of the cookie example in the eagle book is a bit more than just authentication. Most of the answers here to use a session ID here are quite right for most purposes, but the code in the eagle book offers to store information on the client side with the security of a signature. Its NOT just authentication. This has some advantages for applications which are on more than one server, which have to use an expensive central DB lookup and/or are not connected at all, since the only thing to share is the secret. This is quite perfect of a decentral intranet. In my last project i did a LARGE single sign on implementation over loads of applications which used those cookies for authentication and for getting the DN and preferred language out of the cookie, all w/o any need of further DB lookups or LDAP requests. Since the logic is quite simple its also possible to parse/check the cookie in tomcat or any other web application and leave the logon to a central server. The secret is then shared over an https connection. By rotating the secret one gets a certain level of security (and automated logout). More or less the eagle book offers the full implementation of a single sign on solution with some nice features already implemented, missing is the secret rotation with more than one secret and some intelligent caching of it (just retrieve anew on a failed signature check e.g. which is in some other cookie module on CPAN?). What its not in my opinion is a simple authentication, its to complicated for that. A simple session ID suffices - and with session IDs there are all those nice things to play as putting them into the DNS, doing some url rewriting with mod_rewrite or just putting them in every URL automagically with some class. I did not know that you could verify that someone has cookies turned on. Can you point me to where i can find out how to do this? Is there a variable that you can check? The ticketlogin example in the eagle book does this by setting a redirect_url cookie before redirecting you to the login page, if this cookie is missing there the - sorry youve no cookies please enable them - page is shown. [EMAIL PROTECTED]
Re: [challenge] new mod_perl site
On Tuesday 13 November 2001 11:57, Thomas Klausner wrote: Hi! On Wed, Nov 14, 2001 at 01:31:52AM +0800, Stas Bekman wrote: Obviously the site should be very light on graphics, but since you are a good web designer you know this and all the other requirements already. The only requirement we have is that this is an information site, so avoid fancy graphics and god forbid flash splashes :) - - - snip - - - Anyway, I think I will give it a try ... Hi: Well, take your time. As soon as I find out from the SuSE list what the path is to Apache on 7.1 to use, I'm goona try out the http://perl.apache.org/embperl/IntroEmbperlObject.pod.2.html Say, there's no deadline on this thing, is there? grin Tom
Re: [challenge] new mod_perl site
On Tuesday 13 November 2001 11:57, Thomas Klausner wrote: Hi! On Wed, Nov 14, 2001 at 01:31:52AM +0800, Stas Bekman wrote: Obviously the site should be very light on graphics, but since you are a good web designer you know this and all the other requirements already. The only requirement we have is that this is an information site, so avoid fancy graphics and god forbid flash splashes :) - - - snip - - - Anyway, I think I will give it a try ... Hi: Well, take your time. As soon as I find out from the SuSE list what the path is to Apache on 7.1 to use, I'm goona try out the http://perl.apache.org/embperl/IntroEmbperlObject.pod.2.html Say, there's no deadline on this thing, is there? grin Tom
Alias apache not work with include virtual
Hi, I'm having a problem and I wondered if it's a bugs. httpd.conf file: Alias /site/ c:\html\test\site . test.asp file: --#include virtual = /site/test.inc -- When I run the test.asp, the file test.inc not found, is this a bug ? but it does recognize when tried this: http://myserver/site/test.hml If there is a solution, please let me know. thanks. Tom _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
mod_perl, pipes, and No child processes
Hello all. I'm writing an app that opens a pipe to sendmail, which if memory serves, forks off a child process of apache to do the pipe, then exits as soon as it's finished. I was doing this with MIME::Lite, and it's been working absolutely splendidly on Linux and on Solaris 7. However, on Solaris 8 (and I don't know if this is related to the OS or not) it gives me all sorts of problems. Namely, this started after checking the return code on a MIME::Lite object called $msg after calling the send method. It usually returns a 1 on success, but on the new box it was returning 0, despite the fact that the e-mails were actually going out. I ended up writing a test on that just opens a filehandle to | /usr/lib/sendmail -t -ei -eom, then printing to the filehandle, and closing the filehandle. If memory serves, it's almost impossible to get something accurate out of this statement in mod_perl: open(SENDMAIL, | /usr/lib/sendmail -t -ei -eom) or do_something(); As that just reports on whether or not an apache child process was able to spawn, not whether it was actually able to open the pipe to sendmail. So, that runs fine, then the print works as I actually get the e-mails it's trying to send, but this bit of code: close(SENDMAIL) or print STDERR Filehandle close failed: $!; spits out: Filehandle close failed: No child processes Any ideas what is causing this? Like I said, the mail goes out fine, but it makes it pretty difficult to check the return code since it's always coming back false. In a related note, if anyone is feeling generous, do you know if $SIG{'CHLD'} gets called only when a child process exits on an error, or does it get called no matter how a child exits, even if it's gracefully like it's supposed to? Brian Nilsen [EMAIL PROTECTED]
Re: mod_perl, pipes, and No child processes
Any ideas what is causing this? Like I said, the mail goes out fine, but it makes it pretty difficult to check the return code since it's always coming back false. Shouldn't you check $? instead? I was under the assumption that doing something similar to: my $returnval = $msg-send(); Would give a similar answer. I'll give the $? a shot though. I've noticed that from the shell, it always has a 0, and that would show up as false under perl...
Re: mod_perl, pipes, and No child processes
On Tue, 6 Nov 2001, Luciano Miguel Ferreira Rocha wrote: I was under the assumption that doing something similar to: my $returnval = $msg-send(); Would give a similar answer. I'll give the $? a shot though. I've noticed that from the shell, it always has a 0, and that would show up as false under perl... Well, on the shell and every other program, an exit status of 0 means success, and a higher one means an error of some kind. Btw: /bin/false ; echo $? == 1 /bin/true ; echo $? == 0 Also, the SIGCHLD is sent when a child exits, no matter if in error. You should then check the $? for the reason of the exit and for the return code, if exited normally. Regards, Luciano Rocha I've done this now and am getting back a -1 in $?, despite the mail itself succeeding. How can I check the reason for an error code on $? ?
Re: Odd problem with Perl sections
On Wednesday, October 24, 2001, at 06:38 PM, Carolyn wrote: On Wed, Oct 24, 2001 at 03:01:25AM -0700, Tom Mornini wrote: in httpd.conf: 1 Perl 2$ErrorLog = |/home/tmornini/Source/ewingz/bin/spread_from_stdin.pl ERROR; 3 /Perl 4 ErrorLog |/home/tmornini/Source/ewingz/bin/spread_from_stdin.pl ERROR Lines 1-3 and 4 should do the same thing. They don't. I was having this exact problem yesterday, with CustomLog and LogFormat. I think it's to do with quotes - try putting single quotes around your $ErrorLog value, so apache will still see it as a quoted string. I too am setting CustomLog, and it takes two or three values. So I set @CustomLog and everything is fine. I set LogFormat outside the Perl section and have no need to make it dynamic, so I can't comment here. I worked around this by removing the need for the extra argument for the program I wanted to pipe to, the 'ERROR' in the above example. I just wrapped spread_from_stdin.pl with a shell script, and everything is fine, but I really do suspect that this is a bug. I don't believe that single quotes -vs- double quotes would make a difference. Both things end up a single scalar, and I seriously doubt that Apache can tell the difference... -- -- Tom Mornini -- InfoMania Printing Prepress
Re: Odd problem with Perl sections
On Wednesday, October 24, 2001, at 07:25 PM, Carolyn Hicks wrote: On Wed, Oct 24, 2001 at 06:52:13PM -0700, Tom Mornini wrote: I don't believe that single quotes -vs- double quotes would make a difference. Both things end up a single scalar, and I seriously doubt that Apache can tell the difference... well, I meant single *and* double quotes - so the value of $Errorlog is actually quoted itself, like it is in the non-perl-ified directive, because it contains a space. This fixed the problem I was having with LogFormat. But if it's working for you now, cool. Oh! I see now... :-) Thanks, that's very interesting. I completely misunderstood your first response, sorry about that! -- -- Tom Mornini -- InfoMania Printing Prepress
Re: Odd problem with Perl sections
On Wednesday, October 24, 2001, at 11:38 AM, Scott Lanning wrote: On Wed, 24 Oct 2001, Tom Mornini wrote: 1 Perl 2$ErrorLog = |/home/tmornini/Source/ewingz/bin/spread_from_stdin.pl ERROR; 3 /Perl 4 ErrorLog |/home/tmornini/Source/ewingz/bin/spread_from_stdin.pl ERROR [snip] When I use the Perl section (which I need to allow the path to spread_from_stdin.pl to be dynamic at runtime) I receive this error: [Wed Oct 24 09:52:25 2001] [error] Perl: ErrorLog takes one argument, The filename of the error log On line 4, you passed one argument delimited by quotation marks. On line 2, you passed two arguments: 1) |/home/tmornini/Source/ewingz/bin/spread_from_stdin.pl 2) ERROR so it seems you need to escape the space between them somehow (I guess by a backslash, or put single quotes around the double quotes, but I didn't test it). Yes, you're the second person to mention it, but you said it more clearly... This will work... $ErrorLog = q[|/home/tmornini/Source/ewingz/bin/spread_from_stdin.pl ERROR]; or qq[] if you need interpolation. (which I do) -- -- Tom Mornini -- InfoMania Printing Prepress
Re: [OT] excellent modperl/etoys article by Perrin revisited
I was told over the weekend by one of my old eToys cow-orkers that the current incarnation of www.etoys.com isn't running our old code. Leave it to KB to buy all the code then not bother to use it. I understand that's also the reason they couldn't be bothered to migrate the old accounts over. Brian Nilsen [EMAIL PROTECTED] On Thu, 25 Oct 2001, Gunther Birznieks wrote: I saw an article in today's ComputerWorld that indicates the technology et al for eToys was bought by another toy firm (KB) and they plan to put it up to sell toys for this holiday season again. http://www.computerworld.com/cwi/story/0,1199,NAV47_STO65008,00.html Perrin or others involved in the old eToys (or anyone in the new eToys) -- does anyone know if this is the same mod_perl technology you guys wrote? I think it will make an interesting success story follow up if it is successful because it would also show how easy it was for the intellectual property written in mod_perl to be resold and reintegrated into another IT infrastructure which would make VCs happy (ie they would think more about being able to fund projects based on mod_perl if they know they could always resell the IP). Thanks, Gunther __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Open Web Technology Company http://www.eXtropia.com/
Odd problem with Perl sections
I'm having a problem with Perl sections that I'm pretty sure shows a bug of some sort in the code that handles this. I've looked around a bit and can't find any Perl that is responsible for generating the error show below, so I figured asking the list was the best next step. in httpd.conf: 1 Perl 2$ErrorLog = |/home/tmornini/Source/ewingz/bin/spread_from_stdin.pl ERROR; 3 /Perl 4 ErrorLog |/home/tmornini/Source/ewingz/bin/spread_from_stdin.pl ERROR Lines 1-3 and 4 should do the same thing. They don't. I was banging my head against the wall with lines 1-3, so I took them out and added line 4, which works properly. I don't use them simultaneously, but mutually exclusively. When I use the Perl section (which I need to allow the path to spread_from_stdin.pl to be dynamic at runtime) I receive this error: [Wed Oct 24 09:52:25 2001] [error] Perl: ErrorLog takes one argument, The filename of the error log I think that this is a bug in whatever code validates $ErrorLog. It seems it doesn't know that ErrorLog can be piped into another program... Either that, or I'm being really dumb and missing something obvious. :-) Any help would be greatly appreciated. from server-info: Apache Server Information Server Settings, mod_perl.c, mod_log_spread.c, mod_access.c, mod_rewrite.c, mod_info.c, mod_status.c, mod_mime.c, http_core.c OHHorizontalRule.pdf Server Version: Apache/1.3.20 (Unix) mod_perl/1.26 -- -- Tom Mornini -- InfoMania Printing Prepress
Re: Excellent article on Apache/mod_perl at eToys
If memory serves, I think we had something like 20-30 proxy servers and I think, at the end, we had w21 through w112 for app servers, so something like 92 app servers. I don't remember how many search boxes though. Thanks for the article Perrin, I didn't know half of what you, Ollie, Chris, Adam, Doug, and others had put together. And secondly, thanks for teaching me all the stuff you did, I feel pretty lucky to have worked with you there. Brian Nilsen [EMAIL PROTECTED] On Fri, 19 Oct 2001, Perrin Harkins wrote: What I'd love to see is the avg spec and numbers of machines in each section. So how many proxy, mod_perl and search servers were required to give the phenomenal performance you managed to achieve. Well, this was a long time ago (I wrote the article over a year ago), and I don't remember exactly. The proxy machines were pretty basic, the search servers were heavy on CPU power, and the mod_perl servers were heavy on RAM. There were a lot of machines in the cluster, but I don't remember exactly how many and it changed over time. There were dozens of mod_perl servers when the cluster was at its biggest. Most of them were idle for the majority of the time, but they were all needed for the occasional peak load. I remember at one point I was feeling embarrassed about the number of machines and I told one of our sysadmins that it might have been a better strategy to get a big Sun box or two instead. He replied that a Sun box with equivalent power would have cost about 10 times as much as what we paid for our rackmounted Intel machines. After that, I didn't worry about it too much. - Perrin
Galleries/ModPerl/Images
I just caught the end of the discussion about Stonhenge::Pictures and Apache::Gallery ... I have been working on setting up a photography site for myself and a few other digital photographers. Is there a reason NOT to put the images in a database? It certainly seemed to speed up pattern searches on my site. The site is up in php right now (had to brush up for a job), but will be redev'd in mod_perl once I find out what the state of gallery management is for mod_perl. I've used a MySQL backend to hold the images in BLOBs (I have a table for each of the common sizes). Uploads go to a images table (original size) and then the database resizes so it doesn't have to do it on the fly. Maybe those of us doing gallery type stuff could get together and work on something in a more organized fashion?
The DEFINITIVE answer to: How much should I charge?
This whole thread can be answered very easily: ANSWER: As much as you can. That's it! That's the entire answer. Nothing else should figure in unless you personally wish to make exceptions for any reason you see fit. Did the people who ask this question grow up and become educated in a part of the world where free markets and capitalism did not exist? Perhaps in socialistic colleges in the U.S.? :-) -- -- Tom Mornini -- InfoMania Printing Prepress
Re: [OT] New Micro$oft vulnerability?
Slashdot has a report on this now, looks like a similar worm to CodeRed, but this one tries to hit numerous vulnerabilities, including backdoors left open by CodeRed. Brian Nilsen [EMAIL PROTECTED] On Tue, 18 Sep 2001, Nick Tonkin wrote: Sorry for the off-topic post; there was a lot of discussion here of CodeRed and Reuven's module to report attempted attacks. Since this a.m. I have had hundreds of requests like: /scripts/root.exe?/c+dir /MSADC/root.exe?/c+dir /c/winnt/system32/cmd.exe?/c+dir /d/winnt/system32/cmd.exe?/c+dir /scripts/..%5c../winnt/system32/cmd.exe?/c+dir /_vti_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe?/c+dir /_mem_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe?/c+dir etc. They seem to come in batches of a dozen or more with slight variations in the URI requested. I am thinking about adding support to CodeRed.pm (which should probably be renamed if so) to report these attacks via e-mail in the same way it does for CodeRed. Any interest in that? Or any info on these bogus requests? ~~~ Nick Tonkin
Re: [OT] New Micro$oft vulnerability?
You're tellin' me, I've now had word come down that we need to do a full audit of our Apache and *nix installations to make sure that they're okay. Nevermind the fact that the only problems we have so far is people opening up files called readme.exe in their e-mail. *slapsforeheadinfrustration* There are no stupid questions, but there are a lot of inquisitive idiots. Brian Nilsen [EMAIL PROTECTED] On Tue, 18 Sep 2001, Adi Fairbank wrote: I wish someone would just write a worm that would put these IIS machines out of their misery and stop causing the rest of us such a headache. Nick Tonkin wrote: Sorry for the off-topic post; there was a lot of discussion here of CodeRed and Reuven's module to report attempted attacks. Since this a.m. I have had hundreds of requests like: /scripts/root.exe?/c+dir /MSADC/root.exe?/c+dir /c/winnt/system32/cmd.exe?/c+dir /d/winnt/system32/cmd.exe?/c+dir /scripts/..%5c../winnt/system32/cmd.exe?/c+dir /_vti_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe?/c+dir /_mem_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe?/c+dir etc. They seem to come in batches of a dozen or more with slight variations in the URI requested. I am thinking about adding support to CodeRed.pm (which should probably be renamed if so) to report these attacks via e-mail in the same way it does for CodeRed. Any interest in that? Or any info on these bogus requests? ~~~ Nick Tonkin
Re: POST params with Location
There could be something I'm missing here, but I believe you need to use $r-content() to get POST arguments. Beware though, that once you call content() you can't call it again, so hang onto whatever comes out of it. Also...isn't it $r-args() or am I just completely missing something here? You can always do the whole $r-method() eq 'GET' ? $r-args() : $r-content(); dealy-bob too... Brian Nilsen [EMAIL PROTECTED] On Mon, 10 Sep 2001, Nathan Wiger wrote: Hey all- I'm beating my head against this issue, and I can't seem to figure it out. The problem is I have a Location block with a PerlHandler for a ticketing system app I'm writing: Location /tickets SetHandler perl-script PerlHandler Apache::TicketSystem /Location I'm using Apache::Request to access the params with this simple code: sub handler { my $r = Apache::Request-new(shift()); my %args = %{ $r-param }; # more code ... } When I call the app with GET params, everything works fine. When I use POST, though, I don't get anything in %args. Reading the manpage for Apache::Request it looks like I should automatically get the params, ala CGI.pm. Oh yeah, and CGI.pm doesn't work either, so it doesn't seem to be an Apache::Request problem. Am I doing something wrong? Does Location not support POST params? All the packages are at the latest rev as far as I'm aware. perl 5.6.1 apache 1.3.20 mod_perl 1.25 libapreq 0.33 Thanks for any help. -Nate -- Nathan Wiger Sysadmin and Perl Hacker Sun Microsystems
Re: cc=gcc
Jennya Dobreva wrote: Hello all, I haven't installed the optional packages of cc in my machine. Does somebody knows how can I replace all references for cc with gcc? If I use make CC=gcc or alias of the cc that doesn't work long time. That means I have to change some files, but I am not on clear which of them. Thanks in advance! / Jennya Dobreva could you not just ln -s /usr/local/bin/gcc /usr/local/bin/cc to make a symbolic link? That would keep you from having to do that forever. Otherwise, its usually in the Makefile file, but there may be several you will have to edit, and its not a permanent solution. I don't know if there is a configure directive. Tom Allen
Re: $r-args()
Once you change the method to GET and put the content in with $r-args();, it becomes GET data from the query_string. All the POST data is lost when you call content(), so you can no longer read it as POST data with $r-content() again. Brian Nilsen [EMAIL PROTECTED] On Wed, 29 Aug 2001, Rasoul Hajikhani wrote: Robert Landrum wrote: At 9:36 AM -0700 8/29/01, Rasoul Hajikhani wrote: Hello, I already have asked this question and got an answer for it, so please accept my forwarded apologies. However, I was trying something else and got stuck. I know in order to pass around query string, or form data, pnotes may be used. However, I am trying something else and it does not seem to work! $r = Apache::Request-new($r); # check for some condition if ($condition) { my $previous_uri= $r-param('previous_uri'); my $content = $r-param(); $r-method_number(M_GET); $r-method('GET'); $r-headers_in-unset(Content-length); $r-args($content); $r-internal_redirect($previous_uri); } So your goal is to turn a post request into a get request using an internal redirect. However, in my called handler, no Post data can be read. Can any one tell me why is that? Any comments welcomed... param does not work like args, and $content in this example will return the number of param keys (IIRC). I think you want my $content = join('',map{$_.=.$r-param($_)}($r-param)); Which should solve your problems (I think). I am affraid it did not work. I have no problem reading the data in the current handler, but right after redirect, which is also required to read the data, I loose all the POSTED data. Rob -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX.
Environment variables and mod_perl
I'm working on a project that is highly configurable via environment variables. I'd like a way to get those environment variables into my mod_perl processes so that the mod_perl portion of this project can be configured the same way as the non mod_perl portions. I know that I can use PerlSetEnv and PerlPassEnv. I've used these with my current configuration and they work. The problem is this: I'd like a method to do this flexibly so that when one of my team created a new configuration environment variable, they don't need to change two files, the environment setup shell script and the httpd.conf file! All the environment variables begin with the name of our company in upper case letters, followed by an underscore character. This code prints them all out just perfectly outside of mod_perl: [tmornini@millenium conf]$ perl for my $env ( grep /^EWINGZ_/,keys %ENV ) { print $env\n; } EWINGZ_DBI_USERNAME EWINGZ_ERROR_DB EWINGZ_CODE_BASE EWINGZ_ASSERT_ASSERTIONS EWINGZ_LOG_FILE EWINGZ_LOG_BASE EWINGZ_LOG_SPREAD_GROUP EWINGZ_HOST_NAME EWINGZ_OBJECT_WO EWINGZ_LOG_UPPER_LEVEL EWINGZ_SPREAD_NAME EWINGZ_LOG_OBJECT EWINGZ_DBI_PASSWORD EWINGZ_LOG_LOWER_LEVEL EWINGZ_DBI_DATASOURCE EWINGZ_OBJECT_PR EWINGZ_OBJECT_RO EWINGZ_OBJECT_RW However, this code doesn't work so well in a Perl section in httpd.conf: Perl open FH,'/tmp/env.txt'; for my $env ( grep /^EWINGZ_/,keys %ENV ) { push @PerlPassEnv,$env; print FH $env\n; } print FH All done\n; close FH; /Perl After startup, 1) The environment variables are NOT passed and 2) /tmp/env.txt contains a single line: All done which means that at startup, these environment variables aren't available to Perl sections, either. This does jive with page 423 of the Eagle book. Stas' excellent Guide is somewhat confusing on this subject: http://perl.apache.org/guide/config.html To pass all environment variables to the children with a single configuration directive, rather than listing each one via PassEnv or PerlPassEnv, a Perl section could read in a file and: But this won't work for the same reason as above, namely, the environment variables are visible at that time, and I don't want to write a Perl script to parse a sh script! :-) Also, I think that pushing an arrayref into @PerlPassEnv doesn't seem to make sense since PerlPassEnv only takes a single argument. Looks like this is an error that the line should read: push @PerlSetEnv, [ $key = $val ]; Or have I been smoking again? :-) How can I get around this? Thanks for everyone's time and attention! Configuration: Server Version: Apache/1.3.20 (Unix) mod_perl/1.26 Server Built: Aug 28 2001 22:53:29 mod_perl.c, mod_log_spread.c, mod_access.c, mod_rewrite.c, mod_info.c, mod_status.c, mod_mime.c, http_core.c Linux version 2.4.2-2 ([EMAIL PROTECTED]) (gcc version 2.96 2731 (Red Hat Linux 7.1 2.96-79)) #1 Sun Apr 8 20:41:30 EDT 2001 -- Tom Mornini -- eWingz Systems, Inc. -- ICQ 113526784
Re: Connection Reset on Mandrake Linux 8.0 / Apache 1.3.20 / ModPerl 1.26
Philip Mak wrote: I tried telneting to your web server to see what's going on. Look at this: $ telnet www.nonserviam.net 80 Trying 65.34.152.103... Connected to nonserviam.net. Escape character is '^]'. GET /modperl/index.pl HTTP/1.1 Host: www.nonserviam.net Hello!Connection closed by foreign host. The HTTP server did not return a proper HTTP header, which is why lynx doesn't like it. Looking at your mod_perl configuration... PerlSendHeader Off Try doing it with PerlSendHeader On. You also might need to add this line at the beginning of your script: print Content-type: text/plain\n\n; (or text/html) Thanks a million. I'm having one of those saturdays :-) It works like a champ, of course. I guess the only thing I don't understand is why with PerlSendHeader Off, isnt the webserver supposed to send headers? Does it not because it doesn't know what kind of content a .pl file is? In that case, shouldn't it send DefaultType (text/plain) ? Thanks again, I'm going to run autobench again and see if we get better results :)
Re: Just while we are so nicely [OT]: SQL Search Results in pages
On Thursday, August 2, 2001, at 04:07 AM, Joachim Zobel wrote: One of the really nice features of MySQL (OK, its not a real RDBMS, but who cares:) is LIMIT. Using Oracle I have found it a real pain to display search results in pages (of eg 20) while using connection pooling. The problem is that you can not be shure to repeat the same resultset on every page. This gets a real problem if the queries get expensive and I can't afford sorting because it destroys first row performance. Is there a generic soloution to this? Has anybody found this worth writing a pattern? Sure! Just store the results in your session, and display from there... -- -- Tom Mornini -- ICQ 113526784
Re: dbi abstraction layer on perlmonks
On Thursday, August 2, 2001, at 03:00 PM, Robert Landrum wrote: Sweet... I was getting kinda tired of my Linux box going down on me. You must be thinking Windows! -- -- Tom Mornini -- ICQ 113526784
Apple not yukky aymore: was [OT] Inspired by closing comments from the UBB thread.
On Wednesday, August 1, 2001, at 09:27 AM, Kyle Dawkins wrote: Fine, it's Apple (yuk). But it used to be *NeXT* and it used to be *Obj-C*, both very very fine things indeed. Hey now! Those are fighting words! :-) OS X Mach + FreeBSD Project Builder + GCC (Including Objective-C) in EVERY OS BOX CVS, SSH, Apache, Perl, etc. in EVERY OS BOX Nothing yuk about Apple anymore, at least on the software/OS side of the house! Apple = NeXT ! Thank God! Hell, in 15 or 20 years, this OS could be as enlightened as Linux. :-) -- -- Tom Mornini -- ICQ 113526784
Re: [VERY OT] Inspired by closing comments from the UBB thread.
On Wednesday, August 1, 2001, at 10:01 AM, Jay Jacobs wrote: On Wed, 1 Aug 2001, Kyle Dawkins wrote: Mixing HTML with Perl with SQL is bad and evil on every single possible level. If however you work in a two person company where you have barely enough time to go to the bathroom let alone think about creating your own database abstraction layer for a custom application and maintaining code means changing a link once a month. Then by all means embed away, and take the quick development path over performance or maintainability. This is, in my opinion, circular logic. Perhaps the reason that you barely have enough time to go to the bathroom is that you're writing the code the wrong way. :-) On the other hand, if you are completely broke and work on a non-profit project and the only system you have is a P200 with 64M of Memory, then you may want to think about avoiding templating systems, and doing nothing but a single module with embedded SQL with Perl and HTML. Assuming they're paying you anywhere near a living wage, their money would be better spent on modestly upgraded hardware than having you fumbling around with inefficient to maintain code. There is always more then one way to do it, and there's usually more then one right way to do it. Let's keep that in mind. Agreed. However, Perl + HTML + SQL isn't one of the right ways! :-) -- -- Tom Mornini -- ICQ 113526784
Re: Ultimate Bulletin Board? Jezuz.
i am tasked with the job of integrating Ultimate Bulletin Board (or UBB, from http://www.infopop.com) into a client's site. they have an I'm sorry. We were running the UBB for a while and have had a few headaches. 1. the quality of [perl] code in UBB is so phenomenally bad i can't believe people pay money for it. i can't believe it works (but it does). has anyone else ever experienced it? i guess i need a support group... it makes me cry and cuts me to the bone when i think that there are actually people out there who think that code like this is good. oh my god. it should be drop-kicked off the planet. Good lord are you right. You'd think that after all the revisions they've had of this software so far, somebody might have found a tab key or something. Also, note that it technically doesn't always work. The big thing you should watch out for is if one forum gets too many threads (usually when one of ours would reach around the 3000 mark), the software will just die. It'll completely lock up and use almost all the CPU until you go in and kill the apache processes. This was on a pretty fast machine in the meantime... 2. any problems with it under mod_perl? I have it running fine under PerlRun but I am not so sure it'll behave under Registry. I believe we ran it under PerlRun as well, but Registry I remember having some issues with. I'm sure that it can be tweaked to run under Registry, but as you said, the code is so horrific that after a couple of hours of pouring over that madness, I decided that I preferred jamming nails into my forehead as opposed to trying to get it to work right. This was an old version, btw, about 1 year old from now, so maybe things are better. *chortle* BTW, we ended up shifting over to vBulletin (PHP) and that's been behaving well, though the conversion to Slashcode is underway... Brian Nilsen
Re: Post processing Perl output through PHP
better, someone has written a makerpm.pl script which will build a .spec file for an RPM, from which you can build .src.rpm or .i386.rpm files... there is a version out there that works with rpm4, I won't post the it here in the hopes that someone who is maintaining a version _will_ speak up... basically it comes down to: /usr/src/redhat/SOURCES ./makerpm.pl --spec --source tarball.1.1.tgz /usr/src/redhat/SOURCES cd ../SPECS /usr/src/redhat/SPECS rpm -ba tarball-1.1.spec /usr/src/redhat/SPECS rpm -i ../RPMS/i386/perl-tarball-1.1.rpm I've typed the above from memory and may have botched filenames/syntaxes etc... search the list for similar and probably better examples.. On Sun, 15 Jul 2001, raptor wrote: Ironically, having tried the suggestion from Darren, I discover that I don't have LWP installed. My sysadmin however, will install anything for me as long as I provide him with an RPM for it. I don't mean to sound lazy, and I have just checked rpmfind.net, but I can't quickly put my hands on an rpm which includes LWP::Simple for Red Hat 7.0 ]- get checkinstall and install LWP on your computer as stated in the checkinstall docs and it will make the RPM for U :) http://mayams.net/~izto/checkinstall-en.html after u install checkinstall u have to do something like this : perl Makefile.pl make make test checkinstall make install HtH = iVAN [EMAIL PROTECTED] = -- [EMAIL PROTECTED] | Always bear in mind that your own resolution to http://BareMetal.com/ | success is more important than any other one web hosting since '95 | thing. - Abraham Lincoln
JOB: White box tester/developer
My company is looking for someone to break our code! We're early in development of a new system that will be perl, mod_perl, DBI and DBD::Oracle on Linux. We're trying very hard to do it right and we're writing tests as we go. This is giving us huge benefits already, but we want to go further. If you're a good Perl programmer who has a strong sense of the way it should be and can be simultaneously mean, nasty, angry, distrustful and unforgiving to Perl code and the opposite to people then we'd like to talk to you. Ideally you'd live in San Francisco, or thereabouts. I don't, however, so telecommuting is definitely an option. Pay and benefits are good, though it's no longer 1998. :-) Best benefit is working with a small group of people that are highly motivated by doing it right. -- -- Tom Mornini -- eWingz Systems, Inc. -- ICQ 113526784
RE: Apache 1.3.20, modperl 1.25, win32
Okay, I'm confused now. I thought those binaries were just for people who didn't have a win32 compiler handy. Don't they just use the regular source tree? I build mod_perl off of the apache source using nmake and visual c++. Here's a test: make a frameset with three panes. In the first two, call a mod_perl script that prints the time, pauses for 5 seconds, then prints the time again. The third one should just be a static image. When you try to load the page, you'll know if isn't running multithreaded if the panes in the frameset load sequentially; as in the second pane loads only after the first is finished. This request takes 10 seconds on my build, instead of the 5 it should take if both scripts ran concurrently. The problem I have is that my site uses a mod_perl content handler on nearly every html page for dynamic content. Obviously, running requests one a time would not work. I really hope there is a solution for this, because otherwise I have to figure out how to duplicate this in IIS (which means make an ISAPI extension and embedding perl in it... multithreaded perl at that). I'd like to stick with Apache, because I can move to Apache 2 eventually, if I change to IIS, I probably can never go back. What's the verdict: am I simply damned to IIS? -Tom From: Ender Josef [EMAIL PROTECTED] To: 'Tom Gioconda' [EMAIL PROTECTED] Subject: RE: Apache 1.3.20, modperl 1.25, win32 Date: Fri, 15 Jun 2001 08:18:18 +0200 Hi Tom Don't know anything about this problem. I'm using Randy Kobes Win32 binary from: ftp://theoryx5.uwinnipeg.ca/pub/other/ -Original Message- From: Tom Gioconda [mailto:[EMAIL PROTECTED]] Sent: Friday, 15 June, 2001 01:31 AM To: [EMAIL PROTECTED] Subject: Apache 1.3.20, modperl 1.25, win32 In my continuing quest to figure out how to port my Apache/modperl stuff to Windows per my company's all win2k servers mandate, I've been playing with Apache 1.3.20 and modperl on Windows. I was wondering if there is anyway to get this thing to handle more than one request at a time, without waiting for Apache2/modperl2 to be finished. I've noticed that several people seem to be using win32 and mod_perl. How are you guys dealing with the single-request problem? Oh, my Perl is ActiveState build 626 (binary distribution). I'm not attached to it though and can get a different build, if I can just get this thing to work. -Tom _ Get your FREE download of MSN Explorer at http://explorer.msn.com _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: templating benchmarks...
This benchmark can be very non-representive. If you don't know how to optimize each and every thing under test, you end up with unfair benchmark and come to potentially wrong conclusions. Take TT, add compiled template caching on the disk and shared TT object and I bet TT won't be at the bottom. In any case always remember that it's extremely hard to run a fair benchmark. I'd say it's almost impossible. The only fair benchmarking can be done if you know all the in's and out's of the 'things' under test and provide many benchmark tests each exploring a single property and not just 'one for all' benchmark. Of course it's a good thing to have benchmarks, but they all should be taken with a grain of salt. Absolutely. But I'd like to bring up something I've noticed in benchmarking 'real' sites: many, if not all, of the templating solutions appear to parse the whole of an html page. This is at least true of Apache::ASP and HTML::Mason, which I have used. Is it not ? I have produced really dramatic differences in performance in a two-tier setup by judicious use of mod_include vs. wholesale proxying of pages with dynamic content through to the mod_perl/Apache::ASP server. For example: In a situation with 1 lightweight frontend proxy and two backend mod_perl/Apache::ASP app servers ( with load distributed evenly using a patched mod_rewrite and its ability to select randomly from a list in a file ) , in one part of the site the dynamic headers and footers are generated by using !--#include virtual=/apps/include/pane.html?pane=headerlocation=$REQUEST_URI --, where the file being included is in fact proxied back to the app servers to receive content; in other parts of the site similarly simple pages are proxied in their entirety to the app servers. The results I can produce ( granted only with 'ab' ) are stunningly different: when I request the header and footer from the app servers using mod_include plus my modified mod_rewrite ( the stock version refuses to rewrite proxied requests ), I get up to 600 requests / second. When proxying the whole page through I get around 6 requests / second. Granted, I have other major bottlenecks involved: using Berkeley DB v1.x for session state, for one. Perhaps this explains some of it -- maybe the proxied header/footer requests never make session calls. I suspect that the wholesale parsing/eval-ing of html pages also plays a part. What do y'all think ? Tom _ 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://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: undef an array
On Fri, 1 Jun 2001, Scott Alexander wrote: Hi, in my code I have my @upper_id ; during the code I pass the array by reference to a sub routine and push values onto it. push @{$upper_id}, $row[0] ; This is odd syntax! Why not just: push @upper_id,$row[0]; I hope this isn't some sort of soft reference. Some of my code I have arrays of strings or ints. I might add 100 or more items to each array. The strings could be 50 characters long. What happens to the array at the end? Should I have a undef @upper_id ; at the end ? If I don't have this does it mean the array just stays in memory until the child is stopped? A the moment the max child life is set at 300. This is VERY low. Any help or pointers would be greatly appreciated. Fairly tricky question: Answers are my own, gleaned from years of faithful mailing list reading. 1) It's lexical, so it goes out of scope and is destroyed when that happens. 2) However, as an optimization, perl pretty much never releases back to the OS memory once used for variable storage, which saves on calls to malloc() and free(). 3) All memory is freed when the child dies. So, you don't need to do anything, but you'll never get the memory back until the child dies. It will run fast, however. :-) -- -- Tom Mornini -- InfoMania Printing and Prepress
Re: undef an array
On Fri, 1 Jun 2001, Ken Williams wrote: during the code I pass the array by reference to a sub routine and push values onto it. push @{$upper_id}, $row[0] ; This is odd syntax! Why not just: push @upper_id,$row[0]; I hope this isn't some sort of soft reference. Scott's is correct - he said the push() happens inside a different subroutine, and the array is passed to it by reference. Yes, that's obvious, now that you've pointed it out and I've read the post that I was responding to. :-) Sorry for that everyone, and Scott in particular. Could be shortened to 'push @$upper_id, $row[0];', but no biggie. No biggie certainly. -- -- Tom Mornini -- InfoMania Printing and Prepress
forced win32 mod_perl
My company, to my objections, recently decided to force all of our new servers to running only Win2k. I won't go into the details, but let's just say that in our standard hosting facilities, nothing runing Linux is allowed anymore. This kinds of screws my department, as we have just finished development on a Linux/Apache solution tied heavily into mod_perl for a support web site. This leaves me with few options: 1) Run Apache/win32 and mod_perl. 2) Run IIS 5 and use an ISAPI handler to hook into my perl code. Could anyone help me out here? The first option is bad because of mod_perl's reduced functionality on win32 in version 1.25 (no threads, to my understanding). Option 2 is evil because I'd have to figure out some way to get an ISAPI extension to call perl code in a multithreaded way, and I'd have to use IIS. Am I stuck waiting for Apache 2 and mod_perl 2 to get to a point where they'll work in a production environment, or am I simply screwed and have to work around my company's dumb decree? Any help would be appreciated, although no comments on my company's IT policies, please... :) -Tom _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: forced win32 mod_perl
It was my impression that PerlEx handled the persistance and what not, but it wouldn't allow one to make a content handler using perl. I need some way of processing every html file through my TemplateHandler::handler method. The way I was doing this was telling Apache to use my method as the content handler, instead of Apache just return the results, I was processing the file and sending those results to the client. PerlEx only does the part that keeps the perl interpreter running, right? If it does more, is there documentation that shows how this is done? I certainly couldn't find anything about content handlers on their sites. From: Chris Winters [EMAIL PROTECTED] To: Tom Gioconda [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: forced win32 mod_perl Date: Thu, 24 May 2001 20:44:01 -0400 ActiveState sells a (IMO) cheap solution for just this sort of thing: PerlEx. (http://www.activestate.com/perlex/) Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988. _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: Connection to MySQL DB fails when mod_perl enabled...
I appreciate what you were looking for Ken. But that's the point - I don't get an error string. All I get is an Internal Server Error. Sorry if I'm pointing out the obvious, but that's what you usually see in the browser. The real error message will be in your apache logs, quite often in /var/log/httpd/error_log, but defined in your apache configuration. -- Tom Lancaster Red Hat, Inc. [EMAIL PROTECTED] (510)-986-8770 x 354
Re: Throwing die in Apache::Registry
Mark-- While you may be having problems with segfaults because of expat = yes rule-- i was having similar problems with XML parser relating to the the die statement. I do the same thing as far as eval'ing the parsefile call. Also, I removed the die statement from parser.pm (v 2.29 line 240 or so) so it would return a useful error message rather than just die uninformatively. Maybe this is what you were asking about? Tom At 09:19 AM 5/4/01 +0100, Matt Sergeant wrote: On Fri, 4 May 2001, Perrin Harkins wrote: on 5/4/01 9:28 AM, Mark Maunder at [EMAIL PROTECTED] wrote: I have an Apache::Registry script that is using XML::Parser. The parser throws a 'die' call if it encounters a parse error (Why?). Because it's an exception and the parser can't continue. I was handling this by putting the code in an eval block, but this no longer works since all Registry scripts are already in one huge eval block. It should still work. An eval{} is scoped like any other block. Maybe you have a typo? Post your code and we'll look at it. More likely is a b0rked $SIG{__DIE__} handler, like fatalsToBrowser. Yick. -- Matt/ /||** Founder and CTO ** ** http://axkit.com/ ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** mod_perl news and resources: http://take23.org ** \\// //\\ // \\
Re: HELP??? Installation on MAC OS X
Tenon Systems has a current version of Apache with complete GUI administration engine at http://www.tenon.com/products/itools-osx/ This is a commercial product... On Friday, April 27, 2001, at 10:16 PM, Charlie Garrison wrote: G'day, I am trying to install mod perl on the Apple OS X Server platform. I can compile the code OK, both as static and as a DSO but when I try to restart the apache server, I get all sorts of errors. I found that it was already compiled, but the needed lines in httpd.conf were missing. Add the following two lines (at the end of the appropriate lists): LoadModule perl_module libexec/httpd/libperl.so AddModule mod_perl.c And then add some mod_per directives (I've used the perl/perl syntax): perl require /etc/httpd/startup.pl; # contains 'use' statements, etc. $Location{'/perl-status'}-{SetHandler} = 'perl-script'; $Location{'/perl-status'}-{PerlHandler} = 'Apache::Status'; $Location{'/perl-status'}-{order} = 'deny,allow'; $Location{'/perl-status'}-{'deny from'} = 'all'; $Location{'/perl-status'}-{'allow from'} = '.your.domain.com'; $Files{'~ \.pl$'}-{SetHandler} = 'perl-script'; $Files{'~ \.pl$'}-{PerlHandler} = 'Apache::Registry'; $Files{'~ \.pl$'}-{Options} = 'ExecCGI'; /perl I'm now able to do all development/testing on my box. I was able to install all needed modules via CPAN without any trouble. This was one of the reasons I wanted this OS, so I'm very happy. Charlie -- +--+ | Charlie Garrison [EMAIL PROTECTED] | | Garrison Computer Services http://www.garrison.com.au | | PO Box 141 | | Windsor NSW 2756 Australia Ph: +61 2 4575-5247 | +--+
Re: ANNOUNCE: Apache::Reload 0.07
Would Apache::Reload be helpful in the case where you have multiple virtualhosts which each want their own @INC ? I tried fixing this problem with a previous release, but gave up when I realized the implication of all those use lib () directives in my modules. If you think so, maybe you should add something to this effect to the docs. Regards, Tom On Sun, Apr 22, 2001 at 07:14:34PM +0100, Matt Sergeant wrote: This is a minor update as promised with some patches from a couple of sources to help reload when use lib is in effect. Let me know if it works (or doesn't) please. -- Matt/ /||** Founder and CTO ** ** http://axkit.com/ ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** mod_perl news and resources: http://take23.org ** \\// //\\ // \\
Re: Sendmail or not?
- Original Message - From: "Sean Chittenden" [EMAIL PROTECTED] To: "Per Einar" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, April 08, 2001 11:42 AM Subject: Re: Sendmail or not? if you | to sendmail, then you still fork. Mail::Sendmail, I bet dime to dollar, forks and execs a process. The only way to avoid forking is to open a socket and send the message via SMTP (or QMQP if you want to pimp your system out with qmail). Unless you're on AIX or solaris and performance is an issue, fork and get the job done w/ minimal headaches. -sc No, Mail::Sendmail sends through SMTP. That's why I talked about it. So, you're saying that I should just fork anyway? Will there be a big performance loss on Linux? And should I use Apache::Subprocess for this, or just go ahead with a standard pipe? Oh man, have I been here. After starting with forking, and then graduating to Mail::Sendmail, we finally realized that you could have your cake (queuing) and eat it too (no forking) by using Mail::Sendmail to deliver messages for relay to a mailhost (even if it's the same machine). Performance is best the mailhost is a dedicated machine, or load balanced group of systems. On Sunday, April 8, 2001, at 02:52 AM, Per Einar wrote: -- -- Tom Mornini -- ICQ 113526784
Re: Sendmail or not?
On Sunday, April 8, 2001, at 04:16 PM, Ask Bjoern Hansen wrote: On Sun, 8 Apr 2001, Tom Mornini wrote: I don't understand why anyone would do anything else than just forking to qmail-inject. At least on Linux and FreeBSD that goes reasonably fast (you're not sending hundreds and hundreds of mails per minute, are you?), is really simple and the mail will be delivered faster than your mail program can login to the mail server. Well, actually, yes, we were sending a HUGE amount of mail for various reasons, none of which were spam-related. :-) The site that I worked on went from a single box with no traffic to 3M fully dynamic, DB transaction, language-translate on the fly, page views per day. The site also generated 16Mbs AVERAGE traffic out of our co-location facility. In addition we were routing over 20M SMS messages per month, many of which were delivered via SMTP. This traffic was on top of the regular account verification and password forgotten e-mails. And in addition to that, we were hosting forward to SMTP and forward to SMS mailboxes. As the site grew, we learned better and better ways of doing things. I'll never again think in terms of "this will work for a while" if I can help it, because when sites get popular, they get popular FAST, and it's a real pain to scale things after the fact. :-) -- -- Tom Mornini -- ICQ 113526784
Re: mod_parrot
Hmmm. What was the date that this was announced? :-) On Monday, April 2, 2001, at 06:48 AM, Rod Butcher wrote: Does this mean Perl 6 is dogmeat ? Rod On Monday 02 April 2001 12:20, Bill Moseley wrote: I assume everyone saw this... ;) http://www.oreilly.com/parrot/ Bill Moseley mailto:[EMAIL PROTECTED]
Re: mod_perl BOF
Which hotel? On Thu, Mar 29, 2001 at 02:55:35PM +0100, Matt Sergeant wrote: On Thu, 29 Mar 2001, Geoffrey Young wrote: speaking of which, is there a meeting place for tuesday night? That's a no-brainer. The hotel bar! (I'm not really obsessed with beer, honest guvnor) -- Matt/ /||** Founder and CTO ** ** http://axkit.com/ ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** mod_perl news and resources: http://take23.org ** \\// //\\ // \\ -- "Computer games don't affect kids. I mean, if Pacman affected us as kids, we'd all run around in a darkened room munching pills and listening to repetitive music."
Re: how to prevent ie ( et al ) from resubmitting POST info
Aha! I knew I should have stopped taxing my brain about this one long ago! The answer is simple: when your head hurts, ask the list. Thanks very much. On Thu, Mar 29, 2001 at 10:17:24AM -0800, Jeffrey W. Baker wrote: On Thu, 29 Mar 2001 [EMAIL PROTECTED] wrote: Anyone have any tricks up their sleeve to prevent the following: IE, on opening a new browser windows, or on revisiting through history a page which submitted some post data, will re-post that data, which causes me problems, as POST triggers my music player window, with a random mix from the post parameters. Netscape does this too, but only on reload. It's tricky to have a flag disallowing reposts, because it's hard to differentiate between an accidental one and a real one. I guess I'm just wondering if anyone has thought hard about this here. You oculd put a one-time key in the form values. -- "Computer games don't affect kids. I mean, if Pacman affected us as kids, we'd all run around in a darkened room munching pills and listening to repetitive music."
perl session management
Hello there.. Could u suggest a way to update a session variable. At present it is not possible for me to update a session variable from any other page. I thought it would be automatically updated when i do a new insertion into the session variable which in my case is a hash. Is there any other way. Could anyone please help. I am using the module Apache::Session::MYSQL. Thanks in advance Dups. Get free email and a permanent address at http://www.netaddress.com/?N=1