[ANNOUNCE] Apache::ASP 2.35 bugfix release
Hey, I have released Apache::ASP 2.35 to CPAN. This is a minor bugfix release. For more information about Apache::ASP, please see http://www.apache-asp.org, and to get on the mailing list please email [EMAIL PROTECTED] Note that users of CPANPLUS get errors at make test stage because it seems that Archive::Tar does not untar the Apache::ASP distribution correctly. I have reported this bug to the maintainer of that module. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 =item $VERSION = 2.35; $DATE=05/30/2002 +Destroy better $Server $Response objects so that my closure references to these to not attempt to work in the future against invalid internal data. There was enough data left in these old objects to make debugging the my closure problem confusing, where it looked like the ASP object state became invalid. +Added system debug diagnostics to inspect StateManager group cleanup (d) Documentation update about flock() work around for Win95/Win98/WinMe systems, confirmed by Rex Arul (d) Documentation/site build bug found by Mitsunobu Ozato, where % % not being escaped correctly with $Server-HTMLEncode(). New japanese documentation project started by him at http://sourceforge.jp/projects/apache-asp-jp/ -InitPackageGlobals() called after new Apache::ASP object created so core system templates can be compiled even when there was a runtime compilation error of user templates. Bug fix needed pointed out by Eamon Daly
Re: MLDBM Tie Errors
Franck PORCHER wrote: Well, I'm not 100% sure, but I recently switched for MLDBM and got this problem too. Here is what I found, and did to remedy the situation : It *seemed* to me that the physical MLDBM repository was not physically created until I actually wrote something into it, eventhough it was reported as correctly open RW. This is correct. This is a performance enhancement, with the side effect that write errors will occur at runtime. So, any ends of my application trying to fetch value during this transcient stage got this kind of error (I do not remember precisely which one I got, but very close indeed). I solved the problem by doing an awful trick on each RW opening, such as : eval { tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660; $hash{'__DuMmY__'} = 'OK'; delete $hash{'__DuMmY__'}; }; That solved the problem in the midtime, waiting for something much better... You could also tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660; tied(%hash)-Lock; to similar effect, as Lock() will actually force a tie to the dbm on disk. The basic premise of MLDBM::Sync is that the tie/untie actually occur at the reads writes, so that i/o is flushed correctly. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: MLDBM Tie Errors
Mike Martinet wrote: Greetings, With this setup: Linux kernel 2.4.7-10 Apache 1.3.24 mod_perl-1.26 Apache::ASP 2.33 MLDBM 0.25 Please submit a trace of the error_log for the request, with PerlSetVar Debug -1 set, and a description of the problem as well as what file permissions for /mnt/hdb/www/content/ look like ( ls -l ) to the Apache::ASP list at [EMAIL PROTECTED] Please submit the error_log for a full request that contains the error. It might also help to set $SIG{__DIE__} = \Carp::confess; somewhere to recover a stack trace of where the error occurs. --Josh
Re: question on apache::asp
[EMAIL PROTECTED] wrote: So can I use this module to run asp.net on apache(installed on windows)? I need to run asp.net on apache(windows). No. Apache::ASP supports perl scripting for ASP v2.0 model. ASP.net is not supported, nor C#, VBScript, etc. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
[ANNOUNCE] Apache::ASP 2.33 released
Hey, Apache::ASP 2.33 is released, which you can find in your local CPAN, or http://www.perl.com/CPAN-local/modules/by-module/Apache/ Below are the changes for 2.33 2.31 since I never officially announced 2.31. This is a big release which has some bug fixes, lots of new test cases to verify the API, and some significant changes to code structure and the asp-perl CGI/command line processor. For more information on Apache::ASP, please see http://www.apache-asp.org Thanks, Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 $MODULE=Apache::ASP; $VERSION = 2.33; $DATE=04/29/2002 - fixed up t/server_mail.t test to skip if a sendmail server is not available on localhost. We only want the test to run if there is a server to test against. + removed cgi/asp script, just a symlink now to the ./asp-perl script which in this way deprecates it. I had it hard linked, but the distribution did not untar very well on win32 platform. + Reordered the modules in Bundle::Apache::ASP for a cleaner install. - Fixed bug where XMLSubs where removing ?xml version ... ? tag when it was needed in XSLT mode. + $Server-Mail({ CC = '...', BCC = '...' }), now works to send CC BCC headers/recipients. + Removed $Apache::ASP::Register definition which defined the current executing Apache::ASP object. Only one part of the application was using it, and this has been fixed. This would have been an unsafe use of globals for a threaded environment. + Decreased latency when doing Application_OnStart, used to sleep(1) for CleanupMaster sync, but this is not necessary for Application_OnStart scenario + Restructure code / core templates for MailErrorsTo funcationality. Wrote test mail_error.t to cover this. $ENV{REMOTE_USER} will now be displayed in the MailErrorsTo message when defined from 401 basic auth. + $Server-RegisterCleanup should be thread safe now, as it no longer relies on access to Apache::ASP::Cleanup for storing the CODE ref stack. + test t/inode_names.t for InodeNames and other file tests covering case of long file names. - Fixed long file name sub identifier bug. Added test t/long_names.t. + CacheDir may now be set independently of StateDir. It used to default to StateDir if it was set. ++ Decomposition of modules like Apache::ASP::Session Apache::ASP::Application out of ASP.pm file. This should make the source more developer friendly. This selective code compilation also speeds up CGI requests that do not need to load unneeded modules like Apache::ASP::Session, by about 50%, so where CGI mode ran at about 2.1 hits/sec before, now for light requests that do not load $Session $Application, requests run at 3.4 hits/sec, this is on a dual PIII-450 linux 2.4.x - Caching like for XSLTCache now works in CGI mode. This was a bug that it did not before. + $Server-File() API added, acts as a wrapper around Apache-request-filename Added test in t/server.t ++ *** EXPERIMENTAL / ALPHA FEATURE NOTE BEGIN *** New $PERLLIB/Apache/ASP/Share/ directory created to hold system user contributed components, which will be found on the $Server-MapInclude() path, which helps $Response-Include search '.',Global,IncludesDir, and now Apache::ASP::Share for includes to load at runtime. The syntax for loading a shared include is to prefix the file name with Share:: as in: $Response-TrapInclude('Share::CORE/MailError.inc'); New test to cover this at t/share.t This feature is experimental. The naming convention may change and the feature may disappear altogether, so only use if you are interesting in experimenting with this feature will provide feedback about how it works. *** EXPERIMENTAL / ALPHA FEATURE NOTE END *** + asp-perl script now uses ./asp.conf instead of ./asp.config for runtime configuration via %Config defined there. Update docs for running in standalone CGI mode + Make use of MANFEST.SKIP to not publish the dev/* files anymore. - Script_OnEnd guaranteed to run after $Response-End, but it will not run if there was an error earlier in the request. + lots of new test cases covering behaviour of $Response-End and $Response-Redirect under various conditions like XMLSubs and SoftRedirect and global.asa Script_OnStart + asp-perl will be installed into the bin executables when Apache::ASP is installed. asp-perl is the command line version of Apache::ASP that can also be used to run script in CGI mode. Test case covering asp-perl functionality. + asp CGI/command line script now called asp-perl. I picked this name because Apache::ASP often has the name asp-perl in distributions of the module. + Apache::ASP::CGI::Test class now subclass of Apache::ASP::CGI. To facilitate
Re: Global (to page) variables under Apache::ASP
Simon Oliver wrote: The Apache::ASP mailing list is at [EMAIL PROTECTED] ... please subscribe to it to post questions on this topic by emailing [EMAIL PROTECTED] Apache::ASP dev issues are officially off-topic on the mod_perl list now. More below on this issue... In my httpd.conf I have set 'PerlSetVar UseStrict 1' because I always use sctict anyway and I see in the docs that this might become the default too. So I always declare my variables with my(). Suppose I have a master ASP file that includes other scripts and these other scripts need access to the variables declrared in the master - no problem. But reading through the docs it looks like turning on DynamicIncludes would save alot of memory and be generally more efficient. Indeed, it would also protect the variables declared in one file from another because the includes are compliled and called as seperate subs. And here lies the problem, how to declare a vaiable in the master ASP file that is also in the scope of the dynamic include? You can stick with inline includes as you are doing, but DynamicIncludes are good, and you can pass values into them as subroutines: $Response-Includes($file, @args); # in $file % my @args = @_; % Just like a normal perl subroutine. For more on this, please see: http://www.apache-asp.org/objects.html#%24Response-%3EI2a8df2f3 You can also use globals, which you can declare for your entire application in your global.asa # global.asa use vars qw($Var1 $Var2); sub Script_OnStart { $Var1 = ''; $Var2 = 0; } I would strongly suggest you use locally scoped my() variables when possibly passing as @args to an include, but sometimes having a global can be handy which is why I mention the latter. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Problem with DBM concurrent access
Stas Bekman wrote: tied(%dbm_array)-sync(); I believe that's not enough, because the reader may read data during the write, resulting in corrupted data read. You have to add locking. see the DBM chapter in the guide. You might add MLDBM::Sync to the docs, which easily adds locking to MLDBM. MLDBM is a front end to store complex data structures http://www.perl.com/CPAN-local/modules/by-module/MLDBM/CHAMAS/MLDBM-Sync-0.25.readme What's nice about MLDBM is you can easily swap in out various dbms like SDBM_File, DB_File, GDBM_File, etc. More recently it even supports Tie::TextDir too, which provides key per file type storage which is good when you have a fast file system big data you want to store. SYNOPSIS use MLDBM::Sync; # this gets the default, SDBM_File use MLDBM qw(DB_File Storable);# use Storable for serializing use MLDBM qw(MLDBM::Sync::SDBM_File); # use extended SDBM_File, handles values 1024 bytes use Fcntl qw(:DEFAULT);# import symbols O_CREAT O_RDWR for use with DBMs # NORMAL PROTECTED read/write with implicit locks per i/o request my $sync_dbm_obj = tie %cache, 'MLDBM::Sync' [..other DBM args..] or die $!; $cache{} = ; my $value = $cache{}; ... DESCRIPTION This module wraps around the MLDBM interface, by handling concurrent access to MLDBM databases with file locking, and flushes i/o explicity per lock/unlock. The new [Read]Lock()/UnLock() API can be used to serialize requests logically and improve performance for bundled reads writes. Here's some benchmarks on my 2.4.x linux box dual PIII 450 with a couple 7200 RPM IDE drives raid-1 ext3 fs mounted default async. MLDBM-Sync-0.25]# perl bench/bench_sync.pl NUMBER OF PROCESSES IN TEST: 4 === INSERT OF 50 BYTE RECORDS === Time for 100 writes + 100 reads for SDBM_File 0.17 seconds 12288 bytes Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 0.20 seconds 12288 bytes Time for 100 writes + 100 reads for GDBM_File 1.06 seconds 18066 bytes Time for 100 writes + 100 reads for DB_File0.63 seconds 12288 bytes Time for 100 writes + 100 reads for Tie::TextDir .04 0.38 seconds 13192 bytes === INSERT OF 500 BYTE RECORDS === (skipping test for SDBM_File 100 byte limit) Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 0.58 seconds 261120 bytes Time for 100 writes + 100 reads for GDBM_File 1.09 seconds 63472 bytes Time for 100 writes + 100 reads for DB_File0.64 seconds 98304 bytes Time for 100 writes + 100 reads for Tie::TextDir .04 0.33 seconds 58192 bytes === INSERT OF 5000 BYTE RECORDS === (skipping test for SDBM_File 100 byte limit) Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 1.37 seconds 4128768 bytes Time for 100 writes + 100 reads for GDBM_File 1.13 seconds 832400 bytes Time for 100 writes + 100 reads for DB_File1.08 seconds 831488 bytes Time for 100 writes + 100 reads for Tie::TextDir .04 0.52 seconds 508192 bytes === INSERT OF 2 BYTE RECORDS === (skipping test for SDBM_File 100 byte limit) (skipping test for MLDBM::Sync db size 1M) Time for 100 writes + 100 reads for GDBM_File 1.76 seconds 2063912 bytes Time for 100 writes + 100 reads for DB_File1.78 seconds 2060288 bytes Time for 100 writes + 100 reads for Tie::TextDir .04 1.27 seconds 2008192 bytes === INSERT OF 5 BYTE RECORDS === (skipping test for SDBM_File 100 byte limit) (skipping test for MLDBM::Sync db size 1M) Time for 100 writes + 100 reads for GDBM_File 3.52 seconds 5337944 bytes Time for 100 writes + 100 reads for DB_File3.37 seconds 5337088 bytes Time for 100 writes + 100 reads for Tie::TextDir .04 2.80 seconds 5008192 bytes --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Modperl Footers/Headers
Philip M. Gollucci wrote: Okay I've got an FBSD4.5 box with apache-1.3.24 with mod_perl1.26 I need to add a canned Footer to every page except one (toc.html). This includes Location handlers, .cgi, .pl, .s?html http://modperl.com:9000/perl_conference/cool_tricks/mp_footer.html I saw that... but this doesn't work since .cgi, .pl files don't get processed just read and output. (Works great for .html files though) Take a look at Apache::Sandwich, it may do exactly what you want. You will probably have to specify certain file types to run with Apache::Sandwich, so you ignore things like image files. I would probably just used the Files config for that. If Apache::Sandwich does not work for you as is, you might try looking at its techniques or those of Apache::SSI with executing subrequests while adding content from various sources. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
[JOB] Senior mod_perl / java developer for LRN, Southern California
Hey mod_perl ASP Crew, I have the below job posting for this company LRN I have been contracting for this past couple years. They are looking for a senior developer with heavy mod_perl experience and some java too! This is a project that has snagged a few of us over the years, including our dear Ged Haywood, and our old friend Shane Nay ( where's he been anyway?! ) They really need a full time senior developer on site with the below skill sets. Is there anyone like this out there? If so, please send me resumes, code samples, etc., and I'll pass them along. Regards, Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 Position Title: Web Software Developer Department: Development Brief Overview Of Position: The Web Software Developer will work with a team of other highly skilled developers to rapidly develop, deploy, and maintain Web applications based on LRN knowledge and content delivery platforms. List Essential Job Functions: - Responsible for new feature development, integrations, and extensions to our existing products - Instrumental in developing new features and applications, as well as designing and developing integrations between new and existing product offerings - Highly skilled professional software engineer, able to rapidly develop and deploy professional quality software - Independent learner, thinker, and quality minded individual; the difference between getting it done and doing it right! - Ability to learn new skills and development environments as technology landscape shifts - Conversant in both hardware and software in computer market - Ability to engage in and support position on design and development issues - Ability to lead and teach other both junior and senior developers - Good written and verbal communication skills Technical Skills Required: - 2 years minimum experience with mod_perl/Apache on UNIX platforms - 2 years minimum experience with Java J2EE framework (including EJB and JSP) - Practical experience with high volume transactional RDBMS based web sites using DBI, preferably with Oracle - An intimate knowledge of Perl Object Oriented programming - Cross platform browser HTML eccentricities - Expertise in a wide variety of computer tools and development environments - Proven capabilities in programming and operating systems Previous Experience Required: - 5 years minimum industry experience - Experience with templates component based architecture - Practical software engineering experience, including several full life cycles of specification, design, development paradigms, testing, deployment, documentation, and configuration management Education Required (Certifications, Degrees, Majors, etc.): - 4 year degree or equivalent industry experience Experience Preferred: - Oracle RDBMS programming (triggers, stored procedures, etc.) - Oracle 9iAS Portal Web services - Linux x86 - Solaris SPARC - Load balanced web clusters - SSL proxy servers - Caching proxy servers - Network engineering List Any Lifting or Physical Requirements of the Position: - None
Re: Performace...
Kee Hinckley wrote: At 2:27 PM -0500 3/23/02, Geoffrey Young wrote: you might be interested in Joshua Chamas' ongoing benchmark project: [EMAIL PROTECTED]">http://mathforum.org/epigone/modperl/sercrerdprou/[EMAIL PROTECTED] http://www.chamas.com/bench/ he has the results from a benchmark of Apache::Registry and plain handlers, as well as comparisons between HTML::Mason, Embperl, and other templating engines. Although there are lots of qualifiers on those benchmarks, I consider them rather dangerous anyway. They are Hello World benchmarks, in which startup time completely dominates the time. The things that distinguish more sophisticated solutions from basic CGI or even modules are elements such as caching, pre-compiling and other techniques directly aimed at improving real-world performance. Hello World isn't going to show those at all. The mathforum link above points to more recent results which includes an h2000 test which is a more complex 3K+ script producing 20K+ in output. You will see in those results Embperl getting near the same performance as PHP. I would agree, the normal hello world test does not go far to measure the runtime characteristics of web application environment. To this end I would like to do things like database benchmarks scripts too for the various environments, but it will be a long time in coming as it is a lot of work to set up these tests. You can get the latest benchmarks at http://www.chamas.com/bench/hello.tar.gz The results posted at chamas.com/bench are older which were compiled from various system from various people at various times, and have not been updated in quite some time (my bad). The downloadable benchmarks are ones that you can run yourself which generally produces the most relevant results. --Josh _____ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Response-Debug and IIS
Mike Martinet wrote: Can anyone tell me if $Response-Debug from Apache::ASP is implemented in ActiveState Perl under IIS? Unlikely, as I specifically developed it for Apache::ASP. Please post all Apache::ASP specific questions to its mailing list, which you can get on at [EMAIL PROTECTED] You could always develop your own method/sub for this which calls $Response-Debug under mod_perl does something else under IIS. Also, if there is some IIS/PerlScript method missing in Apache::ASP that you would like to use, please post your API request to the asp list. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Calling an Apache::ASP page from an Apache::Registry script
Andrew Ho wrote: Hello, Apologies if this has been asked before; I searched the archives but couldn't find a reference to this. It's been discussed in the context of MVC design a while back, but I don't have a solid answer to the following question: can you call an Apache::ASP page from an Apache::Registry script? Couched in MVC terminology, can I forward control from a .pl controller to a .asp template, and pass arguments in a natural way? ... The safest thing to do right now would probably be to do an external redirect to the ASP page like: Apache-request-header_out('Location', script.asp?$ARGS); I do not think you would be able to pull off an internal redirect, or you might, but there might be complications if the first script tried to read POST input on STDIN, and then the ASP script tried also, there would probably be a hang. You could also call the registry/cgi as an asp script directly and have access to the ASP API like: # cgi wrapper script.asp, works with inline includes ( DynamicIncludes 0 ) % !--#include file=script.pl-- % or % do script.pl; % then the script.pl could do all the ASP API calls it likes as in: # script.pl ... $Server-Transfer('redirect_to.asp', @args); ... If what you really want is to simply load an external ASP script as a template for further processing in the script.pl, and you only want to run script.pl as an Apache::Registry script, there is not an API for doing this currently. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Strange behavoir with an ASP application
[EMAIL PROTECTED] wrote: ... Syntax error on line 51 of /etc/httpd/conf/vhosts/Vhosts.conf : Invalid command 'PerlModule', perhaps mis-spelled or defined by a module not included in the server configuration The Files directive was suggested by a Apache-Asp config information over its web-site. Any Clue ? It seems that perl module isn't enabled. My Apache instalation was drived by my distro (Mandrake 8.1) and I installed the Apache_ASP package and many things correlated with perl. My httpd (service) always start httpd-perl prior to httpd. It is enough to get ASP running ? Your httpd-perl is probably driven off of different config data than your httpd service, you probably added the PerlModule to the httpd server conf where mod_perl was not loaded ( DSO ) or compiled in. So make sure you know where your httpd-perl service gets its config data from... this might be from a block like: IfDefine Perl PerlModule Apache::ASP /IfDefine where httpd-perl is started with -D Perl, or might be an entirely different config file like httpd-perl.conf, but this seems dependent on how your system is configured. One thing you can try is to grep your *.conf files for PerlModule to see where mod_perl conf should be working. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache Bench
Last I checked, ab which comes with Apache, had not yet been ported to NT/2000 officially. However, there does seem to be a port available here: http://www.remotecommunications.com/apache/ab/ Upon testing their precompiled version however, I found that that it doesn't seem to work too well, in that it can only do some 1 request per 4 seconds :( -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: OT: Converting a ASP request to CGI?
Alessandro Forghieri wrote: Greetings. I realize this is an Off-Topic with serious flamage potential, so I'll keep it very short. Is anybody aware of any module capable of doing for the ASP environment what Apache::Registry does for mod_perl? (i.e. making an asp request look and feel as if it were an old plain cgi-bin) If, you are talking about perl scripting ASP, then you can run that under Apache::ASP, check out http://www.apache-asp.org If you are talking about VBScript ASP, check out Chilisoft or Halcyon's Instant ASP. If you are talking about CGI scripts under Apache::ASP, just wrap them with % % and they should work. If something else, please clarify what you mean. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache ASP help not helpfull :(
alan matthews wrote: I wanted to run a local server but Microsoft PWS doesn't run on Win ME. Searching around I came across this http://www.ricocheting.com/sever/index.html I found it very helpful, albeit a bit out of date. So, I've installed apache_1.3.22-win32-x86.msi onto this Win ME machine as a localhost and it works fine. I've installed ActivePerl, and it works fine too. I want to run ASP, so I download Apache-ASP-2.29 [[ for Apache::ASP support, get on its mail list by emailing [EMAIL PROTECTED] ]] For a quick start, I'd recommend installing the prebuilt win32 mod_perl / apache from: http://perl.apache.org/distributions.html This page ends up referring you to: ftp://theoryx5.uwinnipeg.ca/pub/other/perl-win32-bin-0.7.exe It comes fortunately with a working Apache::ASP. You will still need to update the ./perl/lib/Config.pm to point to your compiler installation if you want to build your own perl modules later. This hint is provided here: http://www.apache-asp.org/install.html#Win32%20Instal93dbe80f As a user going through these woes, it would be helpful if you could suggest how I could make that part of the install help stand out more, and content that would be more useful accurate to you? What is not in the help is a bug/workaround for WinME / Win9x users that occurred recently in the 2.25 release of Apache::ASP. The bug is that MLDBM::Sync uses flock() which is not implemented on WinME. The fix is to add this to you httpd.conf, preferrably Perl *CORE::GLOBAL::flock = sub { 1 }; /Perl This fix is not necessary if you do not use $Session or $Application though, which you can turn off with the httpd.conf config: PerlSetVar NoState 1 Then as per the instructions I did ___ shell prompt perl -MCPAN -e shell ... cpan install Bundle::Apache::ASP ___ A huge amount of text flowed down the screen which ended with ___ Removing previously used \.cpan\build\Apache-ASP-2.29\. Couldn't find \.cpan\build\Apache-ASP-2.29\. at C:/Perl/lib/CPAN.pm line 1972 ___ I will check out the bundle files and see how they can be improved for the next release. I tried to run some of Perl's sample asp pages but nothing worked. Clealy the phrase:- 'The easiest way to install Apache::ASP for the first time from perl is to fire up the CPAN shell like:' isn't quite as easy as it claims. The rest of the information at http://www.nodeworks.com/asp/install.html is unitelligable to anyone who hasn't worked with servers, and all the FAQ's seem to assume your an expert, so I'm no better off. Apache::ASP isn't geared towards new users. It makes a lot of of assumptions like knowledge of perl, apache, unix ( perl is unix paradigm programming often, even on win32 platforms ). I would like it to make it more user friendly, and I understand the docs site can help, so please send me your suggestions. So, is there any chance of an Idiot's guide to getting this ASP to work? Not yet! I have long considered writing a book on Apache::ASP, which would probably have at least a chapter as the Idiot's guide. I don't think it would be out in time for your needs though :( -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache ASP help not helpful. I'm not alone
alan matthews wrote: I've just seen a pile of posts on a Yahoo board full of people with ASP problems. If these are Apache::ASP users, they need to get on the mail list for it at [EMAIL PROTECTED] ... If they are using IIS / VBScript or PerlScript ASP, then they may be in the right place? --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: receiving XML by POST
Maarten Stolte wrote: Hello, i'm trying to figure out how to receive an xml message/file/stream(?) using POST, and how to be able to then send that to somewhere else (DBI). We're using MASON, don't know if that is information needed in this, but i saw something about MASON picking up all posts. I believe the usual way to access POST data, $r-content, is only for form data. To get XML data, try this: my $buf = ''; $r-read($buf, $ENV{CONTENT_LENGTH}); This is a general mod_perl API issue, and not necessarily specific to Mason, though Mason may have some other API specific to this. This may in fact collide with Mason form processing if there is any, since a mod_perl application will hang if it tries to read the POST data twice. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: array's first element is empty
Viljo Marrandi wrote: Hello, Not sure if this is mod_perl related, but i hope someone can help me anyway. When i do DBI queries from mod_perl handler and put all returned results in array then array's first element is empty, I wonder why? I don't like to shift off first element every time i return the result. Has anyone seen this before and what could cause this? This is off topic for mod_perl, and should as such either not be posted, or posted with a [OT] in the beginning of the subject line. The DBI mailing lists would be of greater help, listed here at: http://www.isc.org/services/public/lists/dbi-lists.html To answer your question, a query like: select nothing,something from table would have a undef value returned from the nothing column if the data in that column were NULL. You probably should remove the nothing column from your query instead of shifting the results. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: array's first element is empty
Issac Goldstand wrote: I don't think this is OT. I have had a similar error in which SELECT statements return fine under mod_cgi, but mysteriously get an extra null field underl mod_perl with Apache::DBI... I don't know what causes it, nor have I looked into it, but I think it is somewhat related to or caused by mod_perl or some of its' modules... This sounds like it might be a bug then, and I might bring it up on the DBI list and see if there is a solution. It might be that something in the glue of Apache::DBI is causing this problem too, but would doubt that, as I believe this glue only overrides behavior for connect/disconnect. Note that I have never seen this bug, working with Oracle mysql under various perls mod_perl builds, so you might look at your particular software versions as having the problems, or even your particular database driver ( DBD::* ) for the problem. Also, sometimes DBD::* drivers are guided by %ENV settings, like Oracle, so make sure that your mod_perl has the same %ENV as your when running under mod_cgi. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
[ANNOUNCE] Apache::ASP v2.29
Hey, Apache::ASP v2.29 has been released, CHANGES below, and you can get it in your local CPAN, or: http://www.perl.com/CPAN-local/modules/by-module/Apache/ There are some major bugs fixed in this release, that stem from new work in the 2.25 release. These bugs are about empty $Sessions not getting garbage collected POST requests over fast LAN connections sometimes returning an empty web response of 0 bytes. There were other optimizations, features bugfixes this release. Some big features are XML::LibXSLT support for XSLT rendering and support for running under PerlTaintCheck On security config. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 CHANGES: +Added some extra help text to the ./cgi/asp --help message to clarify how to pass arguments to a script from the command line. +When using $Server-Mail() API, if Content-Type header is set, and MIME-Version is not, then a MIME-Version: 1.0 header will be sent for the email. This is correct according to RFC 1521 which specifies for the first time the Content-Type: header for email documents. Thanks to Philip Mak for pointing out this correct behavior. +Made dependent on MLDBM::Sync version .25 to pass the taint_check.t test +Improved server_mail.t test to work with mail servers were relaying is denied +Added htmlbody tags to MailErrorsTo email --Fixed SessionCount / Session_OnEnd bug, where these things were not working for $Sessions that never had anything written to them. This bug was introduced in 2.23/2.25 release. There was an optimization in 2.23/2.25 where a $Session that was never used does not write its state lock file dbm files to disk, only if it gets written too like $Session-{MARK}++. Tracking of these NULL $Sessions then is handled solely in the internal database. For $Session garbage collection though which would fire Session_OnEnd events and update SessionCount, the Apache::ASP::State-GroupMembers() function was just looking for state files on disk ... now it looks in the internal database too for SessionID records for garbage collection. Added a test at ./t/session_events.t for these things. +Some optimizations for $Session API use. +Added support for XSLT via XML::LibXSLT, patch courtesy of Michael Buschauer -Got rid of an warning when recompiling changing includes under perl 5.6.1... undef($code) method did not work for this perl version, rather undef($code) does. Stopped using using Apache::Symbol for this when available. -Make Apache::ASP script run under perl taint checking -T for perl 5.6.1... $code =~ tr///; does not work to untaint here, so much use the slower: $code =~ /^(.*)$/s; $code = $1; method to untaint. -Check for inline includes changing, included in a dynamic included loaded at runtime via $Response-Include(). Added test case for this at t/include_change.t. If an inline include of a dynamic include changes, the dynamic include should get recompiled now. -Make OK to use again with PerlTaintCheck On, with MLDBM::Sync 2.25. Fixed in ASP.pm, t/global.asa, and created new t/taint_check.t test script +Load more modules when Apache::ASP is loaded so parent will share more with children httpd: Apache::Symbol Devel::Symdump Config lib MLDBM::Sync::SDBM_File +When FileUploadMax bytes is exceeded for a file upload, there will not be an odd error anymore resulting from $CGI::POST_MAX being triggered, instead the file upload input will simply be ignored via $CGI::DISABLE_UPLOADS. This gives the developer the opportunity to tell the user the the file upload was too big, as demonstrated by the ./site/eg/file_upload.asp example. To not let the web client POST a lot of data to your scripts as a form of a denial of service attack use the apache config LimitRequestBody for the max limits. You can think of PerlSetVar FileUploadMax as a soft limit, and apache's LimitRequestBody as a hard limit. --Under certain circumstances with file upload, it seems that IsClientConnected() would return an aborted client value from $r-connection-aborted, so the buffer output data would not be flushed to the client, and the HTML page would return to the browser empty. This would be under normal file upload use. One work-around was to make sure to initialize the $Request object before $Response-IsClientConnected is called, then $r-connection-aborted returns the right value. This problem was probably introduced with IsClientConnected() code changes starting in the 2.25 release.
Linux Hello World Benchmarks - 11/19/2001
Hey, [[ NUMBERS ARE BELOW ]] It has been a while, but here's a new set of Hello World benchmarks! What took me so long in getting these out is that the java web environments that I had set up would keep crashing during the tests in ways that would not only render their benchmarks meaningless, but also skewed the results for other tests, say when a java thread would spin out of control! You can download the latest benchmark suite to run on your system at: http://www.chamas.com/bench/hello.tar.gz It seems to run on linux solaris just fine, though the tests that are run depend on what environments you have set up. Please see the distribution README on how to run the suite for yourself. --Josh METHODOLOGY: These latest numbers come from my running the pubbench.sh script: ]# cat pubbench.sh #!/bin/bash ./bench.pl -version --ram --init-exec=perl javainit.pl -restart -time=180 --store=results perl ./javainit.pl -stop The javainit.pl will kill any of my existing java environments, and if the current test needs java will start them up. The test run for 180 seconds total in 60 second batches, and for each 60 second run the javainit.pl script will be executed. The --ram flag attempts to calculate the RAM used by each test on my linux system during each 60 second test with the results averaged across each, so for applications with memory leaks, the RAM used only shows 60 seconds worth of them. The RAM calculation looks at RAM used SWAP used from the linux /proc/meminfo file... as it looks at RAM before the httpd is fired up, but after the init-exec script executes, the RAM does not take into account the java web server environments being started, just memory usage that occurs after they start being used. DISCLAIMER: These numbers are just that, numbers. Please don't let them upset you. If you have a positive contribution that you would like to make, you may download the source code and submit patches ( preferably as diff -u ) to the test suite. This benchmark suite has evolved over years of benchmarking, and takes the point of view that web environments can only be well compared when run on the exact same system configuration... this is why the suite is done is such a way that you can run it on _your_ system giving you results relevant to you! NUMBERS: And without further adieu ... ( see NOTES below ) Test Name Test File Hits/sec # of Hits Time(sec) secs/Hit Bytes/Hit Mem(KB) - - - - - - - - Apache::ASP v2.29 2000 h2000.asp 216.8 39042180.090.004613 28998 33632 Apache::Registry v2.01 2000 mod_per h2000.reg 341.3 61442180.040.002930 28179 16081 HTML::Embperl v1.3.0 2000 h2000.epl 113.2 20391180.120.008833 28841 20418 HTML::Mason v1.03 2000 h2000.mas 84.0 15115180.030.011911 28799 112220 HTML::Template v2.4 2000h2000.htm 99.1 17848180.030.010087 29152 50292 mod_caucho JSP 2000 h2000.jsp 97.6 17617180.540.010248 28965 14057 mod_jserv JSP 2000 h2000.jsp 148.7 26773180.040.006725 29408 29613 mod_php PHP 2000h2000.php 258.2 46477180.020.003873 28866 10212 Template v2.04 Toolkit 2000 h2000.tt53.3 9604180.030.018745 28889 55629 Test Name Test File Hits/sec # of Hits Time(sec) secs/Hit Bytes/Hit Mem(KB) - - - - - - - - Apache::ASP v2.29 hello.asp 349.8 62985180.050.002859 242 29601 Apache::Dispatch v0.09 handler hello/wor 585.8105443180.010.001707 197 9205 Apache::ePerl hello.epe 347.1 62508180.080.002881 218 17477 Apache::Registry v2.01 CGI Raw hello.cgi 677.7122003180.030.001476 5213061 Apache::Registry v2.01 CGI.pm hello.cgi 449.7 80967180.050.002224 217 20717 Apache::SSI v2.16 hello.sht 546.7 98426180.030.001829 200 13061 CGI::SpeedyCGI CGI Raw hello.scg 159.6 28722180.000.006267 197 9748 CGI::SpeedyCGI CGI.pm hello.scg 145.1 26117180.010.006892 217 10648 HTML static hello.htm 879.215170.610.001137 312 1982 HTML::Embperl v1.3.0hello.epl 463.6 83471180.050.002157 221 17333 HTML::Mason v1.03 hello.mas 368.5 66348180.040.002714 198 29009 HTML::Template v2.4
Re: Linux Hello World Benchmarks - 11/19/2001
Perrin Harkins wrote: on 11/19/01 8:05 PM, Joshua Chamas at [EMAIL PROTECTED] wrote: It has been a while, but here's a new set of Hello World benchmarks! There was a recent announcement of HTML::Template::JIT, and Template Toolkit has an XS option now. Any chance you could put those into the next round? - Perrin OK, I upgraded Template Toolkit to version 2.06 with XS option on for all templates, and performance is much improved!! However, HTML::Template::JIT will likely not work on my system any time soon, because it was written for perl 5.6, and I only run 5.00503 currently. Someone else can submit a test config specifically for HTML::Template::JIT, I'd suggest the h2000 type where speed matters, and I'll add it to the test suite even it I can't run the benchmark myself. [hello]# ./bench.pl -type=2000 -ram -time=60 Test Name Test File Hits/sec # of Hits Time(sec) secs/Hit Bytes/Hit Mem(KB) - - - - - - - - Apache::ASP 2000h2000.asp 209.4 12566 60.020.004776 28998 33200 Apache::Registry 2000 mod_perl API h2000.reg 327.0 19622 60.020.003059 28179 15300 HTML::Embperl 2000 h2000.epl 107.5 6465 60.120.009299 28841 20048 HTML::Mason 2000h2000.mas 80.8 4849 60.000.012374 28799 110292 HTML::Template 2000 h2000.htm 95.4 5724 60.010.010484 29152 49932 mod_php PHP 2000h2000.php 247.6 14862 60.020.004038 28866 10384 Template Toolkit 2000 h2000.tt 125.5 7533 60.020.007967 28889 55748 -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: [Maybe OT] Modular design - calling pages like a subroutine with a twist.
Scott Chapman wrote: I'm very interested in making a modular site design but haven't found the tools yet to allow this with the twist I'm looking for. I'll try to show how Apache::ASP could help here. In Apache::ASP, scripts can be executed as subroutines, even with return values, and I think this goes to the heart of what you need here. I would probably break abstract headers footers out of each page, to be called automatically in global.asa. This allows all pages to not need to know about HTML headers footers being sent: # global.asa sub Script_OnStart { $Response-Include('header.inc'); } sub Script_OnEnd { $Response-Include('footer.inc'); } Say I have a page that encapsulates some functionality, such as sending a form then validating the contents that are returned. I'd call that PageB. PageB could be more than one page or a page calling itself, etc. Right ... PageB is just form logic/rendering, headers footers are called automatically via events in global.asa. When PageA calls PageB, as soon as PageB finishes presenting the form it doesn't stop but drops out the bottom and returns immediately to PageA. There are commands in some of the tools (Mason and soon Embperl - maybe others) to force it to stop there but this doesn't make for the modularity I have in mind. #PageA % my @rv = $Response-Include('PageB', @args); % !-- Rest of PageA -- $Response-Include() just calls another page as a perl subroutine is called with @args passed in as @_ in the script, and @rv returned if return(@rv) is used in the script too. PageB then gets submitted by the user and it either calls itself (using conditionals to then do the data validation) or another page. After things are validated Ok, I'd like to have it return right back to PageA, just where it left off using a Return statement. Thus, PageA could call a PageB and have it do all it's processing then return, just like calling a regular subroutine. PageA can execute PageB, and PageB can execute PageA, but this could cause a loop, so I am not sure what you really want here, but hope the above showed how one might achieve this. 2) are there any tools (preferrably perl) out there that support this cleanly. I've worked with Embperl and glanced through the docs of Mason, AxKit and TT and didn't see anything looking like this. The $Response-Include() mechanism is very powerful, turning pages into subroutines, and always returns to the original caller. To transfer control to another page without returning, use $Server-Transfer(). This differs from $Response-Redirect() in that all the globals like $Session/$Application/$Request remain the same. If the ASP syntax is too ugly for you, you could turn this into an XMLSub used like: page:include file=PageB arg1=... arg2=... / where you would define: # global.asa or page.pm or any perl module that gets loaded sub page::include { my($args) = @_; $Response-Include($args-{'file'}, $args); } -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: asp perl problem
Julian Martin wrote: Hi I am new to perl and would like to make a asp page with a script that will find all files in a given directory and create links to different files in another directory. The two sets of files are images (thumbnails and big pics) so I would also like to show the thumbnails on the page and have the links to the bigger pics. I already have all the images and do not need a thumbnail generator. I just want it so that when I add new images thats it. I am not asking for a complete answer only a pointer towards which functions would best do this job etc. Any help you can give would be great. Ju. This isn't really an Apache::ASP ( or modperl ) question, so in the future another forum should be used for posting perl questions of this nature like news:comp.lang.perl.misc ... for Apache::ASP issues the list is [EMAIL PROTECTED], subscribe at [EMAIL PROTECTED] # find all files in a given directory my @files = globa(/path/to/dir); # create a link to another file, see perldoc -f symlink symlink($old_file, $new_file) || die(can't symlink $old_file to $new_file: $!); If you are unix, and are more familiar with command line commands, then you can also do: my $output = `ln -s $old_file $new_file`; $output || die(error doing ln -s $old_file $new_file: $output); If glob() doesn't work on your platform, you can try opendir(), readdir(), closedir() Since it sounds like you are writing a gallery, you might try instead to use one already written like Apache::Gallery. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: [OT] New persistent perl engine
Matt Sergeant wrote: It actually wasn't written for web apps. I wrote it for our virus checker, which is 10K+ lines of perl code, and takes about 0.7s to load, and almost zero time to process an email, so we needed to eliminate that 0.7s. So, the benefit of PPerl is it's more generally usable than FastCGI or SpeedyCGI. There are downsides, of course, like the fact that the daemon stub is written in Perl, rather than C. And the forking version doesn't seem to work (not sure what I've done wrong there), so it's single threaded at the moment (the forking code is in the distro if anyone wants to try and make it work). Hey this is a great idea! I particularly like the idea of having it be in pure perl ... one of the drawbacks to CGI::SpeedyCGI I could see was that so much was in C, it seems like it might be hard to port to Win32 one day. If PPerl becomes viable for running web cgis, then it may be that a heavy web app environment like Apache::ASP could one day run under IIS/Win2000 as a pperl CGI !! Sounds cool. I will try to help with this project as time permits, as I am very interested in taking Apache::ASP to other platforms where mod_perl is not necessarily available. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: OT: Internal server error on Refreshing mod_perl page ( Apache::ASP)
[EMAIL PROTECTED] wrote: hi, How far along is mod perl ASP? IOW just how compatible is it to the proprietary equiv? Reason being is that i would love to offer it to clients that use the m$ one transparently. That way they get what they want if that is what they want and i get what i want. Namely to continue to use mod perl and apache:-)) TIA Apache::ASP is mostly compatible with PerlScript under IIS, with the exception of support of win32 COM objects like ADO db access. However, as Richard explains, most people on IIS would be using VBScript for their ASP applications, so would not be portable to Apache::ASP, which currently supports perl scripting only. However there are other alternatives for supporting VBScript/ASP on Apache, particularly with Chilisoft's ASP or Halcyon's Instant ASP. Both of these are commercial products however. Also, Ime Smits, cc'd on this email, has a perl utility that can convert VBScript ASP to perl scripting ASP for running under Apache::ASP. He might be able to offer this code to you in some form. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Internal server error on Refreshing mod_perl page ( Apache::ASP )
SubbaReddy M wrote: Hello Gurus, [Sat Nov 10 11:54:32 2001] [error] Insecure dependency in eval while running with -T switch at /usr/lib/perl5/site_perl/5.6.1/MLDBM/Serializer/Data/Dumper.pm line 51. MLDBM::Serializer::Data::Dumper::deserialize('MLDBM::Serializer::Data::Dumper=HASH(0x843bd20)', '$MlDbM{\'timeout\' = \'1005374203\'}') called at /usr/lib/perl5/site_perl/5.6.1/MLDBM.pm line 155 MLDBM::FETCH('MLDBM=HASH(0x843bd08)', '07abbd5f03d200c6bac27a861f47e35e') called at /usr/lib/perl5/site_perl/5.6.1/MLDBM/Sync.pm line 85 MLDBM::Sync::AUTOLOAD('MLDBM::Sync=HASH(0x843a838)', '07abbd5f03d200c6bac27a861f47e35e') called at This error comes from the mod_perl config: PerlTaintCheck On You can see more on this error at: http://www.apache-asp.org/faq.html#Insecure%20depec6cd400 I would not recommend trying to get Apache::ASP to run under PerlTaintCheck as its been a while since the author ( me ) has done so, so there will likely be other errors in doing so than what's listed in the above FAQ item. So find the config in your system *.conf files and turn it off for now. Future Apache::ASP support queries should be emailed to the email list specific to it. You can subscribe to it at [EMAIL PROTECTED] --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: [OT] Data store options
Bill Moseley wrote: Hi, verbose I'm looking for a little discussion on selecting a data storage method, and I'm posting here because Cache::Cache often is discussed here (along with Apache::Session). And people here are smart, of course ;). Basically, I'm trying to understand when to use Cache::Cache, vs. Berkeley DB, and locking issues. (Perrin, I've been curious why at etoys you used Berkeley DB over other caching options, such as Cache::Cache). I think RDBMS is not required as I'm only reading/writing and not doing any kind of selects on the data -- also I could end up doing thousands of selects for a request. So far, performance has been good with the file system store. Hey Bill, I'll tell you about using MLDBM::Sync for this, of which I'm the author. MLDBM::Sync is a wrapper around MLDBM databases which could be SDBM_File, GDBM_File, DB_File, and recently Tie::TextDir based. It provides the locking layer that you need to keep access to the database safe, without corrupting things or losing data. Depending on the OS, and whether the dbm is on something like a RAM disk, performance will vary. MLDBM has long been a simple way to read and write complex data to dbm file through an easy tied interface: $dbm{$key} = \%data; my $data = $dbm{$key}; What you get with MLDBM::Sync is the locking API, plus some other goodies like RAM caching and auto checksum keys if you like. 1) Read/write a single record 2) Read anywhere from a few to thousands of records in a request. This is the typical mod_perl-based request. I know the record IDs that I need to read from another source. I basically need a way to get some subset of records fast, by record ID. 3) Traverse the data store and read every record. Regarding some of these specific issues ... I wrote MLDBM::Sync to be able to specifically handle #1 safely. For #2, there is an API that you can use like tied(%hash)-Lock(); OR tied(%hash)-ReadLock(); ... do lots of reads/writes ... tied(%hash)-Unlock(); that can be used to improve the performance of multiple reads and writes between requests. You can use the locking strategy too to do #3 really fast, or slower without locking. I wrote this using the techniques I had long been using in Apache::ASP for $Session and $Application support, and recently bolted MLDBM::Sync in for these. I have been using MLDBM::Sync in production for something like 6 months to a year now as a stand alone module, but only recently added support for Tie::TextDir. When reading (item 2) I have to create a perl data structure from the data, which doesn't change. So, I want to store this in my record, using Storable.pm. That can work with any data store, of course. MLDBM supports this kind of thing natively, via: use MLDBM qw(DB_File Storable);# use Storable for serializing Below are some benchmarks when running bench/bench_sync.pl in the MLDBM::Sync distribution on my 2.2.14 Linux kernel on ext2 fs. Only in my .23 dev release have I added the -n --bundle options you see below. The bundle option in particular is the # of reads/writes per lock, which is used to improve performance. I would probably use GDBM_File in your position, as I am not sure that Tie::TextDir would scale as well past 1 files/entries. Happy hacking! --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 [MLDBM-Sync-0.21]# perl bench/bench_sync.pl === INSERT OF 50 BYTE RECORDS === Time for 100 writes + 100 reads for SDBM_File 0.14 seconds 12288 bytes Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 0.17 seconds 12288 bytes Time for 100 writes + 100 reads for GDBM_File 3.00 seconds 18066 bytes Time for 100 writes + 100 reads for DB_File4.10 seconds 20480 bytes Time for 100 writes + 100 reads for Tie::TextDir .04 0.24 seconds 9096 bytes === INSERT OF 500 BYTE RECORDS === Time for 100 writes + 100 reads for SDBM_File 0.24 seconds 1297408 bytes Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 0.54 seconds 207872 bytes Time for 100 writes + 100 reads for GDBM_File 2.98 seconds 63472 bytes Time for 100 writes + 100 reads for DB_File4.29 seconds 114688 bytes Time for 100 writes + 100 reads for Tie::TextDir .04 0.27 seconds 54096 bytes === INSERT OF 5000 BYTE RECORDS === (skipping test for SDBM_File 1024 byte limit) Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 1.35 seconds 1911808 bytes Time for 100 writes + 100 reads for GDBM_File 4.11 seconds 832400 bytes Time for 100 writes + 100 reads
Re: Apache::Compress - any caveats?
Ged Haywood wrote: I think because many browsers claim to accept gzip encoding and then fail to cope with it. Such as? It's second hand information - Josh had some trouble last year when we were working on the same project, and I think he eventually gave up with gzip because of it. He doesn't read the mod_perl list all the time (being a busy chap:) so I've copied him in on this and maybe he'll give us the benefit of his experience. Maybe he'll tell you I'm talking through my hat too... There was one odd browser that didn't seem to deal with gzip encoding for type text/html, it was an IE not sure 4.x or 5.x, and when set with a proxy but not really using a proxy, it would render garbage to the screen. This was well over a year ago at this point when this was seen by QA. The compression technique was the same used as Apache::Compress, where all of the data is compressed at once. Apparently, if one tries to compress in chunks instead, that will also result in problems with IE browsers. Note that it wasn't I that gave up on compression for the project, but a lack of management understanding the value of squeezing 40K of HTML down to 5K !! I would compress text/html output to netscape browsers fearlessly, and approach IE browsers more carefully. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: ApacheBench says my site is unstable?
Philip Mak wrote: Time taken for tests: 21.109 seconds Complete requests: 1000 Failed requests:22 (Connect: 0, Length: 22, Exceptions: 0) Total transferred: 196578 bytes HTML transferred: 12714 bytes Requests per second:47.37 Transfer rate: 9.31 kb/s received If ApacheBench complains about length problems, it means that the length of subsequent requests differs from the output length of the first request, so dynamic content usually screws up ab's response in this way. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: IBM patents Template Systems?
Joe Schaefer wrote: Has anyone else noticed this? http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2Sect2=HITOFFp=1u=/netahtml/search-bool.htmlr=10f=Gl=50co1=ANDd=ft00s1=HTMLOS=HTMLRS=HTML A causal reading seems to suggest that most mod_perl-based templating systems do exactly what this patent will cover: i.e. set up a non-HTML based website where templates dynamically convert non-HTML files into HTML. The patent was filed June 19, 1998: surely there must be prior art out there? As Nathan suggested, this might be more relevant to a web editor like homestead.com (online or not) than to a templating system. If it does apply to a templating system, then certainly Embperl has prior art, whereas Apache::ASP v.01 was released a week after the filing of this patent, so I am not sure how prior art would apply in the latter case. I remember at the time of writing Apache::ASP, NetObjects Fusion was out for quite a while, and definitely had templates to choose from for site building, so that might establish prior art there. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: [request] modperl mailing lists searchable archives wanted
Stas Bekman wrote: dev@@perl.apache.org - 2.5, but their search engines suck [EMAIL PROTECTED] - none [EMAIL PROTECTED] - none [EMAIL PROTECTED] - none [EMAIL PROTECTED] - 1 Hey Stas, I have the asp list getting archived at: http://www.mail-archive.com/asp%40perl.apache.org/ Thanks for keeping up on this. It would be nice to have another search archive for the asp list too. Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: What hapened to AxKit.com?
[EMAIL PROTECTED] wrote: I finally convinced some of my colleagues to look at AxKit as a replacement for Cocoon. But when we try to go to the website, it times out. An nslookup of 'www.axkit.com' and 'www.axkit.org' and 'axkit.org', etc, result in 'can't find www.axkit.com: Non-existent host/domain'. The same used to be true of take23.org, but it showed up again recently... All of this happened shortly after Sept. 11 If AxKit doesn't work out, Apache::ASP has XSLT functionality that rivals AxKit Cocoon with a dbm based cache layer... http://www.apache-asp.org/xml.html#XSLT%20Tranformations Next time I post benchmarks on the mod_perl list, you will see some XSLT performance comparisons. AxKit is definately faster than Apache::ASP by some .005 sec per request on my machine, but this may not make a difference for you. Also in benchmarks I have seen both Apache::ASP AxKit to be faster than Cocoon v1 ... I never got v2 installed. BTW, if no one else tells you on the list, the AxKit site is \ just temporarily down due to the author Matt moving recently. I don't have current status on this. --Josh
Re: segfault on start....
Derek Balling wrote: Did that. THAT's the output I get, nothing more. Make test, and the test server all check out 100% and run fine, its only when I put it in production that it takes a dump, and leaves absolutely nothing except what you see there. Lots of the segfault stuff in SUPPORT has to do with when it segfaults on a request. It's hard to attach to the running process or send the request that causes the segfault when you can't get that far. ;) Run your httpd in -X mode without the help of the apachectl start script. You can get that under gdb. -X mode runs in single process mode, and is most handy for diagnosing problems such as these. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Installation of Apache Weblogic
Azimul Haque wrote: Hi! I am wondering for installation of Apache weblogic? Could you please tell me what is the exact address for Apache web logic? What is the installation process in Windows machine? Your kind cooperation would highly appeciated This is the mailing list for mod_perl. This post is off topic, sorry. If you would like to use mod_perl for your web application needs instead of web logic, try: http://perl.apache.org If you would like to learn more about perl and its various web application environments, see this article here: http://www.perl.com/pub/a/2001/08/21/templating.html --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: site copies under the one httpd
raptor wrote: hi, I have a site, it has two copies one that is on the Dev server (dev-copy) and the other Production one. So what I want ? I want to have the Production site on my dev machine ... ( i'm arraging that the DB and all dependant stuff get copied after some time passes). But AS U KNOW I can't have two different modules with the same name under one mod_perl even if they are on different virtual-hosts, 'cause they get precompiled under the same name... Is the only solution to use differnt mod_perl processes to handle this situation ?!! This is the best way, but certainly not only way. Any change in development could kill your production web server, and you will probably be stop/starting your web server lots too, so save yourself, and others visiting your site, the grief and keep your dev prod httpd's running separately on different ports at the very least. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: FW: Apache_1.3.19/mod_perl-1.24_01/perl5.6.1 on Solaris 2.6/Sun OS 5.6
Yeo Puay Hoon wrote: /expat-lite -DNO_DL_NEEDED `../../apaci` os.c gcc -c -I../../os/unix -I../../include -DSOLARIS2=260 -DUSE_EXPAT -I../../lib /expat-lite -DNO_DL_NEEDED `../../apaci` os-inline.c rm -f libos.a ar cr libos.a os.o os-inline.o make[3]: ar: Command not found make[3]: *** [libos.a] Error 127 make[2]: *** [subdirs] Error 1 make[2]: Leaving directory `/usr/local/apache_1.3.19/src' make[1]: *** [build-std] Error 2 make[1]: Leaving directory `/usr/local/apache_1.3.19' make: *** [build] Error 2 I would make sure there is the program ar in your path. Without this you will not have much luck compiling things I bet. On my box ( 2.6 x86 ), its at /usr/ccs/bin/ prompt whereis ar ar: /usr/ccs/bin/ar /usr/include/ar.h /usr/man/man1/ar.1 /usr/man/man4/ar.4 So make sure its in your PATH like: PATH=/usr/ccs/bin:$PATH in your .bashrc or whatever other init script is run. If you change the .bashrc, you need to login again, or resource the file like: prompt source .bashrc -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: segfault on start....
Derek Balling wrote: Run your httpd in -X mode without the help of the apachectl start script. You can get that under gdb. -X mode runs in single process mode, and is most handy for diagnosing problems such as these. I guess I'm dense: # ../bin/httpd -X -f conf/httpd.conf.mod_perl Segmentation fault how is this more helpful? ;) Pretend like I'm NOT some C-code guru, and explain to me what I need to do, because it doesn't seem like doing what the docs say is helping. *chuckle* unix prompt gdb ../bin/httpd ... gdb header stuff ... (gdb) run -X -f conf/httpd.conf.mod_perl Segfault (gdb) bt !!! UGLY STACK TRACE TO FOLLOW !!! This *MIGHT* give the real gurus on the list something to work with. Its how I have debugged many a segfault in my day. This or something like it. You can also load up a core dump with gdb, but I can't remember the last time I did that, so I have no real directions here, but its probably just prompt gdb core ... (gdb) bt [ find out where it segfaulted ] --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::DBI
Markus Linke wrote: /usr/local/apache/bin: apachectl configtest Syntax error on line 1235 of /usr/local/apache/conf/httpd.conf: Can't load '/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/DBI.so' for module DBI: ld.so.1: /usr/local/apache/bin/httpd: fatal: relocation error: file /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/DBI.so: symbol main: referenced symbol not found at /usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206. at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 189 BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 189. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.6.1/Apache/DBI.pm line 4. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.6.1/Apache/DBI.pm line 4. Compilation failed in require at (eval 3) line 3. If I were in your shoes, and I saw this on my machine, I would be tempted to NOT find out how to make your software work, and instead recompile everything from scratch after cleanly backing up deleting the old software components: perl, apache, mod_perl. I really would not spend any time trying to fix this just start from scratch. If you did want to fix it, I might try reinstalling DBI, and then recompiling mod_perl, and so one, but eventually I might rebuild all the components. Also, on the off chance that this is a DSO problem, compile your mod_perl statically, not DSO. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Porting
John Reid wrote: We have an application written in Java using MVC which we would like to port to mySQL/Perl platform. We have used Struts,to create tags. Any inputs in this regards will be appreaciated. You will probably find that Struts tags can be ported nicely to Template Toolkit (http://template-toolkit.org). You might even be able to write a converter for your JSP pages. If you're interested in getting some object/relational mapping features and a basic MVC structure thrown in as well, you can check out OpenInteract (http://openinteract.org/). - Perrin Or what about Apache::ASP and XML Subs? If you do look at Apache::ASP see that it falls short for you, please let me know what issues there are as there are likely features I can add that might make your transition a better experience. Apache::ASP is being actively developed, and a major release 2.23 will soon go to CPAN. Also note that for general questions about Apache::ASP, please send them to [EMAIL PROTECTED] or subscribe with [EMAIL PROTECTED] --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP - using Apache::Session
Jindo Soul wrote: Hi! I recently made a decision to adopt Apache::ASP as the template tool for my site. The only thing I'd like to find out is whether or not Apache::ASP works with Apache::Session. I read from an online article http://perl.apache.org/features/tmpl-cmp.html that Apache::ASP can be hookied up to Apache::Session. However, I just could not find the instruction on how this can and should be done. Am I mistaken or have I missed something in the online docs? Note the Apache::ASP mailing list is now at: [EMAIL PROTECTED] Subscribe by sending an email to [EMAIL PROTECTED] Integration of Apache::Session is similar to other environments, except where you put the code. In Apache::ASP, you can put it in global.asa Script_OnStart to get run every time, then you can init the session to look like the ASP $Session. The only differences are you don't get the ASP API around $Session, like session management with garbage collection/timeouts, events, or other API calls like Lock(), Abandon(), SessionID(). Also, without using ASP session, you won't get to use SessionQueryParse cookieless sessions either. Here is some untested code that you could start with for using Apache::Session with MySQL: # in httpd.conf, turn off $Application, $Session PerlSetVar NoState 1 # in global.asa use Apache::Session::MySQL; sub Script_OnStart { # ... init mysql dbh before my $id = $Request-Cookies(SESSION_ID); tie %hash, 'Apache::Session::MySQL', $id, { Handle = $dbh, LockHandle = $dbh }; if($id ne $hash{_session_id}) { $Response-Cookies(SESSION_ID, $hash{_session_id}); } $Session = \%hash; $Server-RegisterCleanup(sub { untie (%$Session) }); } } --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Updating $r-connection-aborted before $r-print() ?
Geoffrey Young wrote: yes, it worked for me. actually, I guess I should have been clearer - this has nothing to do with $c-aborted or $r-print (well, on the outside anyway). for $c-aborted you have to wait for Apache to flush the print buffers. actually, in my tests $r-rflush didn't help things behave - only $|=1 did. Hey Geoff, for efficiency, my final code for detecting a client abort is: sub Apache::ASP::Response::IsClientConnected { ... # IsClientConnected ? Might already be disconnected for busy site, if # a user hits stop/reload my $conn = $self-{r}-connection; my $is_connected = $conn-aborted ? 0 : 1; if($is_connected) { my $fileno = $conn-fileno; if(defined $fileno) { my $s = IO::Select-new($fileno); $is_connected = $s-can_read(0) ? 0 : 1; } } where $self is the ASP object ... I looked at the IO::Select-new() and it looked pretty hairy, so I checked connection-aborted status first in case it was already set. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Using APACHE::ASP objects into a AuthenHandler
willems Luc wrote: Hello , I have a quistion abous $Session objects. Is it possible to us this objects in a custom Authentication handler. The idea is to use a ASP script to login the user and put some user info into the session object if the user is valid. After that i redirect the user 1 level deeper. In this level only users with a valid session can acces any file (this includes html,asp and other files). the idea is to do somthing like $session = Apache::ASP-Session; blablabla I have just added support for this kind of thing in my dev version Apache::ASP 2.23 This is not optimized, where the ASP object will end up getting created twice during the request, but for most this would not be an issue. If the performance hit is a problem, I will have to devise a cross handler caching mechanism for the ASP object. Here's the note from CHANGES so far: +New API for accessing ASP object information in non content handler phases: use Apache::ASP; sub My::Auth::handler { my $r = shift; my $ASP = Apache::ASP-new($r) my $Session = $ASP-Session; } In the above example, $Session would be the same $Session object created later while running the ASP script for this same request. I will send it to you separately. Also, I will send you my latest MLDBM::Sync .15 on which Apache::ASP will depend next release. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: apache/mod_perl socket bug on Win32
Avi Ben-Harush wrote: it seems that apache/mod_perl have a problem with sockets on win32. after the socket has been opened successfully (I double check to see if the socket handler is defined with fileno($socket)) the print to the socket is failing due to an invalid argument error . it seems that this bug exists for some time http://archive.davin.ottawa.on.ca/modperl/1999-02/msg00129.phtml. someone suggested that to avoid the problem the apache should use only one thread, unfortunately I can't use a one thread system. do you of any other solutions to this problem ? I'm using apache 1.3.20 for win32, mod_perl 1.25_01-dev. I would try a one threaded mod_perl system as a mod_perl backend that you ProxyPass to from a front end server. This might work out though I don't know how Win32 installation would work for this. See this link for the dual httpd setup: http://perl.apache.org/guide/scenario.html#mod_proxy I have only used mod_perl on a WinNT for development, so have not had to work through this problem before, but this is the approach I would take if I were to. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Updating $r-connection-aborted before $r-print() ?
Geoffrey Young wrote: my $fileno = $r-connection-fileno; $s = IO::Select-new($fileno); die aborted if grep { m/$fileno/ } $s-can_read(1); HTH Thanks for this. The code that I ended up using for Apache::ASP was: # IsClientConnected ? Might already be disconnected for busy site, if # a user hits stop/reload my $is_connected = 1; my $fileno = $r-connection-fileno; if(defined $fileno) { my $s = IO::Select-new($fileno); if($s-can_read(0)) { $is_connected = 0; } } The difference being the can_read(0) from can_read(1). The 1 would create an unnecessary wait of 1 second I found, whereas 0 does not, yet reports the aborted condition accurately. Thanks again! -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Template or XML?
BeerBong wrote: Of course, we know this and used this feature. The you can reference $App in all scripts includes, just like %= $App-print_something % But our crew are 3 designers and 4 programmers. Designers know nothing about $App and other things, programmers don't know about CSS and other HTML stuff. My point with mentioning the global objects was that was the starting point for building an XMLSubs infrastructure, because the XMLSubs themselves don't know more than the attributes and body data they are passed otherwise. Huh! Great improvments, as I understand ASP scripts can contains XML tags only now. It is what we need, but correct me if I wrong, there are many other solutions, which do the same more efficient and simpler. This idealogy (separate code and html) is far away from original ASP idea _embed_ code into HTML. I would approach your problem with an XMLSubs solution, which is what it was designed for. I don't know if other ways are more efficient ( benchmarks? ) or simpler. I have found the XMLSubs solution to be very powerful way to create your own custom tags for your design shop. If you can encapsulate all of your logic in your custom tags, then you can free your designers from what is going on behind the scenes, and they can get back to the business of being creative artists! The only way that Apache::ASP gets in the way of your needs, is that it ALLOWS for % % code blocks to be embedded in your templates. This is where its origins get in the way. The reason this is a problem is that people will use this if they have it to use, designers programmers, and regardless of your coding standards, it will happen... What I would do to FORCE separation of logic from templates is create a config PerlSetVar CodeBlocks 0 which would automatically render % % useless. Then you could develop your XMLSubs tag suite and the total templatting solution for your shop. I believe also you would want to set PerlSetVar XMLSubsStrictArgs 1 so that the attributes would not allow perl code so you could strictly control the environment from a programming perspective. Note that building your XMLSubs infrastructure is a significant investment, but the productivity increases that you are looking for can make it worthwhile. --Josh
Re: Template or XML?
Alexandr Efimov wrote: Hello, all! We have a 4 year experience in developing web sites for our customers. Most of these web sites must present information stored in some relational database (MySQL or Oracle), and we create a special web interface for managing the data stored in the database. We cannot use standard modules like DB::Editor, because we need to provide a simple and easy-to-use interface for end user. We used to create such interface using Apache::ASP, but that was incovenient because we could not reuse code for different projects, and it required a programmer and a usability specialist to work togather on such interface You ever look at XMLSubs in Apache::ASP? It should promote code reuse like you are going for. You just need to install your XMLSubs module in each of your projects. Also, if you decomp much of your generic application logic into some real object, you can init this object, say $App, in Script_OnStart, and have it available in all scripts just like $Server, $Session, etc. use vars qw($App $Form); sub Script_OnStart { my $dbh = DBI-connect(...); $App = My::App-new(dbh = $dbh, ...); $Form = $Request-Form; } The you can reference $App in all scripts includes, just like %= $App-print_something % since all scripts includes are compiled into the same package as global.asa. For support of the code you mentioned like: edit sql=update banned_ip set ip=? where ip=? params=ip old_ip delete sql=delete from musica.banned where banned_ip = ? params=old_ip add sql=insert into musica.banned (banned_ip) values (?) params=ip You can define PerlSetVar XMLSubsMatch edit|delete|add Then in global.asa, you can define you subs like so: # assuming edit() represents a widget db function sub edit { my($args, $html) = @_; my @params = split(/\s+/, $args-{params}); if($Form-{'edit'}) { $App-{dbh}-do($args-{sql}, undef, map { $Form-{$_} } @params); } print input type=submit name=edit value=Edit; } Because these XMLSubs don't have their own namespace you would not be able to decomp them into their own perl package, but you could put them in a perl module without a package, and then use/require/do them from global.asa to import. I only suggest this for code reuse between projects. You could also have them in a package, and them import the functions, but you might have to reference vars like $main::App, which you would have to init in global.asa. Its very easy to not use good coding practice with Apache::ASP, but you can use like any other full embedded perl environment for good code reuse. One more thing ... XMLSubs are limited to parsing out only the XML attributes body, so things like FOREACH are harder to implement, however a recent feature makes it possible, as you can now $Response-Include() scripts data on the fly, not just file names, so: XMLSubs FOREACH|rows|row|inp rows name=myrows action=fetch sql=select banned_ip from banned order by banned_ip ... FOREACH c=myrows row inp name=ip type=text value=c.banned_ip size=15 inp name=old_ip type=hidden value=c.banned_ip /row /FOREACH sub rows { my $args = shift; my @rows; my $sth = $App-{dbh}-prepare($args-{sql}); while(my $row = $sth-fetchrow_hashref) { push(@rows, $row); } $App-{rows}{$args-{name}} = $rows; } sub FOREACH { my($args, $script) = @_; my $rows = $App-{rows}{$args-{c}}; for my $row (@$rows) { $App-{currrow} = $row; $Response-Include(\$script); } } sub inp { my $args = shift; my $row = $App-{currrow}; print input name=$args-{name} value=$row-{$args-{name}} ...; } Just as example of how you might achieve what you are going for with Apache::ASP. I know you used it before, but the application environment has grown considerably over time, now in its 4th year of development. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Updating $r-connection-aborted before $r-print() ?
Hey, In my own experience it seems that I can only get $r-connection-aborted updated if I first do a $r-print(). Is there any way to get aborted to update without $r-print? The scenario is that developer would like to know the aborted status before any part of the script runs, where browser requests might queue up on a busy server for 3+ seconds before the scripts run, hit the STOP button reload. Unfortunately, to have to print() or send headers before an aborted check means that the headers have already been sent out, which is limiting. Thanks, Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: URI munging and Referer headers
Geoffrey Young wrote: hi mungers... it there a more reliable way to not have your session id's show up in Referer headers than using a refresh tag? I've played around with various redirect methods, but both MSIE5 and Netscape4.7 hold on to the Referer from the original page and ignore the 302 page. seems like meta refresh is the only way to be sure. looking for expert opinions :) I did some experimental work like this back when I first implemented the cookiless session stuff for Apache::ASP, and I found the same thing, that the meta refresh was really the only way to go with redirecting offsite. This would probably be the same for a javascript redirect too ( untested ). When it comes to session ids in URIs I also wonder about cases like search engines indexing pages with them, and then someone coming along later and using an old session id, this really makes it important to garbage collect old sessions so that this session id reuse doesn't hurt. Most major search engines have a very large index refresh window such that even old sessions that expire in a day should be enough protection. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: perlmagick and leaking memory
Jon Molin wrote: Hi list, I've done a scripts that builds an calender and colours the days with different colours depending on the status of the day. I've got 6 colours and one to just fill out so the month starts with the correct day, ie i've got 6 * 31 + 1 = 187 images and each is about 70 bytes so a calender is 6 times 7 of these little sqaures, about 3k. Now this little script handling this tiny amount of data runs amok and grows and grows untill i restart apache brutaly, I guess I've done something very wrong but I can't figure out what, nor can I find any info about this. Here's what the program looks like: Generally, I am not surprised when finding memory leaks in XYZ module. The code in the email looked fine, so I would suspect Image::Magick having the leak. To prove this better, you might take the code out of the mod_perl request, and run it through a test of 1000 iterations in a command line script, and report the problem to the author of Image::Magick. So, without waiting for a Image::Magick fix, you can make memory leaks less painful by setting MaxRequestPerChild lower, say to 100 or by using a solution like Apache::SizeLimit to kill a child process when it uses too much RAM ( unshared RAM on Linux too ) --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Connection Reset on Mandrake Linux 8.0 / Apache 1.3.20 / ModPerl 1.26
Tom Allen wrote: ... Location /modperl AllowOverride None Options ExecCGI Indexes SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader Off /Location It appears to work ( I get a webpage that says Hello!), in a Mozilla browser, but httperf shows a connection reset instead of a success message, the same goes for lynx (Alert!: Unexpected network read error; connection aborted.). The ScriptAlias version works fine. The two scripts can be seen online at Regular CGI version : http://www.nonserviam.net/perl/index.pl ModPerl version: http://www.nonserviam.net/modperl/index.pl When I test it, I get a 404 Not Found, which could explain it. But even when it is found, you might try setting PerlSendHeader On, as it may not send a header otherwise. Or you could try explicitly calling Apache-send_http_header in your mod_perl version. --Josh ]# lwp-request -eS http://www.nonserviam.net/modperl/index.pl GET http://www.nonserviam.net/modperl/index.pl -- 404 Not Found Connection: close Date: Sat, 25 Aug 2001 23:58:43 GMT Server: Apache/1.3.20 (Unix) mod_perl/1.26 PHP/4.0.6 Content-Type: text/html Client-Date: Sun, 26 Aug 2001 00:00:09 GMT Client-Peer: 65.34.152.103:80 Title: NonServiam! X-Powered-By: PHP/4.0.6 HTML HEADTITLEAn Error Occurred/TITLE/HEAD BODY H1An Error Occurred/h1 404 Not Found /BODY /HTML
Re: ODBC for Apache
Castellon, Francisco wrote: Hi I am running on Windows98SE, Apache 1.20, mod_perl 1.25, php 4.0.6, and have the latest Apache::ASP installed and have Activestate's Perl installed (build 626). I want to be able to access, Oracle, SQL and MSAccess databases as well as a couple of other Databases that support ODBC. I want to access these DBs from my apache server. What do i need?? DBD::ODBC is your ticket, running under DBI http://dbi.symbolstone.org/ You can probably install DBD::ODBC for Activestate perl with the ppm installer, as they will likely already have compiled it for you. Apache::DBI is installed with CPAN. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Increasing Shared Memory
Bob Foster wrote: Hi, I'm using Stas Bekman's excellent Apache::VMonitor module to help me decrease my mod_perl child process memory usage. I was working on preloading all of my perl modules and scripts in a startup.pl script when I noticed that the amount of shared memory seemed very low. Immediately after I make an Oracle database connection, the child jumps from a size of 3.6M (2.4M shared) to 17.4M (3.4M shared). The child process slowly grows to 22.2M (3.4M shared). The loaded libs Sizes total 13.6M. Shouldn't the libs load into shared memory? If so, how? Make sure to use DBD::Oracle in your startup.pl or do PerlModule DBD::Oracle ... that should load up some Oracle libs in the parent. Also, you *might* try doing a connect or even an invalid connect to Oracle, which might grab some extra libs that it only loads at runtime. If you do a connect in the parent httpd to Oracle, make sure that Apache::DBI doesn't cache it later for the children, which is why I was suggesting doing an invalid connect with user/pass like BADBAD/BADBAD --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Increasing Shared Memory
Bob Foster wrote: Thank you very much, Joshua. I have made some progress and am now seeing 15.8M shared out of 16.7M on the parent. I believe that the problem was that I was doing a graceful restart which wasn't restarting the parent process. Now I have a different problem. When I initially start apache, everything is OK, but when the child processes die (due to MaxRequestsPerChild or me killing them) , the new child doesn't have a database connection and I'm getting Internal Server Error. I suspect I can sort that mess out after a bit more troubleshooting. Cool, but each child will need its own database connection, and last time I worked with Oracle like this, it was a minimum 3M unshared just for the Oracle connection. So just make sure that each child httpd is doing its own DBI-connect() and not reusing a handle created in the parent httpd or you will have problems. Also, more a side note, I have found that you have to fully restart apache, not just a graceful, if either the Oracle server is restarted or the TNS listener is restarted. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: [ANNOUNCE] RoboWeb 1.0b, web application test suite generator
Ilya Martynov wrote: We should investigate how these 2 projects can work together when I'm done so that RoboWeb 'recorded' sessions can create WWW::Automate methods that utilise the structure of the page. The benefits of doing this are: 1- Resultant scripts are easier to interpret 2- Scripting apps that vary their form field names works. FYI, during my Apache::ASP presentation today at the OSS conference in San Diego, I recommended both HTTP::WebTest and RoboWeb for regression testing a site. Someone from the audience asked where they could find pricing information on these tools :) --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: [ASP] FileUploadMax -- FileMaxUpload
raptor wrote: hi, FileUploadMax wrongly stated in ASP docs, U should use : PerlSetVar FileMaxUpload xxx instead. One more thing, does someone knows a way to capture the error, if the user tries to upload bigger file than accepted. So I can inform him. Is it possible to set CGI::POST_MAX on a per request i.e. dynamicly as I read in the dosc ASP.pm set this value every time before it calls CGI to handle the request... I posted my answer to this to the [EMAIL PROTECTED] list. -- Josh
[ANNOUNCE] Hello World Benchmarks, 10 Minute Run
Hey, It seemed that running the hello world benchmarks last time for only 60 seconds had problems with reproducibility, especially with mod_caucho. So here's some numbers for ~ 10 minute run. Its actually something like 20 benchmarks run for 30 seconds a piece, and the results summed together. The source code for these benchmarks is available at: http://www.chamas.com/bench/hello.tar.gz There's a new switch, -prime, which runs a short benchmark first and throws away the results, to get all the environments to cache ahead of time. This is of limited effect on many of the mod_perl environments, since the web server is restarted every 30 seconds. --Josh DISCLAIMER: If you would like to know what the benchmarks are really doing, download the source from above, and run them for yourself! Please look at the secs/Hit column too to understand relative diffs in speed. GROUPING: I messed up the grouping, now its just alpha sort, so if you want to compare say AxKit XSLT with ASP XSLT, you'll have to do a little extra work. STATIC HTML: seems slower than mod_perl on my dual proc RedHat 6.2 Probably faster on your single proc box if you have one. mod_caucho/resin/java: Seems to slow down the longer it runs for, so these numbers are quite different than when a 30 second benchmark is run. iterations: The 600 seconds test was broken up into 20 30 second tests and the results summed. For the next release of benchmark, I'd like to not restart the web server every 30 seconds for some better steady-state numbers. In the process I'll likely reduce MaxRequests from 10,000 to 1,000 so that apps that have mem leaks won't be killed by swapping during the test. ./bench.pl -version -prime -time=600 Test Name Test File Hits/sec # of Hits Time(sec) secs/Hit Bytes/Hit - - - - - - - Apache::ASP v2.19 hello.asp 379.0 222987 588.36 0.002639 242 Apache::ASP v2.19 2000 h2000.asp 225.5 132712 588.54 0.004435 28998 Apache::ASP v2.19 XSLT Hellohxslt.xml 219.0 128843 588.39 0.004567 280 Apache::Dispatch v0.09 handler hello/worl 594.8 349800 588.08 0.001681 197 Apache::Registry v2.01 2000 mod_per h2000.reg 341.2 200718 588.32 0.002931 28179 Apache::Registry v2.01 CGI Raw hello_raw. 681.0 400470 588.10 0.001469 52 Apache::Registry v2.01 CGI.pm hello.cgi 453.2 266590 588.20 0.002206 217 Apache::SSI v2.16 hello.shtm 544.2 320087 588.15 0.001837 200 Apache::ePerl hello.eper 345.7 203399 588.42 0.002893 218 AxKit v1.4 XSLT Hello hxslt.xml 292.0 171899 588.63 0.003424 397 HTML static hello.html 704.9 414465 588.00 0.001419 312 HTML::Embperl v1.3.0hello.epl 467.1 274769 588.19 0.002141 221 HTML::Embperl v1.3.0 2000 h2000.epl 111.6 65652 588.43 0.008963 28841 HTML::Mason v1.03 hello.mas 370.5 217967 588.33 0.002699 198 HTML::Mason v1.03 2000 h2000.mas83.6 49176 588.20 0.011961 28799 HTML::Template v2.3 hello.htmp 539.2 317344 588.60 0.001855 199 HTML::Template v2.3 2000h2000.htmp 98.2 57791 588.28 0.010179 29152 Template v2.04 Toolkit hello.tt465.7 273928 588.19 0.002147 199 Template v2.04 Toolkit 2000 h2000.tt 52.7 30995 588.37 0.018983 28889 mod_caucho JSP hello.jsp 118.0 70156 594.49 0.008474 231 mod_caucho JSP 2000 h2000.jsp75.7 44739 591.15 0.013213 28965 mod_cgi CGI Raw hello_raw. 154.1 90655 588.11 0.006487 197 mod_cgi CGI.pm hello.cgi10.7 6326 591.81 0.093552 217 mod_include SSI hello.shtm 288.5 171036 592.83 0.003466 199 mod_perl handlerhello.benc 822.7 483808 588.06 0.001215 197 mod_php PHP hello.php 658.5 387271 588.13 0.001519 226 mod_php PHP 2000h2000.php 256.0 150596 588.37 0.003907 28866 mod_speedycgi hello.cgi 134.6 79428 590.32 0.007432 217 Apache Server Header Tokens --- (Unix) Apache/1.3.20 AxKit/1.4 OpenSSL/0.9.6a PHP/4.0.3pl1 Resin/1.2.1 mod_perl/1.25
Re: [ANNOUNCE] Hello World Benchmarks, updated
Joshua Chamas wrote: mod_caucho used to look a lot faster, but my testing methodology changed. I used to take the results of the second benchmark run, and publish those, but this time only ran the -test for minor caching after starting resin ( tomcat ). So, I'm guessing that mod_caucho compiles aggresively in the beginning, killing performance for a dry run ( even 60 seconds! ). To improve the numbers for mod_caucho using this methodology might require and longer test cycle than 60 seconds. Perrin convinced me that getting steady-state numbers was important enough to ignore the compile penalties for such apps as mod_caucho which does runtime java compilation. To this end, I have added a -prime switch to the bench.pl which will run all the tests for a couple seconds, before doing the real benchmark where the results are scored. This allows any system caching to be done before the numbers start counting. However, despite the new -prime setting, I was still not getting reproducable resin/mod_caucho results, varying from 80 hits/sec one run to 280 hits/sec the next for the Hello World 2000 JSP benchmark. What I found is that in order for the mod_caucho results to be reproducable to 5% variation from one run to the next, I need to run the benchmark for 10 minutes! At 3-5 minutes, there was a 10-15% variation, which seems too high. Benchmarks 120 seconds, which were my benchmarks from before seem next to meaningless now. Here's some #s to show what I mean: Test Name Test File Hits/sec # of Hits Time(sec) secs/Hit Bytes/Hit - - - - - - - mod_caucho JSP 2000 h2000.jsp75.4 9069 120.33 0.013269 28965 mod_caucho JSP 2000 h2000.jsp 249.4 2505 10.05 0.004010 28965 mod_caucho JSP 2000 h2000.jsp 274.5 4118 15.00 0.003643 28965 mod_caucho JSP 2000 h2000.jsp 191.9 5760 30.01 0.005211 28965 mod_caucho JSP 2000 h2000.jsp 133.7 8022 60.01 0.007481 28965 mod_caucho JSP 2000 h2000.jsp 104.8 12591 120.10 0.009539 28965 mod_caucho JSP 2000 h2000.jsp96.0 11581 120.66 0.010419 28965 mod_caucho JSP 2000 h2000.jsp 113.6 19937 175.51 0.008803 28965 mod_caucho JSP 2000 h2000.jsp 103.9 18283 175.98 0.009625 28965 mod_caucho JSP 2000 h2000.jsp91.4 27146 297.16 0.010947 28965 mod_caucho JSP 2000 h2000.jsp 105.0 31335 298.57 0.009528 28965 mod_caucho JSP 2000 h2000.jsp91.4 27210 297.76 0.010943 28965 mod_caucho JSP 2000 h2000.jsp88.8 52440 590.56 0.011262 28965 mod_caucho JSP 2000 h2000.jsp93.5 55129 589.64 0.010696 28965 The numbers seem to indicate that the resin/mod_caucho java environment gets slow the longer tests are run for, but also that the results stabilize the longer tests are run for. As a result, when I post benchmarks, it will be with 10 minute tests run in the future. The idea here is stable, repeatable benchmarks we can use. Here were the 60 second #s I had posted before just to show how far off the mod_caucho #s were. Test Name Test File Hits/sec Total Hits Total Time sec/Hits Bytes/Hit -- -- -- -- -- -- Apache::ASP v2.19 2000 h2000.asp 226.2 13578 hits 60.02 sec 0.004421 28998 byte Apache::Registry v2.01 2000 mod_per h2000.reg 339.5 20376 hits 60.02 sec 0.002945 28179 byte HTML::Embperl v1.3.0 2000 h2000.epl 111.3 6677 hits 60.00 sec 0.008987 28841 byte HTML::Mason v1.03 2000 h2000.mas83.5 5014 hits 60.02 sec 0.011969 28799 byte HTML::Template v2.3 2000h2000.htmp 98.2 5892 hits 60.00 sec 0.010183 29152 byte mod_caucho JSP 2000 h2000.jsp76.6 4595 hits 60.01 sec 0.013060 28965 byte --Josh
Re: [ANNOUNCE] Hello World Benchmarks, updated
Perrin Harkins wrote: mod_caucho used to look a lot faster, but my testing methodology changed. I used to take the results of the second benchmark run, and publish those, but this time only ran the -test for minor caching after starting resin ( tomcat ). So, I'm guessing that mod_caucho compiles aggresively in the beginning, killing performance for a dry run ( even 60 seconds! ). To improve the numbers for mod_caucho using this methodology might require and longer test cycle than 60 seconds. Ouch! I would think it's worth doing one full run to prime each system. Or do you feel a need to include the initial compilation time? I do feel that compile time matters, but really with 60 seconds and high MaxRequestsPerChild, these systems are getting plenty of compiling caching., these are thousands of requests we are talking about, what if we had lower MaxRequests, or big sites with lots of templates ... if we wanted to do away with compile time entirely, we'd make sure that each system got to precompile all its templates like Apache::RegistryLoader, Apache::ASP-Loader() Embperl's Execute() in the parent httpd. Gerald suggested this before I think it could be good, but for two reasons: compile time is a very real problem for some types of apps like large web sites, and there is an increased burden on optimizing each benchmark, which implies an expertise in the development environment that many users may not have normally. I have been trying for more out of box benchmarks, and not highly optimized benchmarks, using mostly the shipping config for a system. I have thought about having lower MaxClients as an option to the bench to help test compile times, but this doesn't affect the java engines which effectively have their own backend web servers running, like mod_proxy/mod_perl dual httpds. People have suggested before ( you? ) to do two runs, and average the results, and I think that this is a fair approach, and might be better than just doubling the test time because the systems might interact, better yet, do them in one order, and then reverse them, to average out sequential interactions of the tests on a system ( ??? ) --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Using mod_perl handlers for max speed?
Philip Mak wrote: In the recent Hello World 2000 benchmark posted by Joshua Chamas, mod_perl handler was shown to be even faster than static HTML (at least for running hello world), and twice as fast as using Apache::Registry to run a perl script. Does this mean that if there's a heavily used script on my system that needs to be VERY fast, then it may be worth making it into a mod_perl handler? What are the caveats of using mod_perl handlers instead of normal scripts? Its hard to explain, but try not to focus on the Hits/sec, instead look at the sec/Hits. Notice that the difference between Registry CGI Raw and mod_perl handler is only ~ .00025 seconds. Test Name Test File Hits/sec Total Hits Total Time sec/Hits Bytes/Hit -- -- -- -- -- -- Apache::Registry v2.01 CGI Raw hello_raw. 669.9 40196 hits 60.00 sec 0.001493 52 bytes mod_perl handlerhello.benc 808.4 48522 hits 60.02 sec 0.001237 197 bytes You could easily use that much time with a half page of perl code for your application depending on what its doing, especially if you are doing some heavy lifting like writing to a file, or talking to a database. Now if all you want to do is send a Location: header, and have apache write to the access_log, then you might want to start rewriting some of your scripts as mod_perl handlers. Here's another way to look at Hits/sec as being bad to focus on. Let's say you have something that is 1000/sec and something that is 2000/sec, that's only .0005 different. Most of the time that .0005 is negligible compared to the time you will spend in the executing part of the application, which lets say is .01 in execution time, now the overall execution time is .0110 and .0105 which is 91/sec vs. 95/sec respectively. So what looked like something to be twice as fast is now only 4% faster. But if you write some little fast code, then it can make all the difference in the world. The reason I like Hello World, is that it lets me know the fastest I can go in that app, but there's no guarantees I'll get there. :) --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: [ANNOUNCE] Hello World Benchmarks, updated
Perrin Harkins wrote: I do feel that compile time matters, but really with 60 seconds and high MaxRequestsPerChild, these systems are getting plenty of compiling caching. The thing is, if mod_caucho takes 5 seconds the first time it hits each template, but is the fastest afterwards, these numbers don't give a very accurate picture of that. Most people expect a hit on the first access. I get it, but I don't like it... why should an app get to spend ( hypothetically ) 60 seconds compiling a template into highly optimized assembly at runtime, and not have to show this cost in the benchmark. I'd be willing to run a test for longer, or run it multiple times, but to entirely throw out the compilation phase results just seems wrong to me. I'd like to see some middle ground here. No need for anything that fancy. I'd say just run the test once as a primer and throw away the results, like you were doing before. It could be for 10 seconds instead of 60. Another reason not to throw out the results is that it represents a legitimate web request as part of the apps life cycle. There might be some user sitting at the end of that 5 second delay. But then if we talk about throwing out highs lows this starts to sound almost scientific. Like run 10 time slices, throw out the highest lowest times? I wouldn't worry about them interacting so much, but I did suggest running multiple times and averaging. I think it helps smooth out random bad runs, which do happen now and then. Any numbers on the new Apache::ASP CGI mode? Horrid. Won't set up a benchmark yet, but its something like 3 hits/sec on my system compared with mod_cgi CGI.pm which is 11 hits/sec. ASP won't be optimized for mod_cgi type execution any time soon, which would require not loading in all the code per request which it does now for best mod_perl use. --Josh
[ANNOUNCE] Apache::ASP v2.19
Hey, The latest release of Apache::ASP, v2.19, is out. You can get it in your local CPAN or here: http://www.perl.com/CPAN-local/modules/by-module/Apache/ The big development in the module is a standalone CGI mode that works without mod_perl, at least on Linux where I tested it. The rest are tweaks and documentation updates. The CHANGES are below. Apache::ASP provides an Active Server Pages port to the Apache Web Server with Perl scripting only, and enables developing of dynamic web applications with session management and embedded perl code. There are also many powerful extensions, including XML taglibs, XSLT rendering, and new events not originally part of the ASP API! Regards, Josh =item $VERSION = 2.19; $DATE=7/10/2001; +update docs in various parts +added ./make_httpd/build_httpds.sh scripts for quick builds of apache + mod_perl + mod_ssl ++plain CGI mode available for ASP execution. cgi/asp script can now be used to execute ASP scripts in CGI mode. See CGI perldoc section for more info. The examples in ./site/eg have been set up to run in cgi mode if desired. Configuration in CGI section only tested for Apache on Linux. -Fixed some faulty or out of date docs in XML/XSLT section. +added t/server_mail.t test for $Server-Mail(), requires Net::SMTP to be configured properly to succeed. +Net::SMTP debugging not enabled by Debug 1,2,3 configs, not only when system debugging is set with Debug -1,-2,-3 However, a Debug param passed to $Server-Mail() will sucessfully override the Debug -1,-2,-3 setting even when its Debug = 0 -Check for undef values during stats for inline includes so we don't trigger unintialized warnings +Documented ';' may separate many directories in the IncludesDir setting for creating a more flexible includes search path.
[ANNOUNCE] Hello World Benchmarks, updated
Hey, The latest Hello World benchmarks at available at: http://www.chamas.com/bench/hello.tar.gz To reproduce the BELOW results on your platform, for whatever tests are available, run: ./bench.pl -test ./bench.pl -version -time=60 --Josh DISCLAIMER: these benchmarks test only what they test for, and I try to make no assertions about the fitness of any system for your needs. They are open source, feel free to critique the tests as you like, and provide constructive feedback. CHANGES: New HTML::Template 2000 test. My system is newly built with apache 1.3.20, mod_perl 1.25. NOTES: mod_perl The mod_perl environments are starting to look faster than PHP. Maybe something in the default mod_perl 1.25 gave a performance boost? mod_caucho used to look a lot faster, but my testing methodology changed. I used to take the results of the second benchmark run, and publish those, but this time only ran the -test for minor caching after starting resin ( tomcat ). So, I'm guessing that mod_caucho compiles aggresively in the beginning, killing performance for a dry run ( even 60 seconds! ). To improve the numbers for mod_caucho using this methodology might require and longer test cycle than 60 seconds. HTML::Embperl 2.0 series is much faster ( than PHP ASP too), but 1.3.0 is stable, installable from CPAN, so I run that. HTML::Mason 1.0 version used to be much faster on 2000 benchmark mod_jserv Why is the hello bench slower than the 2000 bench? I don't know. It may be a funny caching strategy. It may be the JVMs were cleaning up from the 2000 test during the hello test. Speculation only, as I don't know much about java. HTML static for the first time, looks slower on my system than mod_perl. It may be that the default 1.3.20 apache install/config does more work on the headers. Also this is a dual proc system which has slowed down the HTML static test before, relative to single CPU systems. Test Name Test File Hits/sec Total Hits Total Time sec/Hits Bytes/Hit -- -- -- -- -- -- Apache::ASP v2.19 2000 h2000.asp 226.2 13578 hits 60.02 sec 0.004421 28998 byte Apache::Registry v2.01 2000 mod_per h2000.reg 339.5 20376 hits 60.02 sec 0.002945 28179 byte HTML::Embperl v1.3.0 2000 h2000.epl 111.3 6677 hits 60.00 sec 0.008987 28841 byte HTML::Mason v1.03 2000 h2000.mas83.5 5014 hits 60.02 sec 0.011969 28799 byte HTML::Template v2.3 2000h2000.htmp 98.2 5892 hits 60.00 sec 0.010183 29152 byte mod_caucho JSP 2000 h2000.jsp76.6 4595 hits 60.01 sec 0.013060 28965 byte mod_jserv JSP 2000 h2000.jsp 150.0 9002 hits 60.02 sec 0.006667 29408 byte mod_php PHP 2000h2000.php 228.4 13705 hits 60.01 sec 0.004379 28866 byte Template v2.04 Toolkit 2000 h2000.tt 52.9 3176 hits 60.02 sec 0.018900 28889 byte Apache::ASP v2.19 hello.asp 378.3 22706 hits 60.02 sec 0.002643 242 bytes Apache::Dispatch v0.09 handler hello/worl 587.6 35259 hits 60.01 sec 0.001702 197 bytes Apache::ePerl hello.eper 345.5 20742 hits 60.03 sec 0.002894 218 bytes Apache::Registry v2.01 CGI Raw hello_raw. 669.9 40196 hits 60.00 sec 0.001493 52 bytes Apache::Registry v2.01 CGI.pm hello.cgi 448.6 26924 hits 60.02 sec 0.002229 217 bytes Apache::SSI v2.16 hello.shtm 533.8 32029 hits 60.00 sec 0.001873 200 bytes HTML static hello.html 768.2 46120 hits 60.04 sec 0.001302 312 bytes HTML::Embperl v1.3.0hello.epl 459.8 27595 hits 60.01 sec 0.002175 221 bytes HTML::Mason v1.03 hello.mas 373.3 22406 hits 60.02 sec 0.002679 198 bytes HTML::Template v2.3 hello.htmp 535.9 32165 hits 60.02 sec 0.001866 199 bytes mod_caucho JSP hello.jsp88.1 5321 hits 60.37 sec 0.011345 231 bytes mod_cgi CGI Raw hello_raw. 153.5 9210 hits 60.00 sec 0.006515 197 bytes mod_cgi CGI.pm hello.cgi11.0 662 hits 60.02 sec 0.090660 217 bytes mod_include SSI hello.shtm 223.2 13396 hits 60.03 sec 0.004481 199 bytes mod_jserv JSP hello.jsp53.5 3223 hits 60.29 sec 0.018706 358 bytes mod_perl handlerhello.benc 808.4 48522 hits 60.02 sec 0.001237 197 bytes mod_php PHP hello.php 665.9 39954 hits 60.00 sec 0.001502 226 bytes mod_speedycgi hello.cgi
Re: !!!reevaluating part of the module
raptor wrote: hi, What I want is access from module to executed-at-the-moment script namespace i.e. the module Utils.pm : $abc.asp::buffer .= 'hello.'; PS. It seems to work only if into the script I'm clearing $Utils::buffer at the begining of the script, but this is exactly what I don't want to do... want this to be done from outside... code reuse i say :). It doesn't matter too much to me where is the $buffer variable in Utils or in the script name-space, I just don't want to clear it out manualy every time in the script... It looks like you are using ASP, did you know that $Response-Write()/print() has its own buffering if you have BufferingOn set ? If you used print() by itself, then you might have the most flexibility if you are looking at porting issues. To answer your question specifically, you can do a Apache-register_cleanup(sub { $Utils::buffer = '' } ); or the same with ASP $Server-RegisterCleanup()... or you could do this in ASP global.asa Script_OnStart too, but you have to do it at some point. You might also have some function called Utils-init_buffer() which you could call to do this, and declare buffer as a my() in Utils so no other package could possibly access it. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: ASP.pm and script %main (name-table) !?
ivan wrote: hi, How can I access the current script name-table from module. I'm currently using : $main::XXX = 123; Then in the script : print $XXX; but this access the ASP %main not the script %main There is an Apache::ASP mailing list for discussing these things, which you can subscribe to at [EMAIL PROTECTED] ... Is there a way to access script main package and pull data there I'm working with ASP.pm-mod_perl If you defined globals in global.asa, or initialize in Script_OnStart, then it will be seen in your ASP scripts, otherwise in your ASP script you could access $XXX the same way you defined it: print $main::XXX --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: ASP.pm and multipart/form .. error
ivan wrote: hi there , I encoutred a problem with ASP.pm (ver.2.17) and multipart form what is happening is that when I try to use file fields I get something like this into the log [Mon Jul 9 23:20:22 2001] [error] [client 192.168.0.5] Invalid method in request -7d11b8668d0668 [Mon Jul 9 23:20:41 2001] [error] [client 192.168.0.5] Invalid method in request -7d13c1268d0668 [Mon Jul 9 23:21:41 2001] [error] [client 192.168.0.2] Invalid method in request -7d17811a20 if the form is normal (w/o enctype=multipart/form-data ) I'm getting normally data into $Request.. nothing is crashing just I'm getting nothing into $Request collection... Can you get the ./site/eg/file_upload.asp example working from the distribution? If so, see what's different about your script. I believe I'm running the same Apache + modperl now too, and I have never seen the problem you report, Apache 1.3.20, mod_perl 1.25 BTW, from the error, it doesn't look like it has to do with Apache::ASP. Maybe someone from the modperl list will give you some better info specific to modperl. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: The latest templating system: PSP in DDJ
Perrin Harkins wrote: on 7/7/01 9:30 PM, Ron Pero at [EMAIL PROTECTED] wrote: Just received my issue of Dr. Dobbs Journal today, and one of the articles is A Tiny Perl Server Pages Engine. Pretty nifty. Read about it here: http://www.ddj.com/articles/2001/0108/0108g/0108g.htm Here is an excerpt: PSP is modeled after JSP. It is neither an ASP nor a JSP port. PSP includes many JSP-like features and, most importantly, custom tag support. The latter gives you the ability to develop custom tag modules to encapsulate complex server-side behaviors and business rules into simple XML-like elements that content developers can use. PSP shares the same basic elements with JSP... Good grief! This sounds exactly like Apache::ASP with its XMLSubs feature. I give up. All Andy Yuen, author of PSP, had to do was ask that Apache::ASP get ported to run under old school CGI... I already have it mostly working, just never had incentive to finish the job. Maybe I'll finish that off now that I've seen lack of ASP's CGI support posted in an article :) --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Persistant data accross processes
Rodney Broom wrote: Hi all, I'd like a way to store complex data structures across Apache processes. I've looked at Apache::DBI for an example: my tests say that he has to create a new dbh for every process. I've looked at IPC::Shareable, but it has to copy data. Meaning that I can only have a certain amount of complexity to my data structures. I you like MLDBM, I created MLDBM::Sync for the purpose of using in Apache like environments. MLDBM::Sync creates a file locking wrapper around underlying dbms like DB_File, GDBM_File, or SDBM_File. Try the bench/bench_sync.pl on your platform for some comparison numbers. Below are the numbers I get on my platform, Linux PIII-450x2 --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 === INSERT OF 50 BYTE RECORDS === Time for 100 writes + 100 reads for SDBM_File 0.15 seconds 12288 bytes Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 0.17 seconds 12288 bytes Time for 100 writes + 100 reads for GDBM_File 3.30 seconds 18066 bytes Time for 100 writes + 100 reads for DB_File4.32 seconds 20480 bytes === INSERT OF 500 BYTE RECORDS === Time for 100 writes + 100 reads for SDBM_File 0.18 seconds 771072 bytes Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 0.58 seconds 110592 bytes Time for 100 writes + 100 reads for GDBM_File 3.42 seconds 63472 bytes Time for 100 writes + 100 reads for DB_File4.32 seconds 81920 bytes === INSERT OF 5000 BYTE RECORDS === (skipping test for SDBM_File 1024 byte limit) Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 1.39 seconds 1850368 bytes Time for 100 writes + 100 reads for GDBM_File 4.63 seconds 832400 bytes Time for 100 writes + 100 reads for DB_File5.73 seconds 839680 bytes === INSERT OF 2 BYTE RECORDS === (skipping test for SDBM_File 1024 byte limit) Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 4.83 seconds 8304640 bytes Time for 100 writes + 100 reads for GDBM_File 4.65 seconds 2063912 bytes Time for 100 writes + 100 reads for DB_File6.48 seconds 2068480 bytes === INSERT OF 5 BYTE RECORDS === (skipping test for SDBM_File 1024 byte limit) Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File12.86 seconds 16192512 bytes Time for 100 writes + 100 reads for GDBM_File 5.68 seconds 5337944 bytes Time for 100 writes + 100 reads for DB_File6.87 seconds 5345280 bytes
Re: ModPerl package Q
Purcell, Scott wrote: Hello, Well, this is the last time I am going to bring this up. I am on Apache NT, and I have the following .pm file that I believe I localized everything in order to create a socket. The code below does work. But it never makes a new socket. As you can see I print out the IO::Socket::GLOB and it shows the same 'reference' 10xff036c each time through. I realize this is because I am not closing and undef the $sock. (see the commented close and undef towards the end). But this works. Except if I shut down the machine I am calling the socket on. Then it dies and never comes back unless I reboot apache. Not a good work position to get a web site into. Set in httpd.conf ThreadsPerChild 1 This problem should go away. Its a bug I ran into for the first time a few years back, and seems to have to do with any network sockets that you might open. See http:[EMAIL PROTECTED] for my original post on this, showing our similar plights! --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Long application.Session timeouted.
Landin Nikolay wrote: Hi, all I have a problem. I am using Apache::ASP module. There is a new Apache::ASP mailing list. You can subscribe to it at [EMAIL PROTECTED] When I try to do a long process - the client page write Page not found after some period. How can I to tell client, that server application is still working? If you really need to keep the client busy, then try a $Response-Write(\n); $Response-Flush; The web browser just needs to see something from time to time. May be - I must just change some Session variables? No, this is all server side. If its a long job, like a big SQL command being executed then you might have to take a different approach because your process will lock waiting for the SQL command execute to return. In this case you might try forking a job into the background and waiting for its results. You might also try something like a meta refresh on itself, and keep checking for whether the job is done. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
[ANNOUNCE] Apache::ASP v2.17
Hey, Apache::ASP v2.17 is in your local CPAN or http://www.perl.com/CPAN-local/modules/by-module/Apache/ Mostly this is a bug fix release, with a debugging enhancement, and a bundled emacs mmm-mode. The web site for Apache::ASP is http://www.apache-asp.org and the CHANGES are listed below. Apache::ASP provides an Active Server Pages port to the Apache Web Server with Perl scripting only, and enables developing of dynamic web applications with session management and embedded perl code. There are also many powerful extensions, including XML taglibs, XSLT rendering, and new events not originally part of the ASP API! -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 + = improvement; - = bug fix =item $VERSION = 2.17; $DATE=6/17/2001; +Added ASP perl mmm-mode subclass and configuration in editors/mmm-asp-perl.el file for better emacs support. Updated SYNTAX/Editors documentation. +Better debugging error message for Debug 2 or 3 settings for global.asa errors. Limit debug output for lines preceding rendered script. -In old inline include mode, there should no longer be the error need id for includes when using $Response-Include() ... if DynamicIncludes were enabled, this problem would not have likely occured anyway. DynamicIncludes are preferrable to use so that compiled includes can be shared between scripts. This bug was likely introduced in version 2.11. -Removed logging from $Response-BinaryWrite() in regular debug mode 1 or 2. Logging still enabled in system Debug mode, -1 or -2 -Removed other extra system debugging call that is really not necessary.
Hello World Benchmark Suite, mod_cgi update
Doug asked that I add some plain 'ol mod_cgi tests to compare mod_perl to, so here you go! hello]# ./bench.pl -time 10 CGI Test Name Test File Hits/sec Total Hits Total Time sec/Hits Bytes/Hit -- -- -- -- -- -- Apache::Registry CGI Rawhello_raw. 591.6 5929 hits 10.02 sec 0.001690 52 bytes Apache::Registry CGI.pm hello.cgi 406.2 4068 hits 10.02 sec 0.002462 216 bytes mod_cgi CGI Raw hello_raw. 124.3 1243 hits 10.00 sec 0.008046 196 bytes mod_cgi CGI.pm hello.cgi 9.2 99 hits10.81 sec 0.109242 216 bytes mod_speedycgi hello.cgi 248.8 2500 hits 10.05 sec 0.004019 216 bytes The benchmark suite as usual is at http://www.chamas.com/bench/hello.tar.gz --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
[ANNOUNCE] Apache::ASP v2.15]
Hey, Apache::ASP v2.15 is released and is in your local CPAN or: http://www.perl.com/CPAN-local/modules/by-module/Apache/ This release mainly fixes a bug which makes 2.11 not work under perl 5.6.1/5.7.1 The web site for Apache::ASP is http://www.apache-asp.org Apache::ASP provides an Active Server Pages port to the Apache Web Server with Perl scripting only, and enables developing of dynamic web applications with session management and embedded perl code. There are also many powerful extensions, including XML taglibs, XSLT rendering, and new events not originally part of the ASP API! CHANGES -Fix for running under perl 5.6.1 by removing parser optimization introduced in 2.11. -Now file upload forms, forms with ENCTYPE=multipart/form-data can have multiple check boxes and select items marked for @params = $Request-Form('param_name') functionality. This will be demonstrated via the ./site/eg/file_upload.asp example. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
[ANNOUNCE] Hello World Benchmark Suite, latest release
Hey, I have released the latest Hello World benchmark suite, which you can find at http://www.chamas.com/bench/hello.tar.gz ... Enjoy! --Josh CHANGES 1) Apache::Registry Hello World 2000 benchmark added, fastest of group, showing perl's raw template rendering power! 2) New XSLT AxKit and Apache::ASP benchmarks with XML::Sablotron DISCLAIMER: Like any benchmarks, these test no more than they test for. Fortunately you have can run them for yourself on YOUR hardware, and recommend any improvements as you see fit to the benchmark suite, or even add some tests for environments not covered already! SPEED NOTES: 1) These were run on a dual proc CPU PIII 450 which seems to have a lower relative bench for the HTML static test than on sincle proc CPU 2) HTML::Embperl v2.x is much faster than 1.3.0 on the h2000 bench, last I remember faster than Apache::ASP, about the same as PHP I decided to run 1.3.0, since its what I get from a CPAN install. 3) HTML::Mason was about as fast as Apache::ASP on the h2000 benchmark, but since 1.x was released, is much slower. BENCHMARK RESULTS hello]# ./bench.pl -time=60 -version Test Name Test File Hits/sec Total Hits Total Time sec/Hits Bytes/Hit -- -- -- -- -- -- Apache::ASP v2.15 2000 h2000.asp 224.5 13479 hits 60.04 sec 0.004454 28997 byte Apache::Registry v2.01 2000 mod_per h2000.reg 335.0 20102 hits 60.01 sec 0.002985 28178 byte HTML::Embperl v1.3.0 2000 h2000.epl 107.7 6463 hits 60.02 sec 0.009287 28840 byte HTML::Mason v1.03 2000 h2000.mas82.5 4954 hits 60.02 sec 0.012114 28798 byte mod_caucho JSP 2000 h2000.jsp 315.3 18928 hits 60.03 sec 0.003171 28964 byte mod_php PHP 2000h2000.php 257.3 15448 hits 60.04 sec 0.003886 28865 byte Template v2.00 Toolkit 2000 h2000.tt 53.7 3223 hits 60.02 sec 0.018621 2 byte Apache::ASP v2.15 hello.asp 371.9 22324 hits 60.02 sec 0.002689 241 bytes Apache::Dispatch v0.08 handler hello/worl 635.0 38107 hits 60.01 sec 0.001575 196 bytes Apache::ePerl hello.eper 337.3 20239 hits 60.01 sec 0.002965 217 bytes Apache::Registry v2.01 CGI Raw hello_raw. 686.1 41172 hits 60.01 sec 0.001458 52 bytes Apache::Registry v2.01 CGI.pm hello.cgi 449.6 26985 hits 60.02 sec 0.002224 216 bytes Apache::SSI v2.16 hello.shtm 546.6 32802 hits 60.01 sec 0.001829 199 bytes HTML static hello.html 1148.1 5 hits 43.55 sec 0.000871 311 bytes HTML::Embperl v1.3.0hello.epl 466.4 27996 hits 60.02 sec 0.002144 220 bytes HTML::Mason v1.03 hello.mas 361.5 21702 hits 60.02 sec 0.002766 197 bytes HTML::Template v2.0 hello.htmp 551.3 33089 hits 60.02 sec 0.001814 198 bytes mod_caucho JSP hello.jsp 835.6 5 hits 59.84 sec 0.001197 230 bytes mod_include SSI hello.shtm 979.5 5 hits 51.05 sec 0.001021 198 bytes mod_perl handlerhello.benc 831.2 49887 hits 60.02 sec 0.001203 196 bytes mod_php PHP hello.php 716.2 42975 hits 60.01 sec 0.001396 225 bytes mod_speedycgi hello.cgi 294.4 17673 hits 60.03 sec 0.003397 216 bytes Template v2.00 Toolkit hello.tt509.7 30594 hits 60.02 sec 0.001962 198 bytes Apache::ASP v2.15 XSLT Hellohxslt.xml 218.5 13113 hits 60.00 sec 0.004576 279 bytes AxKit v1.4 XSLT Hello hxslt.xml 200.7 12046 hits 60.01 sec 0.004981 398 bytes Apache Server Header Tokens --- (Unix) Apache/1.3.14 AxKit/1.4 OpenSSL/0.9.6 PHP/4.0.3pl1 Resin/1.2.1 mod_perl/1.24 mod_ssl/2.7.1 PERL Version: 5.00503 JAVA Version: java version 1.3.0 Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0) Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20001124 (JIT enabled: jitc)) Operating System: Linux 2.2.14-9.0 (root@gate) (gcc egcs-2.91.66) #1 2CPU [gate.]
Re: [ANNOUNCE] Hello World Benchmark Suite, latest release
I have an update already ... Matt kindly told me to lose the AxDebug 10 setting, now AxKit easily beats Apache::ASP on the XSLT benchmark. Also, I have some new Tomcat/mod_jserv benchmarks for Hello World and Hello World 2000. As before, you can download the benchmarks at http://www.chamas.com/bench/hello.tar.gz --Josh hello]# ./bench.pl -time 30 -version Test Name Test File Hits/sec Total Hits Total Time sec/Hits Bytes/Hit -- -- -- -- -- -- Apache::ASP v2.15 2000 h2000.asp 223.5 6713 hits 30.03 sec 0.004474 28997 byte Apache::Registry v2.01 2000 mod_per h2000.reg 339.1 10176 hits 30.00 sec 0.002949 28178 byte HTML::Embperl v1.3.0 2000 h2000.epl 106.4 3195 hits 30.04 sec 0.009402 28840 byte HTML::Mason v1.03 2000 h2000.mas83.2 2498 hits 30.02 sec 0.012017 28798 byte mod_caucho JSP 2000 h2000.jsp 323.2 9701 hits 30.01 sec 0.003094 28964 byte mod_jserv JSP 2000 h2000.jsp 174.1 5225 hits 30.01 sec 0.005744 29407 byte mod_php PHP 2000h2000.php 232.4 6975 hits 30.01 sec 0.004303 28865 byte Template v2.00 Toolkit 2000 h2000.tt 52.5 1576 hits 30.02 sec 0.019048 2 byte Apache::ASP v2.15 hello.asp 377.1 11326 hits 30.04 sec 0.002652 241 bytes Apache::Dispatch v0.08 handler hello/worl 632.3 18971 hits 30.00 sec 0.001581 196 bytes Apache::ePerl hello.eper 344.1 10332 hits 30.03 sec 0.002906 217 bytes Apache::Registry v2.01 CGI Raw hello_raw. 697.4 20933 hits 30.02 sec 0.001434 52 bytes Apache::Registry v2.01 CGI.pm hello.cgi 445.7 13380 hits 30.02 sec 0.002243 216 bytes Apache::SSI v2.16 hello.shtm 555.2 16670 hits 30.02 sec 0.001801 199 bytes HTML static hello.html 1135.9 34086 hits 30.01 sec 0.000880 311 bytes HTML::Embperl v1.3.0hello.epl 469.8 14103 hits 30.02 sec 0.002129 220 bytes HTML::Mason v1.03 hello.mas 357.5 10738 hits 30.03 sec 0.002797 197 bytes HTML::Template v2.0 hello.htmp 554.1 16631 hits 30.01 sec 0.001805 198 bytes mod_caucho JSP hello.jsp 853.1 25605 hits 30.01 sec 0.001172 230 bytes mod_include SSI hello.shtm 972.8 29195 hits 30.01 sec 0.001028 198 bytes mod_jserv JSP hello.jsp 324.1 9752 hits 30.09 sec 0.003086 357 bytes mod_perl handlerhello.benc 687.5 20634 hits 30.01 sec 0.001454 196 bytes mod_php PHP hello.php 610.6 18327 hits 30.01 sec 0.001638 225 bytes mod_speedycgi hello.cgi 247.9 7447 hits 30.04 sec 0.004034 216 bytes Template v2.00 Toolkit hello.tt509.9 15303 hits 30.01 sec 0.001961 198 bytes Apache::ASP v2.15 XSLT Hellohxslt.xml 221.5 6644 hits 30.00 sec 0.004516 279 bytes AxKit v1.4 XSLT Hello hxslt.xml 285.4 8572 hits 30.03 sec 0.003503 398 bytes Apache Server Header Tokens --- (Unix) Apache/1.3.14 AxKit/1.4 OpenSSL/0.9.6 PHP/4.0.3pl1 Resin/1.2.1 mod_perl/1.24 mod_ssl/2.7.1 tomcat/1.0 PERL Version: 5.00503 JAVA Version: java version 1.3.0 Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0) Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20001124 (JIT enabled: jitc)) Operating System: Linux 2.2.14-9.0 (root@gate) (gcc egcs-2.91.66) #1 2CPU [gate.]
[ANNOUNCE] Apache::ASP v2.11
Hey, Apache::ASP v2.11 is out in your local CPAN and also http://www.perl.com/CPAN-local/modules/by-module/Apache/ The changes are below. Apache::ASP provides an Active Server Pages port to the Apache Web Server with Perl scripting only, and enables developing of dynamic web applications with session management and embedded perl code. There are also many powerful extensions, including XML taglibs, XSLT rendering, and new events not originally part of the ASP API! The Apache::ASP web site is at http://www.apache-asp.org -- Josh $MODULE=Apache::ASP; $VERSION = 2.11; $DATE=05/29/2001; Please see README for changes for past versions. + = improvement; - = bug fix +Parser optimization from Dariusz Pietrzak -work around for global destruction error message for perl 5.6 during install +$Response-{IsClientConnected} now will be set correctly with ! $r-connection-aborted after each $Response-Flush() +New XSLTParser config which can be set to XML::XSLT or XML::Sablotron. XML::Sablotron renders 10 times faster, but differently. XML::XSLT is pure perl, so has wider platform support than XML::Sablotron. This config affects both the XSLT config and the $Server-XSLT() method. +New $Server-XSLT(\$xsl_data, \$xml_data) API which allows runtime XSLT on components instead of having to process the entire ASP output as XSLT. -XSLT support for XML::XSL 0.32. Things broke after .24. -XSLTCacheSize config no longer supported. Was a bad Tie::Cache implementation. Should be file based cache to greatly increases cache hit ratio. ++$Response-Include(), $Response-TrapInclude(), and $Server-Execute() will all take a scalar ref or \'asdfdsafa' type code as their first argument to execute a raw script instead of a script file name. At this time, compilation of such a script, will not be cached. It is compiled/executed as an anonymous subroutine and will be freed when it goes out of scope. + -p argument to cgi/asp script to set GlobalPackage config for static site builds -pod commenting fix where windows clients are used for ASP script generation. +Some nice performance enhancements, thank to submissions from Ime Smits. Added some 1-2% per request execution speed. +Added StateDB MLDBM::Sync::SDBM_File support for faster $Session + $Application than DB_File, yet still overcomes SDBM_File's 1024 bytes value limitation. Documented in StateDB config, and added Makefile.PL entry. +Removed deprecated MD5 use and replace with Digest::MD5 calls +PerlSetVar InodeNames 1 config which will compile scripts hashed by their device inode identifiers, from a stat($file)[0,1] call. This allows for script directories, the Global directory, and IncludesDir directories to be symlinked to without recompiling identical scripts. Likely only works on Unix systems. Thanks to Ime Smits for this one. +Streamlined code internally so that includes scripts were compiled by same code. This is a baby step toward fusing include script code compilation models, leading to being able to compile bits of scripts on the fly as ASP subs, and being able to garbage collect ASP code subroutines. -removed @_ = () in script compilation which would trigger warnings under PerlWarn being set, thanks for Carl Lipo for reporting this. -StatINC/StatINCMatch fix for not undeffing compiled includes and pages in the GlobalPackage namespace -Create new HTML::FillInForm object for each FormFill done, to avoid potential bug with multiple forms filled by same object. Thanks to Jim Pavlick for the tip. +Added PREREQ_PM to Makefile.PL, so CPAN installation will pick up the necessary modules correctly, without having to use Bundle::Apache::ASP, thanks to Michael Davis. + mode for opening lock files, not , since its faster +$Response-Flush() fixed, by giving $| = 1 perl hint to $r-print() and the rest of the perl sub. +$Response-{Cookies}{cookie_name}{Expires} = -86400 * 300; works so negative relative time may be used to expire cookies. +Count() + Key() Collection class API implementations +Added editors/aasp.vim VIM syntax file for Apache::ASP, courtesy of Jon Topper. ++Better line numbering with #line perl pragma. Especially helps with inline includes. Lots of work here, integrated with Debug 2 runtime pretty print debugging. +$Response-{Debug} member toggles on/off whether $Response-Debug() is active, overriding the Debug setting for this purpose. Documented. -When Filter is on, Content-Length won't be set and compression won't be used. These things would not work with a filtering handler after Apache::ASP
Re: Apache::ASP error re: subroutines
Andrew Koebrick wrote: Howdy, I am attempting to move a few subroutines from my Apache::ASP pages into a central module, but get the error: Undefined subroutine Apache::ASP::Demo::date_swap called at (eval 6) line 67. , /usr/lib/perl5/site_perl/5.6.0/Apache/ASP.pm line 1506 PerlSetVar GlobalPackage is set to Apache::ASP::Demo I bet, and you called the sub date_swap() which was not defined there. Is there something funky in the Apache::ASP environment regarding how/where modules are handled? The functions work when in the page, so I dont think there is an internal error there. I am calling the module with a basic use ASK (ASK.pm is the module name). The module has appropriate ownership/rights. If you sub is in ASK.pm, then you can reference it like: ASK::date_swap() or you could define the sub in the global.asa, which takes on the package name from GlobalPackage, so the sub will be in the same package that all your scripts are compiled into. I am especially curious why it is looking for dateswap under Apache::Demo::XXX This is the package that your ASP scripts includes are compiled into. Also there is a new mailing list for Apache::ASP at [EMAIL PROTECTED], but I have been slow to update the docs at the ASP web site README. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: looking for a functin to move %fdat to the symbol table..
jason n perkins wrote: php has a function called extract which takes an array (no distinction between arrays and hashes in php. in this case in perl, it'd actually be a hash). extract takes the key values of the array (and optionally prepends a user specified prefix to each of the values to avoid clobbering other values in the symbol table), sets each of them up as a variable with that name and sets the variable's value equal to the value of that associated key in the hash. the beauty of extract comes into play when you want to use each of the key/value pairs in the array. instead of setting them up one at a time, pass the array to extract and voila, you have all of the key/value elements available as variables. if my description is too unclear, you can check the extract functions info at http://www.php.net/manual/en/function.extract.php. does embedded perl sport a similar function? %fdat = qw(var1 2 var2 4); map { eval qq(\$$_ = \$fdat{$_}) } keys %fdat; print join(qq(\n), $var1, $var2, undef) You could roll your own extract() with line 2, but if you want to put it in a module, you might have to make it smarter about what package its extracting into with a call to caller(). -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: 8-bit characters and mod_perl/Apache-ASP
Difference like this, where cgi perl scripts work fine, but mod_perl/ASP doesn't, often has to do with %ENV where mod_perl is concerned. This is because Apache clears %ENV. The best way I have found to know what is in your %ENV for Oracle connections is to explicitly set it before the connect like: $ENV{'ORACLE_HOME'} = '/path/to/oracle/home'; $ENV{'NLS_LANG'} ='american_america.WE8ISO8859P1'; $ENV{'ORA_NLS33'} = $ENV{ORACLE_HOME}.'/ocommon/nls/admin/data'; DBI-connect('dbi:Oracle:' ...); This likely has nothing to do with Apache::ASP You can also try PerlPassEnv PerlSetEnv for things like the above, but explicitly setting has always given me the most mileage. --Josh Carl Lipo wrote: Im having an odd (and annoying) problem with text data being returned via Oracle::DBD (10.7) to an Apache::ASP (2.09) script. Essentially, perl that returns perfectly valid characters in both cgi and as a .pl file fails to return valid characters in the context of an Apache::ASP file. The issue, I think has to do with the fact that the Oracle database (8.0.6) is returning 8-bit characters. I can confirm this because I can repoint my application to a version of the database set with 7bit characters and everything works. While this shouldnt really be a problem (and isnt in the normal 'perl' setting), Apache::ASP/mod_perl seems to be barfing on these characters. Here's some sample code: use PNAP::Database::Query; ## a simplified database connection module use CGI qw/:standard/; ## for CGI output print header, start_html('A Simple Example'), ## make a database connection my $dbconn= new PNAP::Database::Query(Connection=NSPFinance, Debug=0); ## the sql statementA my $orgSQL = select o.FULLNAME; $orgSQL .= from ORGANIZATION o, PARTY_ROLE pr, PARTY_ROLE_TYPE prt; $orgSQL .= where o.ORGANIZATIONOID = pr.SubjectPartyOID and; $orgSQL .= pr.PartyRoleTypeOID = prt.PartyRoleTypeOID and prt.ShortName = 'NSP' and; $orgSQL .= pr.StartDate = sysdate and (pr.EndDate is null or pr.EndDate sysdate); $orgSQL .= order by FULLNAME; my $rs = $dbconn-query(Sql=$orgSQL, UseCursor=0); if ($rs) { while ($rs-next()) { my $fullname = $rs-FULLNAME; ## get the value from therecordset print Fullname: , $fullname,BR\n; ## output the value } $dbconn-finish($rs); } What is odd is that if I run this as a cgi (or from the command line), I get this output: Fullname: ATT Fullname: Agis Fullname: At Home Fullname: CW Fullname: CW/IDC Fullname: Digex Fullname: EBONE ... However, the exact same code run as an Apache::ASP page results in this output (on netscape for linux 4.76). Fullname: Fullname: Fullname: Fullname: Fullname: Fullname: ... On IE, however, I get this as output (viewed as source): Fullname: A T T Fullname: A g i s Fullname: A t H o m e Fullname: C W Fullname: C W / I D C Fullname: D i g e x Fullname: E B O N E ... This implies that the 8-bit characters are being rendered/dealt with *differently* for the cgi version and the Apache::ASP version (and that the Apache::ASP version honks up the 8-bit characters somehow). IE seems to deal with the odd characters better than netscape. In order to address this problem, Ive tried all the standard approaches to dealing with 8bit characters and Oracle databases (setting NLS_LANG, etc) and have tried using Convert::Translit module to do the conversion.. However, none of those actions seem to make any difference. I still get wonky output with the mod_perl/Apache::ASP version (but not the normal Perl/cgi version). What I am wondering is: (1) is there a known problem with mod_perl and 8-bit character sets? The version of apache I am running is 1.3.19 and mod perl 1.25, and Apache 2.09. (2) Is there any problem with this from the Apache::ASP side in either the way the Response-Write is done or the way in which these character sets are handled? Ive looked at the Response-Write and Response-WriteRef but dont see anything obvious that could cause this. (3) Has anyone seen this kind of behavior before? Any help would be appreciated (it will beat having to export and re-import the production database)... Carl Carl Lipo EMAIL: [EMAIL PROTECTED] IT Systems ArchitectPAGER: 206.570.2086 Internap Network Services OFFICE: 206.504.5442 601 Union Street, Suite 1000FAX: 206.654.5684 Seattle, WA 98101 CELL: 206.579.0163 Unauthorized use, disclosure, or distribution of information within this message is prohibited.
Re: $dbh-disconnect with Apache::DBI? (was Re: Failed requests inbenchmark)
Philip Mak wrote: I noticed something weird in my database logs, though: 010427 22:36:41 Aborted connection 2544 to db: 'animelyrics' user: 'animel' host: `localhost' (Got an error reading communication packets) 010427 22:37:14 Aborted connection 2546 to db: 'animelyrics' user: 'animel' host: `localhost' (Got an error reading communication packets) 010427 22:54:11 Aborted connection 2601 to db: 'animelyrics' user: 'animel' host: `localhost' (Got an error reading communication packets) Reading some other mailing list messages suggests that I did not do $dbh-disconnect() properly. But I'm using Apache::DBI, so should I need to do that? I would expect to see these messages if your web scripts were issuing database calls and the httpd processes got killed with a apachectl stop/start. There might then be aborted connections at the database end. There is probably a graceful way to issue a full stop, before a clean start ( not apachectl graceful ), but I don't know what it is. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Failed requests in benchmark
Philip Mak wrote: $ ./ab -n 100 -c 10 http://www.animelyrics.com/; This is ApacheBench, Version 1.3a ... Time taken for tests: 7.189 seconds Complete requests: 100 Failed requests:11 (Connect: 0, Length: 11, Exceptions: 0) My experience with ab is that it needs content to be returned of identical length from one request to the next, so if your content is dynamic in any way, it may fail. If there are any real Apache::ASP errors, they should show up in your apache error_log. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP extra newline in script output start - killing IEpdf recognition
Philip Mak wrote: On Fri, 27 Apr 2001, Joel W. Reed wrote: %@ LANGUAGE=PerlScript % % do neat perl things % Have you tried this: @ LANGUAGE=PerlScript %% do neat perl things % This is probably your work around for now. What I'll probably do with this is try to optmize the above construct to the latter format, or even eliminating the %\s+% during the parse stage. This will change the output for constructs like this or % for (1..X) { % % for (1..Y) { % To have X less \n\t in the output, but this is likely a valid optimization that many other embedded scripting languages seem to offer, witnessed during my Hello World benchmarks. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
New Apache::ASP mailing list
Hey, I am pleased to announce a new mailing list for Apache::ASP at [EMAIL PROTECTED] To subscribe, just send a message to: [EMAIL PROTECTED] See you there! Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: modperl/ASP and MVC design pattern
I' m using UniquePackages and because subs name conflict I need to put the subs in the asp pages. Can I still use initialization of global vars in the global.asa/Spript_OnStart (as you suggest) ? ...so the ASP/$Server-Transfer() is the equivalent of JSP/forward I don't know if transfer is quite the same, $Response-Redirect() might be more similar depending whether its an internal or external redirect. You could hijack part of the ASP object namespace for your uses like: $Request-{CX}{name} = 'hello'; or hijack a var in the main:: package $main::CX-{name} = 'hello'; You could also lose your reliance on UniquePackages by putting your subs into the global.asa. You might also init an object which inits into context globally which you could reset every Script_OnStart, like # in script % my $cx = CX-new; % # in CX.pm; this is probably similar to Class::Singleton use vars qw($CX); $CX = {}; sub new { bless $CX } # in global.asa use CX; sub Script_OnStart { $CX::CX = {}; } -- Josh
Re: modperl/ASP and MVC design pattern
Francesco Pasqualini wrote: an interesting feature of JSP is the possibility to use the MVC design pattern (INPUT/OUTPUT/LOGIC separation) This is obtained with the "forward" instruction. How the MVC design pattern can be implemented in the mod_perl (and specifically Apache::ASP) architecture ? I don't know about MVC design patterns, but Apache;:ASP has these features which may help, of which $Server-Transfer() is probably your closest match to the forward instruction: $Server-Transfer($file) Transfer control to another script for execution with current script context including current $Session $Application, etc. my $data_ref = $Response-TrapInclude($file, @args) print/$Response-Write() output of script does not go straight to client browser, instead returns output in a scalar reference that you may post process as you like $Response-Include($file, @args) Like !--#include file=$file--, but @args are available in script in @_ $Server-Execute() is an alias for $Response-Include() Script_OnStart, Script_OnEnd, Script_OnFlush events Various events called, if defined in your global.asa, during the life of the script execution. Script_OnStart can be used to set globals available to scripts, or manage things such as site wide authentication control Script_OnFlush is useful for post processing data going to the client browser in a global way. XMLSubs Ability to create XML tags which are handled by perl code execution. The nice thing is that embedded tags pass their output as an argument to parent XMLSubs, for example: my:form action=basename($0) my:input type="button" / /my:form The my::input sub would execute then return its HTML to the my::form sub in a calling structure like: my::form(\%args, $html = my::input(\%other_args)); -- Josh _________ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: modperl/ASP and MVC design pattern
[EMAIL PROTECTED] wrote: To avoid passing many parameters to the subs I become using a $cx (cx stand for context) global hash containig everything the subs needed, passed to each sub. page test.asp $cx = {}; $cx-{'name'} = 'default name'; $cx-{'age'} = 30; ... Try this, # in global.asa use vars qw($cx); # set up $cx for global use sub Script_OnStart { $cx = {}; # initialize per request } # in script sub HelloWorld { $cx-{name} = 'hello'; } This will work, but I'd recommend you move your subs to global.asa, which is your central module for your scripts. And then you can use $Server-Transfer() to change the file executing midstream. --Josh
Re: Apache::ASP error
Rick Glunt wrote: I have Apache::ASP setup and running. The sample site works and very simple asp pages I created work, however, I have a page that is generating the following error in the Apache error log and will not display on my browser: [error] Undefined subroutine Apache::ASP::Compiles::_usr_local_apache_htdocs_www_aspdomain___global_asa: :Form called at (eval 24) line 1. -- , /usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1506. It looks like there is a function called Form that is being called that does not exist. Make sure that you are trying to execute perl script only, Apache::ASP does not support VBScript. Also, if you would like more debug info, set PerlSetVar Debug 2, and you will see the script ASP is trying to compile in your browser. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP and no global.asa
Rick Glunt wrote: I am trying to setup Apache::ASP to handle asp pages for one of my virtual domains in Apache but I am getting an 'Internal Server Error' on the browser and an error in the Apache log files that goes something like [error] Undefined subroutine Apache::ASP::Compiles::_usr_local_apache_htdocs_www_aspdomain___global_asa: :Form called at (eval 24) line 1. -- , /usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1506. I believe I already answered this question in a prior mail to the list, but wanted to clarify that Apache::ASP creates an empty global.asa for you if you don't have one, and it is into this perl package that all your scripts and includes are compiled so that they can share perl global values more easily. So the namespace is a bit misleading. If you wanted to rename the global.asa perl package, set the GlobalPackage config. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Problem with ASP Pages
"Bridges, Jon" wrote: I have figured out why the .asp files were being downloaded instead of executed. This was because I had not declared .asp in the mime.types file. I couldn't do the lwp-request as I am running Apache on Windows 2000, is this a Linux command? In all my years (almost 3) working with Apache::ASP, I never had to tweak the mime.types to make things work. If this is really what did it for you, that's great! The lwp-request command is one that ships with perl, and you will likely find it as lwp-request in the perl/bin directory on your system. You can run it like perl $perl_dir/bin/lwp-request ... Now all that happening is an error in the error log saying "No such file or directory: couldn't spawn child process" I personally have no idea about this, maybe someone else might? If you think this is an Apache::ASP error, then set Debug to -2, restart apache, and get me an error log bit for a request. -- Josh _________ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Unwanted \n in output
willems Luc wrote: Hello everybody , I have some Apache::ASP scripts that work like a XML::RPC . The idea is to send some XML request and the response will be an answer in XML that can be used by the client software. One of my scrips has a problem that in the response , 7 times a '\n' charecter is put before the actual XML text (seen by using ethereal ). This confuses my clients XML parser (M$ parser ). I don't know where these characters come from. The ouput i generated doesn't have it. I already tryed Response-Binarywrite and flushing but this doesn't do the trick. Does anybody know where this comes from ? Like Ged said, check out your % %, but also if you want to kill leading white space globally, you might post process your output in your global.asa with Script_OnFlush: sub Script_OnFlush { my $out_ref = $Response-{BinaryRef}; $$out_ref =~ s/^\s+(\\?xml)/$1/s } Then set PerlSetVar BufferingOn 1 so that flush will only be called once per script. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Problem with ASP Pages
"Bridges, Jon" wrote: I'm working on Windows 2000 and have finally managed to get the mod_perl and Apache::ASP extensions working. I can confirm this as when I open up .htm files with embedded asp everything works fine. However I come across a problem when trying to view .asp files as my web browser IE5.5 will try and download them. Has anyone got any ideas on why this is happening Are you sure the .asp files are being executed? If they are, then they send a Content-Type: text/html header by default, so IE 5.5 should handle it. Did you get the examples to work in the ./site/eg directory? They have .asp files there. You can see the headers that are being sent by lwp-request -ed $URL if content-type is being set and IE still doesn't get it, I'm not sure what to say? --Josh _____ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP
alexus wrote: I don't know what there wrong to setup i have in httpd.conf following lines: LoadModule perl_modulelibexec/libperl.so and AddModule mod_perl.c and whenever I start apache I get this in error_log [Tue Apr 10 00:40:23 2001] [notice] Apache/1.3.19 (Unix) PHP/4.0.4pl1 mod_perl/1.25 mod_ssl/2.8.1 OpenSSL/0.9.6 configured -- resuming normal operations Recently, someone else posted with this problem where they had 2 web servers, the one running modperl was running on a high port in a dual httpd / proxypass situation. If this is your case, you need to run scripts through that web server, say by going to port 2000 or through the /path/ that gets forwarded to that other server. At the end of it all, you know modperl is working correctly when things like PerlHandler don't error. I have only seen this error because of configuration problems or modperl not being installed. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP
alexus wrote: Files ~ (\.asp) SetHandler perl-script PerlHandler Apache::ASP PerlSetVar Global /tmp /Files I start geting this: su-2.04# /usr/local/apache/bin/apachectl configtest Syntax error on line 1242 of /usr/local/apache/conf/httpd.conf: Invalid command 'PerlHandler', perhaps mis-spelled or defined by a module not included in the server configuration su-2.04# This is a FAQ, see: http://www.apache-asp.org/faq.html#Installation Your modperl is not installed or setup correctly. If this is a prebuilt distribution, make sure you are starting your apache such that modperl is activated. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Question and problem with graphics and Apache:ASP running.
Steve Hurley wrote: When I turn on Apache:ASP and try to load a few html files it messes up the graphics at the top. Now if I turn off the ASP, graphics load fine... Page with banner graphics split up: http://www.clark.cc.oh.us/asp/student.html page with one banner graphic...: http://www.clark.cc.oh.us/asp/student2.html in http.conf: Location /asp/ SetHandler perl-script PerlHandler Apache::ASP PerlSetVar Global /tmp /Location If you want to mix media types in the same directory, use the Files Apache config to mark certain files for Apache::ASP execution like so: Files ~ (\.htm$) SetHandler perl-script PerlHandler Apache::ASP PerlSetVar NoState 1 /Files I'm guessing that Apache::ASP was trying to parse anything under /asp/, including graphics, which just _might_ mess things up :) -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: How to make Apache (use Apache::ASP?) send out thecontent-length of documents generated on the fly
Ying Li wrote: Hi, Is there any way to tell Apache server to send the Content-Length header base on the dynamically-generated query result? Any help will be appreciated. With Apache::ASP this will happen automatically for you if you have BufferingOn set, since Apache::ASP knows the full length of the document when it flush the headers. I don't know about other environments. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP -- Corruption of statedir files/truncation of methodnames
Carl Lipo wrote: I've just started having problems with asp state files for Apache::ASP 2.09 becoming corrupted during use. My application will work just fine but at somepoint the session asp state files get corrupted and only deleting them allows the application to continue working. Oddly, this occurs on two different servers so the problem does not appear to be machine specific. The symptom of the problem is that application errors are returned from the asp code execution that look something like this: Uncaught exception from user code: Can't locate object method 'Quer' via package quot;Apache::ASP::Request'; at (eval 263) a href=#167l ine 167/a. INAP::NEIS::_usr_local_applprod_infosource_apps_netcfg_viewNodes_htmxINL() called at /usr/local/lib/site_perl/Apache/ ASP.pm line 1504 Generally problems of this nature, where even perl data seems to be corrupted, seem to be from buffer overrun type issues that normally result in segfaults. Looking at your config, I would suspect the culprit to be use of DB_File on your StateDir, where /usr/local/etc/infosource/apps/netcfg/state-dir may be mounted over NFS. NFS typically does not support the flock() style locking that Apache::ASP uses to protect DB_File from corruption. If you are must use NFS, don't use DB_File, use the default SDBM_File, which does not corrupt as easily. If you need to get past the 1000 byte limit, then you might use MLDBM::Sync::SDBM_File which I developed just for this purpose. I need to add config support for this still to Apache::ASP though. If you can switch to a CIFS/or samba mounted file system, do this, as this supports flock() semantics. If StateDir is mounted locally, then possibly there is a bug in Apache::ASP StateDB locking, but this is less likely the case and we might look at other types of buffer overrun issues that might corrupt perl data structures. If your modperl httpd is compiled DSO, compile it static, as I have seen no end of odd errors with the DSO config from time to time. Also, DBD::Oracle and long values with CLOBs/BLOBs can create another type of buffer overrun, which is supposedly on OCI bug, though you didn't mention use of Oracle this is an odd bug that stung me recently. If you give up on trying to find this bug, which seems to be related to StateDB corruption, you may create $Application $Session objects with Apache::Session in the global.asa Script_OnStart, which would at least eliminate the StateDB issue. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: ASP Win32 problems
You probably solved the particular problem below by changing: PerlSetVar StateDir /tmp/asp_demo to a real directory on your system. On win32 platforms /temp/asp_demo should work pretty well too. Now that you changed that setting what does your error log give you? --Josh "George A. Fitch III" wrote: Hi, I installed mod_perl and Apache::ASP on WinNT, and the sample .htm files work fine. I can't seem to get the sample .asp files to work, though. I checked the error log and saw these errors: [Mon Apr 02 15:52:04 2001] [error] [asp] [174] [error] can't create group dir /tmp/asp_demo: No such file or directory, G:/nusphere/perl/site/lib/Apache/ASP.pm line 4585 [Mon Apr 02 15:52:04 2001] [error] [asp] [174] [error] can't create group dir /tmp/asp_demo/server: No such file or directory, G:/nusphere/perl/site/lib/Apache/ASP.pm line 4585 [Mon Apr 02 15:52:04 2001] [error] [asp] [174] [error] Can't tie to file /tmp/asp_demo/server/internal, 258, No such file or directory !! -- Make sure you have the permissions on the -- directory set correctly, and that your -- version of Data::Dumper is up to date. -- Also, make sure you have set Global to -- to a good directory in the config file., G:/nusphere/perl/site/lib/Apache/ASP.pm line 4669 [Mon Apr 02 15:52:04 2001] [error] Can't bless non-reference value at G:/nusphere/perl/site/lib/Apache/ASP.pm line 4887. Apache::ASP::State::TIEHASH('Apache::ASP::State', 'Apache::ASP=HASH(0x41962ac)', 'internal', 'server', 258) called at G:/nusphere/perl/site/lib/Apache/ASP.pm line 664 Apache::ASP::new('Apache=SCALAR(0xb1a9f4)') called at G:/nusphere/perl/site/lib/Apache/ASP.pm line 152 Apache::ASP::handler('Apache=SCALAR(0xb1a9f4)') called at nul line 0 eval {...} called at nul line 0 So, it seems some directory is set to /tmp or /tmp/asp. Does anyone know where this property is set. I went through the .htaccess file and set al temp directories to G:/Temp, but it still doesn't work. Any help would be greatly appreciated, Gaf
Re: Apache::Session::Postgres Segmentation Fault Addendum
Victor Michael Blancas wrote: I'm using Apache::Session::Postgres with Apache::ASP. I'm getting a Segmentation Fault whenever I do a $dbh-disconnect at the end of the script. When I comment out the the $dbh-disconnect however, I don't get any errors. Having a script without a $dbh-disconnect at the end is wrong isn't it. Anyone encountered this before? I just tested it as a simple perl script on the command line. I'm still getting a core dumped Segmentation Fault whenever I do a disconnect at the end of the script. If you are using Apache::DBI, then dbh-disconnect should not do anything, so this might get around the problem you are having? -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Help with Apache::ASP!
Sean Coyle wrote: Josh, I am not entirely sure that is the issue here. Just to cover off all the bases, I am familiar with the FAQ, and several others. However, it is actually not unparsed ASP that I am viewing in the browser output, but seemingly partially parsed output. Apache::ASP isn't running the script. The output you see at http://admin.worldvibe.org/eg/ is the full source code of the script. There is likely a Directory config that covers the DocumentRoot of your web server that sets AllowOverride None, so having a Directory / doesn't do any good. It may also be that you haven't copied the .htaccess file from the distribution ./site/eg. That's where all the ASP configs are at. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051