Re: Simple Mod_Perl XML Engine
Alex Menendez wrote: 1) I do not want the XML tags to show up in the html source once they have been expanded. 2) I want the tags to be simple...Not embed perl type of processing. 3) I want the flexibility to embed sql queries, formatting elements or whatever into my xml packets that will be interpreted by my module... HTML::EP, which is based on HTML::Parser should do the job. It should be quite easy to port to XML, mainly be replacing HTML::Parser with XML::Parser internally. Bye, Jochen -- Jochen Wiedmann [EMAIL PROTECTED] Life has brown and green eyes. :-) +49 711 7168586
mod_perl and sybase support statically linked into httpd?
Hi, I am currently running Apache on a HP-UX 11 platform, using plain CGIs for dynamic page creation accessing a Sybase database. I have only quite old Sybase client libraries here, forcing me to statically link sybase support into my perl binary. Now I want to switch to mod_perl; the problem is, I have not yet managed to statically compile mod_perl AND sybase support into my httpd. Has anyone on this list already solved this problem? Are there any links on that problem? Any help would be appreciated. | | | knipp | Knipp Medien und Kommunikation GmbH --- Technologiepark Martin-Schmeisser-Weg 9 D-44227 Dortmund Thomas Corte Fon: 0231-9703-0 [EMAIL PROTECTED] Fax: 0231-9703-200
Stumped: Location ignored
Hi, I hit this months ago but never really solved it... I'm working with the WING e-mail package by Malcolm Beattie. In my httpd.conf I have tried: PerlModule Wing_miranda_herrera_iphil_net::Balance Location / SetHandler perl-script PerlHandler Wing_miranda_herrera_iphil_net::Balance /Location Perl and: $Location{"/"} = { SetHandler = "perl-script"; PerlHandler = "Wing_miranda_herrera_iphil_net::Balance"; }; /Perl Neither of these work. When I access /, the module is not invoked, and instead, Apache brings up the DocumentRoot. How can I debug why Apache would choose to ignore the Location? Just to be sure I also tried it with Directory but without luck. Apache 1.3.9, mod_perl 1.2.1. (For those working with Wing already, I changed the names of the modules since I am doing "virtual hosting" with it.) Thanks! ---m -- Miguel "Migs" A.L. Paraz IPhil Communications Network, Inc. http://www.iphil.net Business Development/Training Group 5/F 116 Herrera St., Legaspi Village, Makati City, Philippines +63-2-750-2288
Re: Another IE5 complaint
IE 4/5 hits are more than 50% of the http://translator.go.com/ site I am working on, and I make sure I serve up a favicon.ico to all of thos guys. I get lots of bookmark requests and love it. Rod Butcher wrote: Am I the only battling service vendor who actually feels good when somebody bookmarks my website ? I can absorb the overhead of accesses to a favorites icon. This may be a security hazard for the client, but I detect a holier-than-thou attitude here against M$. Will somebody tell me why this M$ initiative is bad, other than for pre-determined prejudices ? Rgds Rod Butcher Matt Sergeant wrote: On Fri, 01 Oct 1999, Joe Pearson wrote: Hi all, Maybe everyone already knows this, but I just discovered that whenever a IE5 user visits a page in their "Favorites", IE5 also trys to GET favicon.ico from the same site. Therefor I have hundreds of "File does not exist:" errors in my log file. Apparently you can BSOD a winbox with a buffer overflow in a .ico file, although I don't know where the exploit is listed on the net (distant memory). Maybe that would stop this dumb practice. :) (I _am_ just kidding). -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training. -- Rod Butcher | "... I gaze at the beauty of the world, Hyena Holdings Internet | its wonders and its miracles and out of Programming | sheer joy I laugh even as the day laughs. ("it's us or the vultures") | And then the people of the jungle say, [EMAIL PROTECTED] | 'It is but the laughter of a hyena'". |Kahlil Gibran.. The Wanderer -- Craig Shaver, Productivity Group POB 60458 Sunnyvale, CA 94088 (650)390-0654 http://www.progroup.com/ mailto:[EMAIL PROTECTED]
Re: Another IE5 complaint
LINK REL="SHORTCUT ICON" href="/path/to/favicon.ico" Is this sort of thing implimented in Netscape? Is rev and rel implemented in any fashion? -- Ruben I Safir [EMAIL PROTECTED] http://www.brooklynonline.com Manager of Intranet Development NYU College of Dentisty Resume: http://www.wynn.com/jewish/resume.html Perl Notes: http://www.wynn.com/jewish/perl_course
Re: Another IE5 complaint
On Tue, 23 Nov 1999, Ruben I Safir wrote: LINK REL="SHORTCUT ICON" href="/path/to/favicon.ico" Is this sort of thing implimented in Netscape? Is rev and rel implemented in any fashion? It's not implemented for favicon, no. But LINK REL is supported by Navigator for external CSS stylesheets, for example. That's the only use I know of, though. Steve -- business: http://hesketh.com ...custom medium- to large-scale web sites the book: http://dhtml-guis.com ...Building Dynamic HTML GUIs from IDG punditry: http://a.jaundicedeye.com ...negative forces have value personal: http://hesketh.com/schampeo/ ...info, projects, random stuff
Re: Another IE5 complaint
Rod Butcher wrote: Am I the only battling service vendor who actually feels good when somebody bookmarks my website ? I can absorb the overhead of accesses to a favorites icon. This may be a security hazard for the client, but I detect a holier-than-thou attitude here against M$. Will somebody tell me why this M$ initiative is bad, other than for pre-determined prejudices ? Rgds Rod Butcher What he said. I don't see what sucks so much about burning a few bytes of bandwith to have your site's big fat icon on the user's desktop! And it isn't like they made up an HTTP ICON request type, they are using standard methods to get the file. -jwb
Re: mod_sandwich - parsing the header and footer through SSI module
Does anyone has a modified version of the Sandwich module that passes the header and footer files through the SSI handler ? the version I've download does it only for the body of the document. The point of Apache::Sandwich is to append a preset header/footer to all HTML (or whatnot) files. If you wanted your own header footer via SSI, it defeats the purpose since you would have to include those in potentially a lot of files. If you're talking about including SSI in the actual headers/footers that are displayed by Apache::Sandwich, then remember you control what the headers/footers are. For my setup, my header is not static. It's a mod_perl script that does cookie checking, prints the date and does a few other things. So if you want yours dynamic, just make the header an actual script and not a static HTML file. You can then (the most simple form) read in any files you want, ala SSI as well as do some other fun stuff. Jim -- Jim Serio - [EMAIL PROTECTED] Producer, World of Coasters
Re: Apache::Sandwich and SSI problems
"SM" == Shay Mandel [EMAIL PROTECTED] writes: SM Hi, SM I am trying to use your Sandwich module, which is really great and SM helpful. So first of all I want to thank you for the great job you've SM done. Try making your sandwiched documents NOT be *.[s]html. You're forcing all your documents to be sandwiched, including your header files. It seems you expect your .shtml and .html files to go through the sandwich handler *and* be left along when pulled through as the actual header/footer. This cannot work.
EmbPerl, PHP continued...
Hi all, I was looking for some performance data for EmbPerl, PHP, etc. but could only find "Hello World"-type tests. So, I decided to add a few other tests to the mix and post the results. These test results are still very crude. Any feedback/analysis/criticism would be appreciated. Thanks! Rob MACHINE: Dual Pentium III 500 MHz 256 MB RAM RedHat 6.0 (Linux 2.2.5-15smp) DATABASE SERVER: Postgres 6.5.2 WEB SERVERS: Apache w/ mod_perl, EmbPerl (using Apache::DBI) - Apache/1.3.9 (Unix) mod_perl/1.21 Apache w/ mod_php (using persistent DB connection call) - Apache/1.3.9 (Unix) PHP/3.0.12 AOLServer 2.3.3 (supports persistent DB connection) - NaviServer/2.0 AOLserver/2.3.3 - threw this one in just for kicks RELEVANT APACHE SERVER SETTINGS: MinSpareServers 20 MaxSpareServers 35 StartServers 20 MaxClients 150 MaxRequestsPerChild 0 PerlSetEnv EMBPERL_OPTIONS 8082 PerlSetEnv EMBPERL_ESCMODE 0 PerlSetEnv EMBPERL_DEBUG 0 TESTS: Test 1- Static HTML Test 1(b) - Static HTML with special extension Test 2- Hello World Test 3- Big Print Test 4- Small Database Query Test 5- Big Database Query Test 1: Static HTML - This is a 6K HTML file called "test1.html". - No embedded code here. Test 1(b): Static HTML with extension - Identical to the static HTML file in every way *except* that extension is changed to ".epl", ".php3", or ".adp" according to web server. - No embedded code here. Test 2: Hello World - Simple test to print "Hello World". - For each of EmbPerl, PHP, AOLServer: [+ "Hello World" +] ? echo "Hello World" ? % ns_puts "Hello World" % Test 3: Big Print - 1000 iterations of incrementally printing "a": a aa aaa a aa ... - As an example: here's the EmbPerl code: [- for($i=0;$i 1000;++$i) { $a = $a . "a"; print OUT $a, "br"; } -] - Returned page was approximately 500 K. Test 4: Small Database Query - Fetch and display 1 record from a products database of about 300 records, searching for an exact match on an indexed field. - Returned page was approximately 5K. - Used persistent db connection in all cases. Test 5: Big Database Query - Fetch and display 24 records from a product database of about 300 records, using a "like" search on a text field. - Returned page was approximately 118K. - Used persistent db connection in all cases. RESULTS: - Results are "Requests per second". I'm not sure how to interpret the numbers on an absolute scale, but the relative comparisons should be somewhat meaningful. - Each test was conducted 5 times and the average is shown. - "ab" was used from the same machine as the web servers because something "strange" happened when I ran it on another machine. (I'll send a separate email regarding this.) 1000 requests, 1 concurrent ab -n 1000 -c 1 URL -- Test1 Test1(b) Test2 Test3Test4Test5 --- Apache w/ modperl/ 852.86 99.53217.2516.9678.1218.32 EmbPerl Apache w/ 836.47100.06560.7816.1598.7618.80 PHP AOLServer 100.01 99.72100.0612.89 156.3014.29 1000 requests, 10 concurrent ab -n 1000 -c 10 URL -- Test1 Test1(b) Test2 Test3Test4 Test5 Apache w/ modperl/ 890.37248.00262.4730.31158.5045.17 EmbPerl Apache w/ 957.30492.55559.7123.81268.3434.64 PHP AOLServer 758.54227.76816.65 5.97141.19 7.45
RE: Re: Re: Web Crawler
I can't answer that, since I wasn't working on this project when it started some time ago. But it must have been version beta-beta-beta-beta :)) But there are lot of open source crawlers avaiable. The Google isn't open source anymore. Take a look at http://www.searchtools.com/tools/tools.html Cheers ./Ricardo Oliveira --Original Message-- From: "Miguel A.L. Paraz" [EMAIL PROTECTED] To: ricarDo oliveiRa[EMAIL PROTECTED] Sent: November 23, 1999 1:31:45 PM GMT Subject: Re: Re: Web Crawler On Tue, Nov 23, 1999 at 07:00:27AM -0500, ricarDo oliveiRa wrote: - I'm not writing a web crawler from scratch. the initial source code was based on Google's, adapted to serve the specific needs of this web site where did you get source code of Google!? cheers, ---m -- Miguel "Migs" A.L. Paraz IPhil Communications Network, Inc. http://www.iphil.net Business Development/Training Group 5/F 116 Herrera St., Legaspi Village, Makati City, Philippines +63-2-750-2288 __ FREE Email for ALL! Sign up at http://www.mail.com
Re: ab weirdness...
Strange indeed. This is a 10M LAN. The reason I was suspecting something wrong with my Apache configuration was because AOLServer (running on the test server) was reporting about 25 requests per second for the same file, which should definitely not be the case. Thanks! Rob Rasmus Lerdorf writes: When I use "ab" from another Linux box to fetch a static HTML page (about 6K in size) on a test server on the same network, "ab" reports: 3 requests per second versus about: 900 requests per second when "ab" is run directly on the test server. Strange. I don't see that here. I actually get better results when I run ab from another machine across a quiet 100M LAN. You must have something really funky going on. Massive collisions? Bad cable? Duplex problem? -Rasmus
[JOB] mod_perl programmer wanted in Boston
Public Interactive has immediate openings for Perl programmers. We're a fast-moving, award-winning on-line provider of Web content for the public broadcasting community located in downtown Boston (steps from South Station). We're fun, we're casual, and we love open source tools. Requirements: Thorough knowledge of Perl 5, HTML and web site design. B.S. in computer science and/or 2+ years development experience using Perl, CGI, and Apache/mod_perl in a UNIX environment. Experience using an SQL backend via DBI, especially mySQL or Oracle. Experience in UI design. Contact: Send resume and cover letter to: Diana Sands [EMAIL PROTECTED] 617-423-4499 x132 http://publicinteractive.com/
Re: Apache::Sandwich and SSI problems
"SM" == Shay Mandel [EMAIL PROTECTED] writes: SM Hi, SM Thank you very much for your response. SM I've changed my configs, so that the sandwich will work only on .html file, SM and set them not to be SSI parse by default. SM Still, the header file, which has .shtml extension is not parsed. When you go to http://your.server.com/.includes/header.shtml does it display what you expect? I suspect not, otherwise it would work with your current setup.
PerlAccess handler overriding mod_include
I know this is a simple problem, but I can't find the solution in the Eagle books or in the mailing lists, etc. Anyway. I have a custom blocking module to block large quantities of URLs Files *.cgi Options +execcgi /Files Files *.shtml AddHandler server-parsed .shtml SetHandler server-parsed AddType text/html .shtml Options +Includes #makes my module return DECLINED everywhere: PerlSetVar Block off /Files Location / SetHandler perl-script PerlAccessHandler Apache::Block PerlSetVar Block_Config /home/httpd/config.file PerlSetVar Block_Direction allow PerlSetVar Block_OnNoRef allow PerlSetVar Block_MIMEType text/html ErrorDocument 403 http://www.littlebreast.com/halt.html /Location Perl push @INC, ["/home/httpd/config.file"]; /Perl Location /cgi-bin/ SetHandler cgi-script PerlSetVar Block off /Location -- We want the PerlAccessHandler to be the blocking software, but the content handler to be mod_include. Currently I'm looking into Apache::SSI as we speak, but I'd rather just have a quick C solution than the morethanlikely slower apache::ssi module (this is a heavily loaded site). I've included the SetHandler for the cgi scripts above because we had a similar problem with those, and by using sethandler we were able to get them probably executed. I am aware that this is a scoping problem with SetHandler of some sort. Is there anything I can do to run mod_include as the content handler and use the Apache::Block module (my custom one) as the access handler without the two interfering like this? Thanks greatly in advance, Rob
directoryindex is not retrieved
Hi! I have problem with index files for directories not being read under mod_perl. According to mod_perl guide this happened for those who "declared mod_perl configuration inside a Directory section for all files matching to *.pl. The problem has gone away after placing the usage of mod_perl in a File- section." This is not true for me. My configuration is Directory /doc/root PerlAuthenHandlerApache::MyAuth::authen_handler . /Directory Everything works fine except for retrieving index files for directories. Requests for http://my.site.com/any/dir/ end up with message "you don't have permission to access /any/dir/ on this server" and line in error log "Directory index forbidden by rule: /proj/Web/94dec/any/dir/" I'm running Apache 1.3.9, mod_perl 1.21 staticaly linked on Linux box. And unfortunately I can't rewrite my configuration to use Files ... And there is DirectoryIndex directive in my configuration files. And my authentication/authorization handler doesn't care about the URL being requested, only the require field values. Anyone has looked into that really? Andrei --
Stacked Handlers and passing Objects
Hello Everyone, I have been lurking for a while, but this is my first post. I started programming perl about a year ago and have no other programming experience, so please forgive me if this is way out of scope. And yes, I have searched the archives and I have the apache modules book, but I did not find a clear answer to this question. My website that I am developing (web.carracing.com) uses 4 stacked handlers for each section of the site. The only one that changes is the 3rd handler for the content of the page. here is one of the configs: Location /Racing_Links SetHandler perl-script PerlHandler Apache_Car::Authen Apache_Car::Start_Page Apache_Car::Racing_Links Apache_Car::End_Page Options ExecCGI /Location The site is completely dynamic with not one page of html besides some templates I parse myself. The module Apache_Car::Authen is what I use to determine access and layout of every page requested. When a user logs in, Apache_Car::Authen then gets his/her personal data from a MySQL Database which is then used to layout the site to their personal prefs. Currently, I can use $r-notes and that works fine, but what I would like to do is use an module I have written and then just pass the object to the later stacked handlers so that the later handlers can grab necessary data from the objects methods. I gues the reason I want to do this is because when the member is authenticated, It would be easier and quicker to get the data from the DB and leave it in the object hash for the later modules. Again, please let me know if I am way off base with this thinking and a pointer to some examples of a better way would be much appreciated. Thanks, Bill -- === Bill Desjardinshttp://www.carracing.com [EMAIL PROTECTED]Tel: 305.205.8644 FREE Homepages for Racers and Race Tracks!!
Re: Another IE5 complaint
Jeff Stuart wrote: Jeffrey Baker wrote: What he said. I don't see what sucks so much about burning a few bytes of bandwith to have your site's big fat icon on the user's desktop! And it isn't like they made up an HTTP ICON request type, they are using standard methods to get the file. -jwb Well, let's see. Say the icon is 2K in size. Then, let's say you get 1Mil in hits a day. 50% of those are IE5. Ok, that's 500K hits from IE5 asking for that 2K file. So that's 1Mb of data a day JUST for that damn icon. Over a month is 30 Mb of bandwidth JUST for that damn icon. Bandwidth is not cheap folks! Someone has to pay for bandwidth. And some plans only allow for 30 Mb a month. I was unable to glean a persuasive argument from your message, despite your liberal use of capital letters and explitives. You have several things wrong. The icon files are 16x16x8 bits, and the format requires 1KB. The icon is not requested on each request, only when a user bookmarks your site using IE 5. Clearly this number will be a tiny fraction of all requests a site serves. With caching effects, you can expect to transmit even fewer bites to the large ISPs. Last, nobody is forcing you to transmit the icon. You can simply redirect it using mod_rewrite or intercept it with a mod_perl log handler and discard the log entry. Remember folks, bandwidth costs money! Someone has to pay for it. Maybe not you but someone does. EVEN THE FREE HOSTS! This is not the point. If you have GIFs on your page, you are paying to transmit those, too. If you don't want to transmit the icon, don't provide the icon! There are technological means to handle this on the server side and it takes less time than complaining about it in public. I think the prevailing philosophy on this subject is dead wrong. On the web, any and all requests can and will come in. You cannot trust the client! If you rely on the web, you must be prepared to gracefully handle all situations that might arise. This might include a broken client making bad requests to your server in a tight loop (Mozilla M8), or it might include a client occasionally requesting a file that doesn't exist (IE 5). Think about this: what if your site gets linked on Slashdot, and they spell the link incorrectly. Are you going to complain about all the 404 errors in your log, or are you going to use a simple RewriteRule to give people the information they are seeking? -jwb
Re: Another IE5 complaint
Are you going to complain about all the 404 errors in your log, or are you going to use a simple RewriteRule to give people the information they are seeking? Well, in the Microsoft case, I'd probably dynamically rewrite the link to file:///dev/mouse or file:///dev/zero, if that made any sense to those denizens. But that's just me. :-) --tom
RE: Stacked Handlers and passing Objects
I think what you are looking for is available in the pnotes() method it isn't documented in the book, but a recent version of mod_perl and perldoc Apache should be able to help you, now that you know what to look for... --Geoff -Original Message- From: Bill Desjardins [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, November 23, 1999 1:06 PM To: [EMAIL PROTECTED] Subject: Stacked Handlers and passing Objects Hello Everyone, I have been lurking for a while, but this is my first post. I started programming perl about a year ago and have no other programming experience, so please forgive me if this is way out of scope. And yes, I have searched the archives and I have the apache modules book, but I did not find a clear answer to this question. My website that I am developing (web.carracing.com) uses 4 stacked handlers for each section of the site. The only one that changes is the 3rd handler for the content of the page. here is one of the configs: Location /Racing_Links SetHandler perl-script PerlHandler Apache_Car::Authen Apache_Car::Start_Page Apache_Car::Racing_Links Apache_Car::End_Page Options ExecCGI /Location The site is completely dynamic with not one page of html besides some templates I parse myself. The module Apache_Car::Authen is what I use to determine access and layout of every page requested. When a user logs in, Apache_Car::Authen then gets his/her personal data from a MySQL Database which is then used to layout the site to their personal prefs. Currently, I can use $r-notes and that works fine, but what I would like to do is use an module I have written and then just pass the object to the later stacked handlers so that the later handlers can grab necessary data from the objects methods. I gues the reason I want to do this is because when the member is authenticated, It would be easier and quicker to get the data from the DB and leave it in the object hash for the later modules. Again, please let me know if I am way off base with this thinking and a pointer to some examples of a better way would be much appreciated. Thanks, Bill -- === Bill Desjardinshttp://www.carracing.com [EMAIL PROTECTED]Tel: 305.205.8644 FREE Homepages for Racers and Race Tracks!!
embperl pages and braindead sucking robots
I have for the first time encountered the problem that some braindead web robot (ExtractorPro) attempted to download all of the site and appended some random URL segment at the end of an embedded perl page. I use suffix .phtml for these pages, and the url looked like http://mysite//page.phtml/randomotherurl. The innocent embperl page delivered some contents with relative urls and the robot continued to fetch the same page with various URL suffixes, causing a loop and doing the equivalent of an Apache bench remotely. What is the best way to stop these kinds of mishaps? And what the heck is this ExtractorPro thing? -- Jens-Uwe Mager HELIOS Software GmbH Steinriede 3 30827 Garbsen Germany Phone: +49 5131 709320 FAX:+49 5131 709325 Internet: [EMAIL PROTECTED]
Re: Apache::Sandwich and SSI problems
"Shay" == Shay Mandel [EMAIL PROTECTED] writes: Shay # Shay # To use server-parsed HTML files Shay # Shay AddType text/html .shtml AddHandler server-parsed .shtml Shay AddHandler server-parsed .html Shay Files ~ "\.s{0,1}html$" Shay SetHandler perl-script Shay PerlHandler Apache::Sandwich Shay # use these documents as header and footer Shay PerlSetVar HEADER /.includes/header2.shtml PerlSetVar Shay FOOTER /.includes/footer.shtml Shay # parse ssi after sandwiching the page Shay PerlSetVar SandwichHandler server-parsed Shay # Options Includes # shayman - it doesn't seem to work Shay /Files Try using a different file suffix for the files to be handled by Apache::Sandwich. Something like this works for me: FilesMatch "\.brc$" SetHandler perl-script PerlHandler Apache::Sandwich /FilesMatch Then for various directories, I have the following: Location /Unix PerlSetVar HEADER /includes/brc/unix_header.shtml PerlSetVar FOOTER /includes/brc/general_trailer.shtml /Location Note the 'shtml' suffix is handled as: AddType text/x-server-parsed-html .shtml FilesMatch ".*\.shtml$" SetHandler perl-script PerlSendHeader Off Options ExecCGI PerlHandler Apache::SSI /FilesMatch Everything in HEADER and FOOTER is parsed as expected. I'm opting to use the Apache::SSI module as opposed to the mod_ssi, but it should not make a difference. HTHYO. Peace.
Re: Another IE5 complaint
That would only work for unix? Or will that mess with windows as well? Tom Christiansen wrote: Are you going to complain about all the 404 errors in your log, or are you going to use a simple RewriteRule to give people the information they are seeking? Well, in the Microsoft case, I'd probably dynamically rewrite the link to file:///dev/mouse or file:///dev/zero, if that made any sense to those denizens. But that's just me. :-) --tom -- Ruben I Safir [EMAIL PROTECTED] http://www.brooklynonline.com Manager of Intranet Development NYU College of Dentistry Resume: http://www.wynn.com/jewish/resume.html Perl Notes: http://www.wynn.com/jewish/perl_course
RE: Stacked Handlers and passing Objects
I think what you are looking for is available in the pnotes() method it isn't documented in the book, but a recent version of mod_perl and perldoc Apache should be able to help you, now that you know what to look for... http://perl.apache.org/guide/porting.html#Passing_and_preserving_custom_da http://perl.apache.org/guide/snippets.html#Passing_environment_variables_be --Geoff -Original Message- From: Bill Desjardins [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, November 23, 1999 1:06 PM To: [EMAIL PROTECTED] Subject:Stacked Handlers and passing Objects Hello Everyone, I have been lurking for a while, but this is my first post. I started programming perl about a year ago and have no other programming experience, so please forgive me if this is way out of scope. And yes, I have searched the archives and I have the apache modules book, but I did not find a clear answer to this question. My website that I am developing (web.carracing.com) uses 4 stacked handlers for each section of the site. The only one that changes is the 3rd handler for the content of the page. here is one of the configs: Location /Racing_Links SetHandler perl-script PerlHandler Apache_Car::Authen Apache_Car::Start_Page Apache_Car::Racing_Links Apache_Car::End_Page Options ExecCGI /Location The site is completely dynamic with not one page of html besides some templates I parse myself. The module Apache_Car::Authen is what I use to determine access and layout of every page requested. When a user logs in, Apache_Car::Authen then gets his/her personal data from a MySQL Database which is then used to layout the site to their personal prefs. Currently, I can use $r-notes and that works fine, but what I would like to do is use an module I have written and then just pass the object to the later stacked handlers so that the later handlers can grab necessary data from the objects methods. I gues the reason I want to do this is because when the member is authenticated, It would be easier and quicker to get the data from the DB and leave it in the object hash for the later modules. Again, please let me know if I am way off base with this thinking and a pointer to some examples of a better way would be much appreciated. Thanks, Bill -- === Bill Desjardinshttp://www.carracing.com [EMAIL PROTECTED]Tel: 305.205.8644 FREE Homepages for Racers and Race Tracks!! ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
RE: Stacked Handlers and passing Objects
and, of course, it is well documented in the guide (sorry Stas :) -Original Message- From: Stas Bekman [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, November 23, 1999 2:35 PM To: Young, Geoffrey S. Cc: 'Bill Desjardins'; [EMAIL PROTECTED] Subject: RE: Stacked Handlers and passing Objects I think what you are looking for is available in the pnotes() method it isn't documented in the book, but a recent version of mod_perl and perldoc Apache should be able to help you, now that you know what to look for... http://perl.apache.org/guide/porting.html#Passing_and_preserving_custom_da http://perl.apache.org/guide/snippets.html#Passing_environment_variables_b e --Geoff -Original Message- From: Bill Desjardins [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, November 23, 1999 1:06 PM To: [EMAIL PROTECTED] Subject: Stacked Handlers and passing Objects Hello Everyone, I have been lurking for a while, but this is my first post. I started programming perl about a year ago and have no other programming experience, so please forgive me if this is way out of scope. And yes, I have searched the archives and I have the apache modules book, but I did not find a clear answer to this question. My website that I am developing (web.carracing.com) uses 4 stacked handlers for each section of the site. The only one that changes is the 3rd handler for the content of the page. here is one of the configs: Location /Racing_Links SetHandler perl-script PerlHandler Apache_Car::Authen Apache_Car::Start_Page Apache_Car::Racing_Links Apache_Car::End_Page Options ExecCGI /Location The site is completely dynamic with not one page of html besides some templates I parse myself. The module Apache_Car::Authen is what I use to determine access and layout of every page requested. When a user logs in, Apache_Car::Authen then gets his/her personal data from a MySQL Database which is then used to layout the site to their personal prefs. Currently, I can use $r-notes and that works fine, but what I would like to do is use an module I have written and then just pass the object to the later stacked handlers so that the later handlers can grab necessary data from the objects methods. I gues the reason I want to do this is because when the member is authenticated, It would be easier and quicker to get the data from the DB and leave it in the object hash for the later modules. Again, please let me know if I am way off base with this thinking and a pointer to some examples of a better way would be much appreciated. Thanks, Bill -- === Bill Desjardinshttp://www.carracing.com [EMAIL PROTECTED]Tel: 305.205.8644 FREE Homepages for Racers and Race Tracks!! ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: Another IE5 complaint
On Tue, 23 Nov 1999, Jeffrey W. Baker wrote: Rod Butcher wrote: Am I the only battling service vendor who actually feels good when somebody bookmarks my website ? I can absorb the overhead of accesses to a favorites icon. This may be a security hazard for the client, but I detect a holier-than-thou attitude here against M$. Will somebody tell me why this M$ initiative is bad, other than for pre-determined prejudices ? Rgds Rod Butcher What he said. I don't see what sucks so much about burning a few bytes of bandwith to have your site's big fat icon on the user's desktop! And it isn't like they made up an HTTP ICON request type, they are using standard methods to get the file. What sucks is it's MS lock-in. To create a .ico file you have to have a Windows machine. So webmasters now have to have windows machines to work with this concept. Had it been .png I would have felt differently. -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
Upgrading to 1.21-2
I just upgraded to Perl 5.005_03 from 5.004_something. (I run Red Hat Apollo (5.2) on my box). I had to install GLIBC_2.1 and uninstall mod_perl-1.19-1. That done, Perl installed with only one hitch, the following error: /etc/localtime created as /etc/localtime.rpmnew Then I tried to install mod-perl-1.21-2.i386.rpm. It didn't take, but instead kicked back a "failed dependency error, Perl 5.005_03 needed" or something to that affect. perl -v from the command prompt returned 5.005_03 as the current version. Any suggestions as to why I can't load the mod_perl-1.21-2... rpm and why I have the correct version of Perl but it isn't being detected? Thanks, Glen
RE: Upgrading to 1.21-2
Did you install perl from source? If you did then RPM is unaware of perl 5.005x being on the box. As said several times before on the list.. You may want to build perl, apache, and mod_perl from source. Odds are, everything will work without a hitch. Ian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Glen Lee Edwards Sent: Tuesday, November 23, 1999 12:20 PM To: [EMAIL PROTECTED] Subject: Upgrading to 1.21-2 I just upgraded to Perl 5.005_03 from 5.004_something. (I run Red Hat Apollo (5.2) on my box). I had to install GLIBC_2.1 and uninstall mod_perl-1.19-1. That done, Perl installed with only one hitch, the following error: /etc/localtime created as /etc/localtime.rpmnew Then I tried to install mod-perl-1.21-2.i386.rpm. It didn't take, but instead kicked back a "failed dependency error, Perl 5.005_03 needed" or something to that affect. perl -v from the command prompt returned 5.005_03 as the current version. Any suggestions as to why I can't load the mod_perl-1.21-2... rpm and why I have the correct version of Perl but it isn't being detected? Thanks, Glen
Re: Flaky software
On Fri, 19 Nov 1999, Jeffrey Baker wrote: if (defined @foo_in) { # On Fri, 19 Nov 1999, Randal L. Schwartz wrote: # # defined @bar and defined %bletch are almost never correct, and any # seasoned Perl hacker knows to watch for those as a red flag. On Mon, 22 Nov 1999, Jeffrey Baker wrote: Regarding your question of Nov 3 [regarding `make test' failure], I don't see any cause for alarm. Are you seeing problems on actual code, or only [sic] in the test harness? All of my production mod_perl systems are fine, even though I've never bothered to look into why make test was failing. Are you planning to use Apache::src in your system? = In 1998, Lincoln Stein and Doug MacEachern wrote: = = ``Any messages about failed tests, however, are cause for concern. =If you see such a message, you should rerun the tests with the =verbose flag (make test TEST_VERBOSE=1). You can try to track =down the problem yourself, or post the results to the mod_perl =mailing list...'' = -- the Eagle Book Dear Mr. Baker, If you have "never bothered" to find out why `make test' is failing then obviously you don't have any "production mod_perl systems". In the light of the comments from Mr. Schwartz, it looks like you have only development systems that haven't gone wrong yet, and that a lot of other people might be in the same boat, thanks to you. This has cost me nearly four weeks already, and I dread to think how many other people have wasted their time because you never bothered. For me, your slapdash approach has polluted the mod_perl resource to the extent that now I don't trust any of it. The entire exercise is written off to experience and I am looking for alternatives. Earlier in November, Stas Bekman put out a message saying something like: "Come on, guys, let's get some of this stuff to work". Surely no-one can be content with the state things are in at present? Kind regards, Ged Haywood.
HTTP_NOT_MODIFIED
Hello, I'm asking this question again in a simpler form this time. Can Apache::exit() be used in an Apache::Registry script? (My script is run mod_perl and mod_cgi so I'm trying not to make it contain too much mod_perl-specific code.) I'm trying to send a 304 error, but also log a 304 error in the access_log by calling Apache::exit( HTTP_NOT_MODIFIED ). But this results in headers not being properly sent. Here's a test script: #!/usr/local/bin/perl5.005 -wT use Apache; # for Apache::exit() use Apache::Constants qw/OK HTTP_NOT_MODIFIED/; use CGI; print CGI::header(-status = '304 Same old document'), CGI::start_html(), 'Hello', CGI::end_html(); Apache::exit( HTTP_NOT_MODIFIED ); Calling exit( OK ) works fine, except a 200 is written to the access_log file. Calling exit( HTTP_NOT_MODIFIED ) writes a 304 to the access_log file, but returns headers: HTTP/1.1 304 (Not Modified) Same old document Connection: close Date: Tue, 23 Nov 1999 21:12:44 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 Content-Type: text/html Client-Date: Tue, 23 Nov 1999 21:12:39 GMT Client-Peer: 169.229.32.30:49322 Title: Untitled Document !DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN" HTMLHEADTITLEUntitled Document/TITLE /HEADBODYHello/BODY/HTMLHTTP/1.1 304 Same old document Date: Tue, 23 Nov 1999 21:12:44 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 Connection: close X-Pad: avoid browser bug My httpd.conf: Files test Options +ExecCGI SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader on /Files Bill Moseley mailto:[EMAIL PROTECTED]
Re: Flaky software
On Tue, 23 Nov 1999, G.W. Haywood wrote: Dear Mr. Baker, If you have "never bothered" to find out why `make test' is failing then obviously you don't have any "production mod_perl systems". In the light of the comments from Mr. Schwartz, it looks like you have only development systems that haven't gone wrong yet, and that a lot of other people might be in the same boat, thanks to you. I find this a rather harsh attitude towards someone on a free list trying to help people. However I'm more bothered with the second half of your message: This has cost me nearly four weeks already, and I dread to think how many other people have wasted their time because you never bothered. For me, your slapdash approach has polluted the mod_perl resource to the extent that now I don't trust any of it. The entire exercise is written off to experience and I am looking for alternatives. Earlier in November, Stas Bekman put out a message saying something like: "Come on, guys, let's get some of this stuff to work". Surely no-one can be content with the state things are in at present? We're software developers. We're never content with the present state of things. However there's currently only my company providing commercial support for mod_perl, and we haven't been able to put anything back into the project yet due to other work (which will hopefully change in the coming months). If you require commercial support for installation and application development we'd be more than willing to help out (subject to contract), and of course we'll feed back any changes into the mod_perl tree. But I don't think you can really expect anything more from this free list and the very helpful and knowledgable people on it. -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
Re: Flaky software
Give me a break, G.W. You think nobody is happy with mod_perl? You think it's okay to take the mis-speakings of a good Perl contributor (JB) out of context and try to use them as some kind of evidence (for what?)? That's mean-spirited and inaccurate, and I don't feel like hearing it. "[sic]"? God. Stop. If this is how you evaluate tools, then please consider your evaluation complete and move on to some other tool and some other conversation. We'll keep on using the best stuff. [EMAIL PROTECTED] (G.W. Haywood) wrote: On Fri, 19 Nov 1999, Jeffrey Baker wrote: if (defined @foo_in) { # On Fri, 19 Nov 1999, Randal L. Schwartz wrote: # # defined @bar and defined %bletch are almost never correct, and any # seasoned Perl hacker knows to watch for those as a red flag. On Mon, 22 Nov 1999, Jeffrey Baker wrote: Regarding your question of Nov 3 [regarding `make test' failure], I don't see any cause for alarm. Are you seeing problems on actual code, or only [sic] in the test harness? All of my production mod_perl systems are fine, even though I've never bothered to look into why make test was failing. Are you planning to use Apache::src in your system? = In 1998, Lincoln Stein and Doug MacEachern wrote: = = ``Any messages about failed tests, however, are cause for concern. =If you see such a message, you should rerun the tests with the =verbose flag (make test TEST_VERBOSE=1). You can try to track =down the problem yourself, or post the results to the mod_perl =mailing list...'' = -- the Eagle Book Dear Mr. Baker, If you have "never bothered" to find out why `make test' is failing then obviously you don't have any "production mod_perl systems". In the light of the comments from Mr. Schwartz, it looks like you have only development systems that haven't gone wrong yet, and that a lot of other people might be in the same boat, thanks to you. This has cost me nearly four weeks already, and I dread to think how many other people have wasted their time because you never bothered. For me, your slapdash approach has polluted the mod_perl resource to the extent that now I don't trust any of it. The entire exercise is written off to experience and I am looking for alternatives. Earlier in November, Stas Bekman put out a message saying something like: "Come on, guys, let's get some of this stuff to work". Surely no-one can be content with the state things are in at present? Kind regards, Ged Haywood. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Modperl/ProxyPass ModSSl
Hello all, I am using a two server setup with a lightweight modproxy front end doing a proxypass to a backend modperl app server. So now I want to utilize modssl and enable an encrypted version, while still retaining a non-encrypted version. In this situation, where do I set up modssl? 1) on the modproxy/proxypass frontend? 2) on the secondary modperl server? 3) on both? I suppose it would be really nice if all I had to do is enable modssl on the proxypass front end. Any help would be appreciated. Thanks! Joe Junkin [EMAIL PROTECTED]
RE: embperl pages and braindead sucking robots
Jens-Uwe Mager wrote: I have for the first time encountered the problem that some braindead web robot (ExtractorPro) attempted to download all of the site and appended some random URL segment at the end of an embedded perl page. I use suffix .phtml for these pages, and the url looked like http://mysite//page.phtml/randomotherurl. The innocent embperl page delivered some contents with relative urls and the robot continued to fetch the same page with various URL suffixes, causing a loop and doing the equivalent of an Apache bench remotely. What is the best way to stop these kinds of mishaps? And what the heck is this ExtractorPro thing? What is the best way to stop these kinds of mishaps? And what the heck is this ExtractorPro thing? It's spamware designed (or ill-designed, as the case may be) for scraping e-mail addresses from web pages to be added to some future "100 ZILLION EMAIL ADDRESSES FOR $99!!!" list. You will want to block it and its ilk from your site if at all possible. (Though it sounds like it's doing an ok job of blocking itself... :-) Regards, Charlie -- |o|/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\|o| |o| Charlie Wilkinson |o| |o| TRIS Development SysAdmin |o| |o| [EMAIL PROTECTED] (w) |o| |o| [EMAIL PROTECTED] (h) |o| |o|/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\|o|
Re: Flaky software
I'm brand new to the list, so I thought I'd better ask a question before making another post: What is the specific purpose/slant of this list? Is it a developer's list? A general list to help those running Mod Perl? Are only programming geniuses allowed to post, or can the average joe ask dumb questions? I've never run Mod Perl in a real life setting but like the concept. I own several domains on commercial servers that I plan to eventually move to my own server, so am trying to get acquainted the the best way to set it up and administer it. If this isn't a list for those just learning Mod Perl, please point me in the right direction. Thanks, Glen On Tue, 23 Nov 1999, Matt Sergeant wrote: On Tue, 23 Nov 1999, G.W. Haywood wrote: Dear Mr. Baker, If you have "never bothered" to find out why `make test' is failing then obviously you don't have any "production mod_perl systems". In the light of the comments from Mr. Schwartz, it looks like you have only development systems that haven't gone wrong yet, and that a lot of other people might be in the same boat, thanks to you. I find this a rather harsh attitude towards someone on a free list trying to help people. However I'm more bothered with the second half of your message: This has cost me nearly four weeks already, and I dread to think how many other people have wasted their time because you never bothered. For me, your slapdash approach has polluted the mod_perl resource to the extent that now I don't trust any of it. The entire exercise is written off to experience and I am looking for alternatives. Earlier in November, Stas Bekman put out a message saying something like: "Come on, guys, let's get some of this stuff to work". Surely no-one can be content with the state things are in at present? We're software developers. We're never content with the present state of things. However there's currently only my company providing commercial support for mod_perl, and we haven't been able to put anything back into the project yet due to other work (which will hopefully change in the coming months). If you require commercial support for installation and application development we'd be more than willing to help out (subject to contract), and of course we'll feed back any changes into the mod_perl tree. But I don't think you can really expect anything more from this free list and the very helpful and knowledgable people on it.
Re: HTTP_NOT_MODIFIED
Hello, I'm asking this question again in a simpler form this time. Can Apache::exit() be used in an Apache::Registry script? (My script is run mod_perl and mod_cgi so I'm trying not to make it contain too much mod_perl-specific code.) http://perl.apache.org/guide/porting.html#Terminating_requests_and_process I'm trying to send a 304 error, but also log a 304 error in the access_log by calling Apache::exit( HTTP_NOT_MODIFIED ). But this results in headers not being properly sent. Here's a test script: #!/usr/local/bin/perl5.005 -wT use Apache; # for Apache::exit() use Apache::Constants qw/OK HTTP_NOT_MODIFIED/; use CGI; print CGI::header(-status = '304 Same old document'), CGI::start_html(), 'Hello', CGI::end_html(); Apache::exit( HTTP_NOT_MODIFIED ); Calling exit( OK ) works fine, except a 200 is written to the access_log file. Calling exit( HTTP_NOT_MODIFIED ) writes a 304 to the access_log file, but returns headers: HTTP/1.1 304 (Not Modified) Same old document Connection: close Date: Tue, 23 Nov 1999 21:12:44 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 Content-Type: text/html Client-Date: Tue, 23 Nov 1999 21:12:39 GMT Client-Peer: 169.229.32.30:49322 Title: Untitled Document !DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN" HTMLHEADTITLEUntitled Document/TITLE /HEADBODYHello/BODY/HTMLHTTP/1.1 304 Same old document Date: Tue, 23 Nov 1999 21:12:44 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 Connection: close X-Pad: avoid browser bug My httpd.conf: Files test Options +ExecCGI SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader on /Files Bill Moseley mailto:[EMAIL PROTECTED] ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Re: Flaky software
"GLE" == Glen Lee Edwards [EMAIL PROTECTED] writes: GLE What is the specific purpose/slant of this list? Is it a developer's GLE list? A general list to help those running Mod Perl? Are only GLE programming geniuses allowed to post, or can the average joe ask dumb GLE questions? Anyone can and should post, provided they do their homework first. There are plenty of resources at http://perl.apache.org to start with. If you are still stuck, just explain to the list in _detail_ what you tried, what happened or did not happen compared to what you expected or wanted to happen. Most likely you'll get helpful responses. The key is to show that you've tried to solve the problem using the plethora of documentation first. This is genarally true of all mailing lists, I believe.
Where to start with mod_perl (was Re: Flaky software)
Glen Lee Edwards wrote: I'm brand new to the list, so I thought I'd better ask a question before making another post: What is the specific purpose/slant of this list? Is it a developer's list? A general list to help those running Mod Perl? Are only programming geniuses allowed to post, or can the average joe ask dumb questions? I've never run Mod Perl in a real life setting but like the concept. I own several domains on commercial servers that I plan to eventually move to my own server, so am trying to get acquainted the the best way to set it up and administer it. If this isn't a list for those just learning Mod Perl, please point me in the right direction. No this is just the place for beginners. First you should apply a minimum of effort by reading the guide at http://perl.apache.org/guide. Perhaps you might also want to buy the book at http://www.modperl.com/. After that you probably won't have any basic questions left :) But if you do, feel free to ask them here. -jwb -- Jeffrey W. Baker * [EMAIL PROTECTED] Critical Path, Inc. * we handle the world's email * www.cp.net 415.808.8807
Re: HTTP_NOT_MODIFIED
At 12:30 AM 11/24/99 +0200, Stas Bekman wrote: http://perl.apache.org/guide/porting.html#Terminating_requests_and_process Thanks for the reply, Stas. I did read that section of the Guide, but I didn't see what I'm doing wrong to cause the headers to be sent incorrectly, like the example below. Are you saying that I can't call Apache::exit( HTTP_NOT_MODIFIED ) in an Apache::Registry script? HTTP/1.1 304 (Not Modified) Same old document Connection: close Date: Tue, 23 Nov 1999 21:12:44 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 Content-Type: text/html Client-Date: Tue, 23 Nov 1999 21:12:39 GMT Client-Peer: 169.229.32.30:49322 Title: Untitled Document !DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN" HTMLHEADTITLEUntitled Document/TITLE /HEADBODYHello/BODY/HTMLHTTP/1.1 304 Same old document Date: Tue, 23 Nov 1999 21:12:44 GMT Server: Apache/1.3.9 (Unix) mod_perl/1.21 Connection: close X-Pad: avoid browser bug Bill Moseley mailto:[EMAIL PROTECTED]
Re: Another IE5 complaint
At 20:08 23/11/1999 +, Matt Sergeant wrote: What sucks is it's MS lock-in. To create a .ico file you have to have a Windows machine. So webmasters now have to have windows machines to work with this concept. Had it been .png I would have felt differently. Not that I want to make this already too long thread even longer that bad, but iirc ImageMagic handles ico files. Also, it wouldn't be too hard to create a tool to create them. .Robin After all, what is your hosts' purpose in having a party? Surely not for you to enjoy yourself; if that were their sole purpose, they'd have simply sent champagne and women over to your place by taxi.
Embperl Subroutines
Hello Everyone, I am in the process of developing an Embperl/Mysql site and have a couple of questions. One thing that I am doing now is making use of Embperl [$ sub $] [$ endsub $] for defining subroutines. If I read the documentation correctly these subroutines will be 'imported' into any page that I import them into. I see no mention of reuse of these subroutines, each page seems to get it's own compiled copy in it's namespace. I am wondering if during the Execute I can set the PACKAGE that the subroutines are compiled into like: Execute( { inputfile = '/include/subs.emb', package = 'Subs', import = 1 } ); and then use [- Subs::subroutine -] in my pages. I could run this once in my startup.pl, pre-compile the subroutines and reuse them. Thoughts, Owen
Apache::Request
So I've been playing around with Apache::Request for the last day or two, trying to figure out what it's capabilities are for processing uploaded files. I was hoping to use it as the back-end of an HTTP-based API I'm creating. It looks like it requires that a "filename" parameter on the Content-Disposition MIME block header to exist in order to find the MIME block, or it will entirely skip the block. It can handle a missing "name" parameter just fine (which seems strange). Good Examples: Content-Disposition: form-data; name="test1"; filename="test1.txt" Content-Disposition: form-data; filename="test1.txt" Bad Example: Content-Disposition: form-data; name="test1" Has anyone else played around with Apache::Request in this way? -jse
Question on STDIN
In a perl apache module that I'm writing, I wanted to try to parse the content of a POST myself. According to "Writing Apache Modules with Perl and C", page 438, you should be able to read the content from STDIN using Perl's read() and getc(), and using Perl's file operations. When I use the STDIN statement, I get a single line that contains the entire POST content, rather than just the first line of the post. Can anyone think of why that would happen? Here's the snippet of my code: $line = STDIN; $r-print("$line\n"); In my response, I get the entire POST content echoed back to me, where I only expected the first line. If I comment out the "print" statement, I don't get anything echoed back (which is what I would expect). It really looks like $line contains the entire content. Any clues? -jse
RE: HTMLEmbperl 1.2.0 HTTP header
The psuedocode snippet looks something like this (the actual listing is too huge) [- if passed data perform error checking else $new_entry = 1; -] HTMLHEADTITLE/TITLE/HEAD BODY [$ if( ($new_entry) || ($f-errors()) ) $] [+ $f-display_errors_as_html(); +] blank form stuff... [$ else $] [- use Apache; use Apache::Constants qw(REDIRECT); $req_rec-header_out("Location" = 'url_to_redirect_to'); $req_rec-status(REDIRECT); -] [$ endif $] Note: The display_errors_as_html method doesn't send out any headers of it's own. But I guess it prints to stdout. You should set optRedirectStdout (in your server config), to let stdout go to the Embperl output stream. Otherwise it's send directly and arrives at the browser, before Embperl sends it's header. That's what you currently see Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: Question on STDIN
Meanwhile, back at the ranch... $line = STDIN; $r-print("$line\n"); In my response, I get the entire POST content echoed back to me, where I only expected the first line. If I comment out the "print" statement, I don't get anything echoed back (which is what I would expect). It really looks like $line contains the entire content. If there are lines in it, perhaps $/ is undef'd (haven't checked) therefore you could prolly harmlessly do something hokey like my $line; { local $/="\n"; $line = STDIN; } $r-print("$line\n"); -- Salon Internet http://www.salon.com/ HTTP mechanic, Perl diver, Mebwaster, Some of the above Ian Kallen [EMAIL PROTECTED] / AIM: iankallen / Fax: (415) 354-3326
Re: Performance problems
I have a site running Apache-1.3.6, PHP-3.0.9, mod_perl-1.20 on Solaris with a Sybase Database. And it has some performance flaws. This site has thousands of hits per day (not sure of how many, though) and it should be faster (few images, no animations whatsoever). Can anybody tell me what could be done here? EmbPerl instead of PHP? mod_perl/apache tuning? Should database access be done through PHP or mod_perl? When should I use PHP? and mod_perl? do I need both? Well, which one are you using for talking to Sybase with? Choosing one or the other would reduce your memory requirements a bit. Performance-wise they really are quite similar. Choosing one over the other is more of a personal preference thing. -Rasmus
Re: missing header files on debian
Slava [EMAIL PROTECTED] writes: I tried to install Apache::Request both way: manualy and using perl -MCPAN -e shell. It does't work on Debian. it tries to find some header files from apache. The same with libapreq-0.31 Install apache-dev Mike.
Position Available (London/UK)
while we are at it: http://guideguide.com/wanted.html christof -- Christof Damian [ we are looking for perl and linux Technical Director programmers, more information @ guideguide ltd.http://guideguide.com/wanted.html ]
RE: Another IE5 complaint
-Original Message- From: Rod Butcher [mailto:[EMAIL PROTECTED]] Sent: 23 November 1999 10:20 Cc: [EMAIL PROTECTED] Subject: Re: Another IE5 complaint Am I the only battling service vendor who actually feels good when somebody bookmarks my website ? I can absorb the overhead of accesses to a favorites icon. This may be a security hazard for the client, but I detect a holier-than-thou attitude here against M$. Will somebody tell me why this M$ initiative is bad, other than for pre-determined prejudices ? Rgds Rod Butcher Speaking as someone who works for an ISP, anything that obscures (by volume) genuine errors is a Bad Thing. The error log is a useful diagnostic tool only if you can see the errors. Yes, you could filter out the requests before examining the file, but the point is MS is making more work for people by being thoughtless. Further reasons it's a bad idea * It's not standard * It's a specific solution to a general problem, and therefore fragile (i.e. it breaks too easily) * It's a quick hack rather than a genuine initiative (which would take effort) Stephen. -- disclaimer type="std" The views expressed are personal and do not necessarily reflect those of Planet Online Limited. /disclaimer
Re: Another IE5 complaint
Most of my users are .fr people. My logs show more than 70% of them as IE users. MS is clearly in the process of enjoying one more monopolistic situation. People just don't download Netscape. What's more surprising is the enormous proportion of IE5 users over IEx users. Seems to me that if we let them do every damn thing crosses their dumb minds, we are in for long-time troubles ;( Fabrice Scemama Eric Cholet wrote: Am I the only battling service vendor who actually feels good when somebody bookmarks my website ? I can absorb the overhead of accesses to a favorites icon. This may be a security hazard for the client, but I detect a holier-than-thou attitude here against M$. Will somebody tell me why this M$ initiative is bad, other than for pre-determined prejudices ? Maybe we're getting tired of MS initiatives, such as the very rude offline site grabbing IE5 does, the crude implementation of this favicon thing, the fact that IE5 replaces error messages with its own if they aren't at least 512 bytes or something, er, the list probably goes on a bit. Sure we can deal with all that, but at our cost and sweet time. Rgds Rod Butcher -- Eric
Re: EmbPerl, PHP continued...
RESULTS: - Results are "Requests per second". I'm not sure how to interpret the numbers on an absolute scale, but the relative comparisons should be somewhat meaningful. - Each test was conducted 5 times and the average is shown. - "ab" was used from the same machine as the web servers because something "strange" happened when I ran it on another machine. (I'll send a separate email regarding this.) 1000 requests, 1 concurrent ab -n 1000 -c 1 URL -- Test1 Test1(b) Test2 Test3Test4Test5 --- Apache w/ modperl/ 852.86 99.53217.2516.9678.1218.32 EmbPerl Apache w/ 836.47100.06560.7816.1598.7618.80 PHP AOLServer 100.01 99.72100.0612.89 156.3014.29 1000 requests, 10 concurrent ab -n 1000 -c 10 URL -- Test1 Test1(b) Test2 Test3Test4 Test5 Apache w/ modperl/ 890.37248.00262.4730.31158.5045.17 EmbPerl Apache w/ 957.30492.55559.7123.81268.3434.64 PHP AOLServer 758.54227.76816.65 5.97141.19 7.45 Well, I think it shows nicely that mod_perl-EmbPerl and PHP are in the same ballpark. This has always been my impression as well. PHP tends to be quicker on short simple scripts which your results also show while PHP 3 was not very efficient at handling large loops. This is reflected in your Test 3/5 numbers there where PHP is a little bit slower. But, certainly not by a factor of 10-20 as some people like to say. And this looping deficiency has been fixed in PHP 4. PHP 4 also brings an optional interpreted script cache along with an optimizer which can help out with really complex and time-consuming scripts. By the way, PHP 4 also works as a module in aolserver now (Zeus coming soon). Would be interesting to see if PHP could beat aolserver's built-in tcl engine. One thing that might be interesting to see would be the peak memory and cpu usage for each one. That would give some indication of scaleability issues. I have no idea how PHP will fare here. ;) Some improvements were made in PHP 4 in this respect though. -Rasmus
Re: ab weirdness...
When I use "ab" from another Linux box to fetch a static HTML page (about 6K in size) on a test server on the same network, "ab" reports: 3 requests per second versus about: 900 requests per second when "ab" is run directly on the test server. Strange. I don't see that here. I actually get better results when I run ab from another machine across a quiet 100M LAN. You must have something really funky going on. Massive collisions? Bad cable? Duplex problem? -Rasmus
RE: Passing params in Embperl...
I realize that that this is probably something incredibly easy that I've just overlooked while reading the docs so I apologize ahead of time... I need to pass a value that is dynamically generated at run time to the next Embperl doc. I've tried doing the following: $fdat{'application_id'} = 'some value'; and I've also tried using the Apache::Session option of $udat{'application_id'} but when I read either of these values in the next form it's blank. Here's what happens... I have an initial page of an online application. When submit is hit it returns to itself to perform error checking, if there are no errors then the client is automatically redirected to the next page of the application form. Is setting $fdat{application_id} to a value enough to pass this along to the next form or do I need to somehow provide this in the URL prior to doing the redirect? Setting $fdat{whatever} will have no effect on the next form, only for the current page. You must insert a hidden field inside your form input type=hidden name=application_id value="[+ $foo +]" To use %udat to pass values, you have first to setup Embperl, so that it uses Apache::Session. Read the docs about Session HAndling. If you are successfull, you should see a message "Embperl sesssion handling enabled" in your Apache error log, when Embperl starts Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Apache::ASP
Sorry for the newbie question but I cannot find anyone to help me. I have everything installed and loaded but everytime I try to put the following into my httpd.conf (and access.conf): Location /asp/ SetHandler perl-script PerlHandler Apache::ASP PerlSetVar Global/tmp /Location I get this error: Invalid command 'PerlHandler', perhaps mis-spelled or defined by a module not included in the server configuration. I re-ran the installation from scratch and installed all of the latest updates from Perl to all the modules that are required and requested. What am I missing? Sorry for such a simple question on the mailing list but I don't know where all the resources arefor thisYET! Thanks! Best Regards, Aaron SlepeckyEaston Telecom Services, Inc.
RE: Flaky software
On Tue, 23 Nov 1999, Gary Carroll wrote: Maybe you should try http://www.microsoft.com i hear there is this great new thing called 'active server pages'. ive been meaning to check that out but i keep having to write mod_perl code for non-production systems. damn those paying customers.
RE: Embperl Subroutines
One thing that I am doing now is making use of Embperl [$ sub $] [$ endsub $] for defining subroutines. If I read the documentation correctly these subroutines will be 'imported' into any page that I import them into. I see no mention of reuse of these subroutines, each page seems to get it's own compiled copy in it's namespace. No, the subroutines are compiled in one package, and only the names are imported in each page from which you call Execute with the import parameter. So the subroutines get resued. It's just the same as Perl's "use". I am wondering if during the Execute I can set the PACKAGE that the subroutines are compiled into like: Execute( { inputfile = '/include/subs.emb', package = 'Subs', import = 1 } ); and then use [- Subs::subroutine -] in my pages. I could run this once in my startup.pl, pre-compile the subroutines and reuse them. You can do so. Use import = 0, to only compile your subroutines and not import the names in the namespace of your startup.pl: Execute( { inputfile = '/include/subs.emb', package = 'Subs', import = 0 } ); Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: Another IE5 complaint
Is this horse dead yet?!? I don't know, but let's kick it an' see if it squeels! Thanks, Tim Tompkins -- Programmer / IS Technician http://www.arttoday.com/ - Original Message - From: Stephen Anderson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 23, 1999 4:10 AM Subject: RE: Another IE5 complaint -Original Message- From: Rod Butcher [mailto:[EMAIL PROTECTED]] Sent: 23 November 1999 10:20 Cc: [EMAIL PROTECTED] Subject: Re: Another IE5 complaint Am I the only battling service vendor who actually feels good when somebody bookmarks my website ? I can absorb the overhead of accesses to a favorites icon. This may be a security hazard for the client, but I detect a holier-than-thou attitude here against M$. Will somebody tell me why this M$ initiative is bad, other than for pre-determined prejudices ? Rgds Rod Butcher Speaking as someone who works for an ISP, anything that obscures (by volume) genuine errors is a Bad Thing. The error log is a useful diagnostic tool only if you can see the errors. Yes, you could filter out the requests before examining the file, but the point is MS is making more work for people by being thoughtless. Further reasons it's a bad idea * It's not standard * It's a specific solution to a general problem, and therefore fragile (i.e. it breaks too easily) * It's a quick hack rather than a genuine initiative (which would take effort) Stephen. -- disclaimer type="std" The views expressed are personal and do not necessarily reflect those of Planet Online Limited. /disclaimer
Re: Question on STDIN
When I use the STDIN statement, I get a single line that contains the entire POST content, rather than just the first line of the post. Can anyone think of why that would happen? Here's the snippet of my code: $line = STDIN; $r-print("$line\n"); 1. There might not be more than one line. 2. Maybe $/ is set to undef() or an incorrect value. If you are on a DOS/Win machine, it might be searching for "\r\n" whereas "\n" might be used. In both case, the snippet spidaman posted should do the trick: my $line; { local $/="\n"; $line = STDIN; } $r-print("$line\n"); ELB -- Eric L. Brine | Chicken: The egg's way of making more eggs. [EMAIL PROTECTED] | Do you always hit the nail on the thumb? ICQ# 4629314 | An optimist thinks thorn bushes have roses.
Re: Apache::ASP
Aaron Slepecky wrote: Sorry for the newbie question but I cannot find anyone to help me. I have everything installed and loaded but everytime I try to put the following into my httpd.conf (and access.conf): Location /asp/ SetHandler perl-script PerlHandler Apache::ASP PerlSetVar Global/tmp /Location I get this error: Invalid command 'PerlHandler', perhaps mis-spelled or defined by a module not included in the server configuration. I re-ran the installation from scratch and installed all of the latest updates from Perl to all the modules that are required and requested. What am I missing? Sorry for such a simple question on the mailing list but I don't know where all the resources are for this YET! Thanks! From http://www.nodeworks.com/asp/faq.html (also FAQ section of 'perldoc Apache::ASP') Apache errors on the PerlHandler directive ? You do not have mod_perl correctly installed for Apache. The PerlHandler directive in Apache *.conf files is an extension enabled by mod_perl and will not work if mod_perl is not correctly installed. Common user errors are not doing a 'make install' for mod_perl, which installs the perl side of mod_perl, and not starting the right httpd after building it. The latter often occurs when you have an old apache server without mod_perl, and you have built a new one without copying over to its proper location. If you haven't installed mod_perl, check out http://perl.apache.org You will also want to put a space between Global /tmp :) -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051