Re: problems with DirectoryIndex under mod_perl + Template Toolkit
Tim Noll wrote: Unfortunately, I could not get Apache::ShowRequest to compile, despite tinkering with it quite a bit. But, per your suggestion, I wrote a Fixup handler to solve this problem. Good. However, in my web searches, I came across post after post that seem to describe the same problem or something similar. In no case have I seen a straightforward solution. Is there some reason why this isn't easier to handle if indeed it's such a common problem? I don't think this has anything to do with mod_perl, since it's a pure Apache configuration issue. So you should probably talk to httpd people. mod_perl simply let's you solve the problem with a custom fixup handler. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: mod_perl Developer's Cookbook
Paul == Paul Lindner [EMAIL PROTECTED] writes: Paul Now you're talking! I wonder if YAS would consider funding Paul perl-related projects like mod_perl? Perhaps if we had a big name Paul (Ticketmaster?) we could get the ball rolling on such a thing.. YAS isn't a magic bullet. YAS can certainly act as a tax-exempt pipeline, but you're really asking can the mod_perl community find it amongst themselves to fund a developer or two similar to how Damian was funded last year? Maybe. Maybe not. Until Damian and Dan and Larry get funded for this year, probably not. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
[QUESTION]PerlHandler and PerlLogHandler Phase
Hi! I am been working on modperl for some time this is the first time I am posting a question on the mailing list. Please bear with me if I miss something or give too much information. I have been working on a project that can be described as an online library. The modperl portion of it adds a header,navigation bar and a footer and display the content file of the book which I shall try to draw below. The URI is used to determine what ModPerl nav. bar to generate. These URI are always in the format /en/book/bookname/ch01p01.html. I have used the following in my configuration file Location /en/book PerlHandler MyApache::StartBook PerlLogHandler MyApache::ActivityLogger /Location Things would have been great if the ch01p01.html was just one long html file without images,stylesheets and a number of script src=. calls. The general format of these html files are as follows. script Javascript Global Variables set, the content file to open. chapterNum=01 chapterPage=01 /script trtd script scr=js/bookconfig.js script scr=js/+chapterNum+P+chapterPage+.js script scr=js/chapnav.js script scr=js/footer.js /td/tr Here is the layout -- ModPerl Gen Header(Nav. Bar for suhjects in library) --- ModPerl| Contents of the course Gen. | which contains html,stylesheets, Nav Bar| images,audio files,java class files for selected | in a directory below the html file book | [-JS Nav bar mainly images] | [!-Footer with current page number] -- ModPerl Footer (Copyrights info.) - Here are the problems/Questions that I face: 1. Since in this case each requests for a html file has multiple files that need to be downloaded by the client. Am I right to assume that the handler will act on each and every file requested file below my /en/course URI? 2.If the answer to the above question is YES? The Handler will add headers,footers for everything. What do I need to do to apply the handler logic just to the requested page and return the remaining files that are needed to complete the requested page as they are? 3. When I move these JS files outside the /en/course URI they seem to work? But now when I put them with in? It just displays the Javascript code like simple text on the browser. 4. In the Logging Phase, I need to store the last requested page as a bookmark. So if the user logs out, and logs back in it takes him to the same page. Since the html files are made up of some many requests to other files, it stores the last file it requested. It may be path to an image file,style sheet file etc... Is there any way I can circumvent this problem? Thank You very much for you help in advance. I apologize if the email is too detailed. Mark __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com
Re: [QUESTION]PerlHandler and PerlLogHandler Phase
Hi! On Fri, Feb 01, 2002 at 10:24:24AM -0800, Mod Perl wrote: Here are the problems/Questions that I face: 1. Since in this case each requests for a html file has multiple files that need to be downloaded by the client. Am I right to assume that the handler will act on each and every file requested file below my /en/course URI? Add something like return DECLINED unless $r-content_type() eq 'text/html'; near the top of your handler. This way only html-documents get handled by your handler, the rest falls through to the default apache handler. -- D_OMM + http://domm.zsi.at -+ O_xyderkes | neu: Arbeitsplatz | M_echanen | http://domm.zsi.at/d/d162.html | M_asteuei ++
RE: [QUESTION]PerlHandler and PerlLogHandler Phase
2.If the answer to the above question is YES? The Handler will add headers,footers for everything. What do I need to do to apply the handler logic just to the requested page and return the remaining files that are needed to complete the requested page as they are? In the Eagle book (as well as a Perl Journal article) there is an example of a Apache::Header/Apache::Footer. CPAN doesn't show them right now. But you could implement them as filters using Apache::Filter to mark up each document on its way out, based on URI. 3. When I move these JS files outside the /en/course URI they seem to work? But now when I put them with in? It just displays the Javascript code like simple text on the browser. SCRIPT SRC=/en/course/one.js/SCRIPT ... or you could template them in directly, since you're playing w/ the content already. 4. In the Logging Phase, I need to store the last requested page as a bookmark. So if the user logs out, and logs back in it takes him to the same page. Since the html files are made up of some many requests to other files, it stores the last file it requested. It may be path to an image file,style sheet file etc... Is there any way I can circumvent this problem? You could use a cookie, issued with each document, noting what url they are on right now?? Logging it (storing it) and then reading it back are bound to be way too much work. HTH! L8r, Rob
Re: [QUESTION]PerlHandler and PerlLogHandler Phase
Thanks Thomas, Question: Here are the problems/Questions that I face: 1. Since in this case each requests for a html file has multiple files that need to be downloaded the client. Am I right to assume that the handler will act on each and every file requested file below my /en/course URI? Answer: Add something like return DECLINED unless $r-content_type() eq 'text/html'; near the top of your handler. This way only html-documents get handled by your handler, the rest falls through to the default apache handler. This one did work for most of the cases. Which is the first war among many battles? I also have cases where the book content has pop up windows to display meaning of words that do not need the entire header to be displayed .i.e. the handler should not be act on such a request. Question: Is there a way I can put them in a directory and when the uri matches that directory, i disable the handler? If so how can I do it? Mark __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com
Re: Apache::args vs Apache::Request speed
Ian Ragsdale [EMAIL PROTECTED] writes: How about setting something up on SourceForge? I know they have OS X environments available for compiling and testing. apreq is an ASF project; IMO what we need now is a hero, not a change of venue. [...] On 1/28/02 2:02 PM, Joe Schaefer [EMAIL PROTECTED] wrote: [...] I hope a new release will be just around the corner, but if you want to test out some of the latest stuff, have a look at http://www.apache.org/~joes/ Would someone PLEASE volunteer to try to compile and test apache+mod_perl libapreq on OS/X using the experimental code I posted there? Even if you can't get it working, ANY feedback about what happened when you tried would be VERY helpful. Thanks alot. -- Joe Schaefer
Re: Apache::args vs Apache::Request speed
Heyas, JSWould someone PLEASE volunteer to try to compile and test JSapache+mod_perl libapreq on OS/X using the experimental JScode I posted there? Even if you can't get it working, JSANY feedback about what happened when you tried would be JSVERY helpful. Slightly off topic; I'd like to help with this but I have this curious problem. I'm trying to build Perl 5.6.itself 1 on Mac OS X (with the latest 10.1.2 update freshly installed, using the compiler from the developer tools CD that comes with OS X when you buy the 10.1 boxed version) before building Apache/mod_perl. So I go through the entire Configure sequence, and then no Makefile gets created (it goes through the entire routine of saying it's generating a Makefile, but whether I run Makefile.SH or have it done through Configure, no Makefile actually ever gets created). Has anybody else seen this really weird behavior trying to build Perl 5.6.1 on Mac OS X? A web search didn't turn up any relevant posts. Humbly, Andrew -- Andrew Ho http://www.tellme.com/ [EMAIL PROTECTED] Engineer [EMAIL PROTECTED] Voice 650-930-9062 Tellme Networks, Inc. 1-800-555-TELLFax 650-930-9101 --
Re: Apache::args vs Apache::Request speed
On 2/1/02 2:21 PM, Joe Schaefer [EMAIL PROTECTED] wrote: Ian Ragsdale [EMAIL PROTECTED] writes: How about setting something up on SourceForge? I know they have OS X environments available for compiling and testing. apreq is an ASF project; IMO what we need now is a hero, not a change of venue. I'm not suggesting you switch it to stay at sourceforge, I'm just saying that they have OS X boxes you can compile test on. Seems pretty simple to me. I'd volunteer my own computer, but it's an iBook and is constantly switching IP addresses due to moving around. On the other hand, I'd be happy to compile it, but what would I need to do to test it? Ian
Re: Apache::args vs Apache::Request speed
On 2/1/02 3:39 PM, Ian Ragsdale wrote: On the other hand, I'd be happy to compile it, but what would I need to do to test it? I'm in the process of trying this too (just building a mod_perl httpd in OS X is a bit tricky...) To test it, I think all you need to do is put these two lines in your startup.pl file (or whatever): use Apache::Request; use Apache::Cookie; If that works, the next step is to make an actual apache handler that uses both the modules to actually do something. And if that works, post detailed instructions (starting with the wget of the source tarballs :) -John
Re: Apache::args vs Apache::Request speed
On 2/1/02 3:21 PM, Joe Schaefer wrote: Would someone PLEASE volunteer to try to compile and test apache+mod_perl libapreq on OS/X using the experimental code I posted there? Even if you can't get it working, ANY feedback about what happened when you tried would be VERY helpful. (The below may not be very helpful, but I've gotta run right now. I'll try more this weekend if I can.) An initial build and install of: http://www.apache.org/~joes/libapreq-1.0-rc1.tar.gz on a previously-working apache 1.3.22 mod_perl 1.26 server on OS X 10.1.2 with this: use Apache::Request; use Apache::Cookie; In its startup.pl file causes the following: # bin/httpd -d /usr/local/apache -f conf/httpd.conf dyld: bin/httpd Undefined symbols: _ap_day_snames _ap_find_path_info _ap_get_client_block _ap_getword _ap_getword_conf _ap_hard_timeout _ap_ind _ap_kill_timeout _ap_log_rerror _ap_make_array _ap_make_dirstr_parent _ap_make_table _ap_month_snames _ap_null_cleanup _ap_pcalloc _ap_pfclose _ap_pfdopen _ap_popenf _ap_psprintf _ap_pstrcat _ap_pstrdup _ap_pstrndup _ap_push_array _ap_register_cleanup _ap_setup_client_block _ap_should_client_block _ap_table_add _ap_table_do _ap_table_get _ap_table_set _ap_table_unset _ap_unescape_url _hvrv2table _mod_perl_tie_table _perl_request_rec _sv2request_rec More later, I hope... :) -John
Indentifying dir_config's
I'm wondering if there is a way that I can mark or remeber that I've seen a particular dir_config during a previous request. The motivation is performance related - so that I can set up for particular set of PerlSetVar values only the once. Then subseqeuent requests to that child will use a previously determined value (instanciated object). IE: in my httpd.conf I have - PerlSetVar myvalue 100 Location /test PerlSetVar myvalue 200 /Location Location /different PerlSetVar myvalue 300 /Location So - request 1 - GET /test I check dir_config(myvalue) and setup. Can I mark that I was here; sorta like the equivalent of Location /test PerlSetVar myvalue 200 PerlSetVar signature myvalue_200 /Location request 2 - GET /test I want to know I was here before because I see that signature was set and I'll recall that. I was hoping that would work but setting a dir_config seems to go into the server-level and not to the calling container. Would there be another approach? Perhaps there is already a signature that would help me uniquely identify which set of containers made the call? Worst case scenario I could hash all the dir_config values and use that as my signature - but I was hoping there would be something cheaper to do. :) TIA and if this is unclear let me know and I'll get more detailed.
RE: [QUESTION]PerlHandler and PerlLogHandler Phase
Thanks Rob for your reply. --- Rob Bloodgood [EMAIL PROTECTED] wrote: Question: 2.If the answer to the above question is YES? The Handler will add headers,footers for everything. What do I need to do to apply the handler logic justto the requested page and return the remaining files that are needed to complete the requested page as they are? Answer: In the Eagle book (as well as a Perl Journal article) there is an example of a Apache::Header/Apache::Footer. CPAN doesn't show them right now. But you could implement them as filters using Apache::Filter to mark up each document on its way out, based on URI. Reply: I shall look into this. There is some database entries that have to take place as the web pages are being servered. Question: 3. When I move these JS files outside the /en/course URI they seem to work? But now when I put them with in? It just displays the Javascript code like simple text on the browser. Answer: SCRIPT SRC=/en/course/one.js/SCRIPT ... or you could template them in directly, since you're playing w/ the content already. Reply: Most of the books are already existing in that format. To Change them would be a lot of code rewriting,testing and deploying. Question: 4. In the Logging Phase, I need to store the last requested page as a bookmark. So if the user logs out, and logs back in it takes him to the same page. Since the html files are made up of some many requests to other files, it stores the last file it requested. It may be path to an image file,style sheet file etc... Is there any way I can circumvent this problem? Answer: You could use a cookie, issued with each document, noting what url they are on right now?? Logging it (storing it) and then reading it back are bound to be way too much work. Reply: I kind of figured this portion out. Though its is not a clean way to do it. In the ActivityLogger.pm, I plan to use $r-the_request instead of $r-uri. The PerlLogHandler being called on every request will be overwriting the same data in the database. Let us assume that the web page request has 5 more files that it depends. Would not the PerlLogHandler be called when each file is being server. HTH! L8r, Rob __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com
Re: Indentifying dir_config's
At 1:39 PM -0800 2/1/02, [EMAIL PROTECTED] wrote: I'm wondering if there is a way that I can mark or remeber that I've seen a particular dir_config during a previous request. The motivation is performance related - so that I can set up for particular set of PerlSetVar values only the once. Then subseqeuent requests to that child will use a previously determined value (instanciated object). IE: in my httpd.conf I have - PerlSetVar myvalue 100 Location /test PerlSetVar myvalue 200 /Location Location /different PerlSetVar myvalue 300 /Location So - request 1 - GET /test I check dir_config(myvalue) and setup. Can I mark that I was here; sorta like the equivalent of Location /test PerlSetVar myvalue 200 PerlSetVar signature myvalue_200 /Location I'm not sure if I understand... I've done something in one of my modues in the past... package MyHandler; our $INITED = 0; our %CONFIG = (); sub handler { unless($INITED) { %CONFIG = $self-get_config($r); $INITED = 1; } } That way I only have to get_config once per forked process... This is very useful for static (or near static) data. In this example get_config was pulling configuration directives from an Oracle database. Rob -- When I used a Mac, they laughed because I had no command prompt. When I used Linux, they laughed because I had no GUI.
Re: Apache::args vs Apache::Request speed
On 1 Feb 2002, Joe Schaefer wrote: Would someone PLEASE volunteer to try to compile and test apache+mod_perl libapreq on OS/X using the experimental code I posted there? Even if you can't get it working, ANY feedback about what happened when you tried would be VERY helpful. OK, if someone can communicate with me in private, seriously dumbed down details, I can try this. I'm a libapreq committer, and have sourceforge farm access, so I'll do my best there - though last time I tried I couldn't get onto their OSX box... -- !-- Matt -- :-Get a smart net/:-
questions
I am having problems getting Apache to recognize perl files... someone suggested installing mod_perl... 1) Is installing mod_perl necessary to running perl scripts via Apache / webserver ? 2) I saw something in the mod_perl faqs about getting a popup save window instead of the perl file running... can I add the PerlSendHeader On to Apache without running mod_perl ? That is what is happening here now... .cgi files run / .pl files give me the save widget. I hope somebody can help with this... I really WOULD like to do some programming with mod_perl too :) _ Chat with friends online, try MSN Messenger: http://messenger.msn.com
Re: performance coding project? (was: Re: When to cache)
On Sat, 26 Jan 2002, Stas Bekman wrote: [...] It's much better to build your system, profile it, and fix the bottlenecks. The most effective changes are almost never simple coding changes like the one you showed, but rather large things like using qmail-inject instead of SMTP, caching a slow database query or method call, or changing your architecture to reduce the number of network accesses or inter-process communications. It all depends on what kind of application do you have. If you code is CPU-bound these seemingly insignificant optimizations can have a very significant influence on the overall service performance. Of course if you app, is IO-bound or depends with some external component, than your argumentation applies. Eh, any real system will be a combination. Sure; when everything works then it's worth finding the CPU intensive places and fix them up, but for the most part the system design is far far more important than any code optimiziation you can ever do. My usual rhetorics: Your average code optimization will gain you at most a few percent performance gain. A better design can often make things 10 times faster and use only a fraction of your memory. On the other hand how often do you get a chance to profile your code and see how to improve its speed in the real world. Managers never plan for debugging period, not talking about optimizations periods. And while premature optimizations are usually evil, as they will bait you later, knowing the differences between coding styles does help in a long run and I don't consider these as premature optimizations. If you don't waste time profiling every little snippet of code you might have more time to fix the real bottlenecks in the end. ;-) [...] All I want to say is that there is no one-fits-all solution in Perl, because of TIMTOWTDI, so you can learn a lot from running benchmarks and picking your favorite coding style and change it as the language evolves. But you shouldn't blindly apply the outcomes of the benchmarks without running your own benchmarks. Amen. (And don't get me wrong; I think a repository of information about the nitty gritty optimization things would be great - I just find it to be bad advice to not tell people to do the proper design first). - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do(); more than a billion impressions per week, http://valueclick.com
Re: performance coding project? (was: Re: When to cache)
On Sat, 26 Jan 2002, Perrin Harkins wrote: It all depends on what kind of application do you have. If you code is CPU-bound these seemingly insignificant optimizations can have a very significant influence on the overall service performance. Do such beasts really exist? I mean, I guess they must, but I've never seen a mod_perl application that was CPU-bound. They always seem to be constrained by database speed and memory. At ValueClick we only have a few BerkeleyDBs that are in the request loop for 99% of the traffic; everything else is in fairly efficient in-memory data structures. So there we do of course care about the tiny small optimiziations because there's a direct correlation between saved CPU cycles and request capacity. However, it's only that way because we made a good design for the application in the first place. :-) (And for all the other code we rarely care about using a few more CPU cycles if it is easier/cleaner/more flexible/comes to mind first). Who cares if the perl code gets ready to wait for the database a few milliseconds faster? :-) - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do(); more than a billion impressions per week, http://valueclick.com
[OT] Mac OS X compilation woes (Was: Apache::args vs Apache::Requestspeed)
Hello, JSAn initial build and install of: JShttp://www.apache.org/~joes/libapreq-1.0-rc1.tar.gz JS JSon a previously-working apache 1.3.22 mod_perl 1.26 server on OS X 10.1.2 JSwith this: JSuse Apache::Request; JSuse Apache::Cookie; JS JSIn its startup.pl file causes the following: JS JS# bin/httpd -d /usr/local/apache -f conf/httpd.conf JSdyld: bin/httpd Undefined symbols: JS_ap_day_snames JS... JS_sv2request_rec I'm having a similar problem but it's for ANY symbols in a .a that you compile something with. e.g. say I have a C library and it lives in /usr/local/lib/libfoo.a (include in /usr/local/include/foo.h) and exports void foo(). If I have a test C program tester.c: #include foo.h int main { foo(); return 0 } And I compile it so: % cc -o tester -lfoo tester.c And I run it, I'll get the undefined symbols error that you paste above. This happens for me with a variety of existing open source libraries that I've built. I theorize your problem with libapreq may stem from a similar problem (I'm also running 10.1.2). Humbly, Andrew -- Andrew Ho http://www.tellme.com/ [EMAIL PROTECTED] Engineer [EMAIL PROTECTED] Voice 650-930-9062 Tellme Networks, Inc. 1-800-555-TELLFax 650-930-9101 --
Re: mod_perl Developer's Cookbook
On Thu, 31 Jan 2002, Paul Lindner wrote: I won't deal with amazon: http://www.noamazon.com I just added a page with direct links for eight other bookstores. It's now available at http://www.modperlcookbook.org/order.html Amazon are the cheapest though: http://www.allbookstores.com/book/compare/0672322404 :-) - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do(); more than a billion impressions per week, http://valueclick.com
Re: Thumbnail generator
On Mon, 21 Jan 2002, Robert Landrum wrote: [...] You may want to take a look at Apache::ImageMagick (if you not already have). It's let's you create thumbnails very easy (just two parameters pic.xxx/scale?geometry=100x100) and ImageMagick supports over 80 different formats. It also handles conversion from 4 color pictures to RGB for your thumbnails and many other things, if you need them. ImageMagick is way too slow for use in a production system. Especially if your resizing large images into thumbnails. I suggest sacrificing space for speed and pre-generating all your thumbnails. I do that too (with Image::Magick). If the pictures are large it takes forever to scale them even with a more efficient lib. Most of the time libjpeg will do everything you need, including scaling. I suggestion GD with Jpeg support or Inline.pm/C/libjpeg for real time conversion of jpegs. libjpeg doesn't (afaik) do sharpening/unsharp mask and the two billion other things that are nice to have if you are trying to get a high quality output. http://photo.netcetera.dk/g/snow|2002/01/01/DSC_0126.jpg;size=me :-) - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do(); more than a billion impressions per week, http://valueclick.com
ANN: HTML::Template 2.5
HTML::Template - a Perl module to use HTML Templates CHANGES 2.5 - Doc Fix: added reference to new HTML::Template website at http://html-template.sourceforge.net - Bug Fix: global_vars fixed for loops within loops - Bug Fix: include paths were broken under Windows (David Ferrance) - Bug Fix: nested include path handling was wrong (Gyepi Sam) - Bug Fix: MD5 signatures for file cache corrected (Martin Schroth) - Bug Fix: print_to was broken for tied filehandles (Darren Chamberlain) - Doc Fix: added mailing-list archive URL to FAQ, added link to tutorial, fixed typos and formatting DESCRIPTION This module attempts to make using HTML templates simple and natural. It extends standard HTML with a few new HTML-esque tags - TMPL_VAR, TMPL_LOOP, TMPL_INCLUDE, TMPL_IF, TMPL_ELSE and TMPL_UNLESS. The file written with HTML and these new tags is called a template. It is usually saved separate from your script - possibly even created by someone else! Using this module you fill in the values for the variables, loops and branches declared in the template. This allows you to separate design - the HTML - from the data, which you generate in the Perl script. This module is licensed under the GPL. See the LICENSE section below for more details. TUTORIAL If you're new to HTML::Template, I suggest you start with the introductory article available on the HTML::Template website: http://html-template.sourceforge.net AVAILABILITY This module is available on SourceForge. Download it at: http://sourceforge.net/project/showfiles.php?group_id=1075 The module is also available on CPAN. You can get it using CPAN.pm or go to: http://www.cpan.org/authors/id/S/SA/SAMTREGAR/ CONTACT INFO This module was written by Sam Tregar ([EMAIL PROTECTED]). You can join the HTML::Template mailing-list by sending a blank message to [EMAIL PROTECTED]
Perl Section Bug?
Okay, let me try again. I have a simple module I've written that demonstrates the problem. here it is: package MyTest; our $VERSION = '0.1'; use Apache; sub one { print STDERR One\n; print STDOUT One\n; return Apache::OK; } sub two { print STDERR Two\n; print STDOUT Two\n; return Apache::OK; } package Apache::ReadConfig; use strict; use warnings; our $NameVirtualHost = '*:80'; our %VirtualHost = ('*:80' = { ServerName = '_default_', DocumentRoot = '/usr/local/apache/htdocs', Location = { '/one' = { SetHandler = 'perl-script', PerlHandler= 'MyTest::one' }, '/two' = { SetHandler = 'perl-script', PerlHandler= 'MyTest::two' } } }); Now, if I execute this from httpd.conf by simply calling PerlModule MyTest Here's what I get for my requests: URL Prints === == http://myserver/one One http://myserver/two Two http://myserver/one/foo One http://myserver/two/foo Two http://myserver/one/two One http://myserver/one/twofoo One http://myserver/one/two/foo One http://myserver/two/one One http://myserver/two/onefoo One http://myserver/two/one/foo One It's the last three requests that are the problem. Because I'm hitting the '/two' location, I expect each of those examples to print Two. But because they each have one in the URL, they all print One! Why is this? It seems to be acting like LocationMatch directives rather than Location. Could this be a bug in how the Perl sections work? If not, how do I get that last request to print Two instead of One? Even if it *is* a bug, how do I get the proper behavior? TIA, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
CGI Upload/download question
Hi, I have a question regarding File Upload. My program Upload.cgi, prompt the user to upload a file, it then processes it and turns around and download it by setting the mime to a non-existing MIME type, say, SomeCrazyType via header() method. $q-header ( -type = application/x-SomeCrazyType ); The problem is that if the user supplied a filename MyFile.txt, in the course of returning it back to the user, and since the borwser will most likely does not how to deal with that crazy mime type, will prompt the user for Save and if that is chosen, then the name Upload.cgi is suggested. Can I somehow influence this behavior such that the user will indeed see something like MyFile.txt.returned or MyFile.txt.processed in the dialog box. By the way, the reason for the crazy MIME type, is to prevent the browser to render it. I'm trying to achive a complete upload-process-download. Perhaps there is an standard MIME type that I should use. Thank you -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Perl Section Bug?
On Fri, 2002-02-01 at 18:56, David Wheeler wrote: snip / Why is this? It seems to be acting like LocationMatch directives rather than Location. Could this be a bug in how the Perl sections work? If not, how do I get that last request to print Two instead of One? Even if it *is* a bug, how do I get the proper behavior? Okay, in a way, I've answered my own question. Prepending ^ to the front of each Location directive corrects the problem. However, I still think that this is a bug, because AFAIK, Location directives aren't supposed to use regular expressions unless they have the '~' character in them. I'm not sure how one would include that in Perl sections, but it seems better to require that Perl sections interpret Location directives as literal strings and LocationMatch directives as regular expressions Make sense? Thanks, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 Yahoo!: dew7e Jabber: [EMAIL PROTECTED] Kineticode. Setting knowledge in motion.(sm)
Re: mod_perl Developer's Cookbook
Ask Bjoern Hansen [EMAIL PROTECTED] wrote: On Thu, 31 Jan 2002, Paul Lindner wrote: I won't deal with amazon: http://www.noamazon.com I just added a page with direct links for eight other bookstores. It's now available at http://www.modperlcookbook.org/order.html Amazon are the cheapest though: http://www.allbookstores.com/book/compare/0672322404 Spend only $4 more, and you too can show your disgust for software patents. :-) ?
Re: MacOSX Requests and Cookies
Rick Frankel [EMAIL PROTECTED] writes: Joe- ApacheCookie_* was not being boostrapped into the executable, so it was being optimized of the linkage. The following patch, while probably not correct (and probably the cause of the silent failure), covers it. Great - thanks a ton! --- http_main.c Fri Feb 1 19:22:51 2002 +++ http_main.c~Mon Jan 28 04:07:46 2002 @@ -7805,12 +7805,5 @@ { return ApacheRequest_new(r); } -/*RAF*/ -#include apache_cookie.h -ApacheCookie *suck_in_apcookie(request_rec *r); -ApacheCookie *suck_in_apcookie(request_rec *r) -{ -return ApacheCookie_new(r); -} #endif /* USE_APREQ */ I've incorporated your patch and uploaded it to the website. Hopefully other OS X'ers will be able to confirm it works now. Also, the all-in-one compile method doesn't setup apache correctly, so the steps taken were: unpack everthing in the same root directory mod_perl: $ perl Makefile.PL APACHE_PREFIX=/usr/local/apache DO_HTTP=1 \ PREP_HTTP=1 USE_APACI=1 EVERYTHING=1 $ make $ make install http_apreq: $ perl Makefile.PL $ make $ make install apache: $ CFLAGS='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ./configure --prefix=local/apache \ --enable-shared=max --disable-rule=EXPAT --with-layout=Apache \ --activate-module=src/modules/perl/libperl.a --disable-shared=perl $ make $ make install You're my hero ;-) -- Joe Schaefer
cvs commit: modperl-2.0/xs/APR/APR APR.xs
dougm 02/02/01 12:00:53 Modified:xs/APR/APR APR.xs Log: specify prototyping behavior to shutup xsubpp Revision ChangesPath 1.4 +2 -0 modperl-2.0/xs/APR/APR/APR.xs Index: APR.xs === RCS file: /home/cvs/modperl-2.0/xs/APR/APR/APR.xs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- APR.xs22 Oct 2001 03:26:03 - 1.3 +++ APR.xs1 Feb 2002 20:00:53 - 1.4 @@ -13,6 +13,8 @@ MODULE = APRPACKAGE = APR +PROTOTYPES: disable + BOOT: file = file; /* -Wall */ apr_initialize();