ASP / Apache
I'm planning on porting a website w/ ASP pages, from an IIS server, to an Apache Server... Does Apache::ASP work well ? Does Anyone have good experiences whit it ? Does Apache::ASP interacts with SQLServer or MySql ? Thanx alot for any informations... -- Sam - Omatis [EMAIL PROTECTED]
Re: File upload problem
Actually I've tried the following piece of code. $inputfile = $Request-Form('Offer'); %%=$inputfile%P% open (OUTFILE,/export/home0/www/biznet/offers/newfile) or die Can not write to file because of $!; binmode OUTFILE; binmode $inputfile; while (read($inputfile,$buffer,1024)) { print OUTFILE $buffer; } ## end while close OUTFILE; The form that leads to this code is the following form action=Save.asp method=post enctype=multipart/form-data name=EditProj input type=file name=Offer /form My problem is that ithe ASP page creates the file wanted but it is empty. Am I doing something wrong?? At 09:04 ðì 26/3/2001 -0800, you wrote: --- Sophokles Zafeiris [EMAIL PROTECTED] wrote: Hi, I'm new in mod_perl. I'm trying to write an ASP script using Perlscript that will be able to perform file uploading from an html form. Is there any script that I could use? Check the docs on CGI.pm, which will handle practically all the painful parts for you. Just be *SURE* to create a multipart form! It won't work otherwise. (It's all in the docs. =o) __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Problem reading postdata
Hello. When I try to read STDIN in modperl/apache/win32the script just ignore the $/ and readall of it to the end. It works fine to read single lines fromSTDIN in cgi-bin scripts.Any tips? (i'm using Randy Kobes' binary Perl-5.6.0, mod_perl-1.23, and Apache_1.3.12) kind regards Tomas
Re: [DIGEST] mod_perl digest 03/24/01
At 08:57 AM 3/26/01 -0500, Geoffrey Young wrote: mod_perl status o mod_perl - stable: 1.25 (released January 29, 2001) [1] - development: 1.25_01-dev [2] o Apache - stable: 1.3.19 (released February 28, 2001) [3] - development: 1.3.20-dev [4] o Perl - stable: 5.6 (released March 23, 2000) [5] - development: 5.7 [6] Is Perl 5.6 really the "stable" release? I've seem some discussion out of the corner of my eye here about people complaining about 5.6 and to get so-and-so latest version instead. To someone like me who doesn't really use 5.6 specific features, I just avoid getting 5.6 altogether because of seeing posts like this. Also, is 5.6 really the release that works the most stably with mod_perl 1.25? Or would a variant of 5.005 really be better instead if people complain about 5.6? I just noticed this in the digest and it started me thinking about this. Because if I read the digest as a newbie, I would be taking it to mean that if I want the most stable mod_perl server I would use Perl 5.6 with mod_perl 1.25.
Re: [DIGEST] mod_perl digest 03/24/01
Hi Gunther, On Tue, 27 Mar 2001, Gunther Birznieks wrote: Is Perl 5.6 really the "stable" release? According to the Perl developers it is. Odd minor version numbers now indicate development versions, so the next "stable" release should be 5.8.x Having said that I'm using 5.7.0 in development of a system with tens of thousands of lines of Perl and I have had only one minor problem - Image::Magick won't install. I don't know why, it might well be my fault but I don't care for the moment, so I'm well pleased with it. Of course we're still running 5.005_03 in production. I've seem some discussion out of the corner of my eye here about people complaining about 5.6 and to get so-and-so latest version I saw one or two messages like that too, which was one reason for going to 5.7.0. The main reasons were to get some experience of the new version, and get a feel for what might happen we eventually uprade in production. If we don't upgrade reasonably often (I'm thinking every year or two:) then when we finally do it could be painful. Also, is 5.6 really the release that works the most stably with mod_perl 1.25? Or would a variant of 5.005 really be better I have had no issues with 5.6.0 nor 5.7.0 attributable to mod_perl itself of any version 1.21 - 1.24_01, I haven't used 1.25 for real yet. The only problem I ever had with 5.6.0 was when it complained about some dubious code in one of our outsourced libraries. One-line fix. if I want the most stable mod_perl server I would use Perl 5.6 with mod_perl 1.25. I'd say the jury's still out on that. 73, Ged.
Re: [DIGEST] mod_perl digest 03/24/01
"G.W. Haywood" [EMAIL PROTECTED] wrote: On Tue, 27 Mar 2001, Gunther Birznieks wrote: Is Perl 5.6 really the "stable" release? According to the Perl developers it is. Odd minor version numbers now indicate development versions, so the next "stable" release should be 5.8.x Perl 5.6.1 should be out in a couple of weeks or so. perl-5.6.1-TRIAL3.tar.gz is currently available on CPAN if you're feeling keen. 5.6.0 has a couple of nasty bugs for which patches are available - see the list archives. One (IIRC) concerns scalars getting the wrong values when concatenated after being evaluated in both numeric and string contexts; the other causes coredumps when doing backtraces, which broke HTML::Mason. After adding these patches, I've been using 5.6.0 in production for about 9 months now. * Dave Mitchell, Senior Technical Consultant * Fretwell-Downing Informatics Ltd, UK. [EMAIL PROTECTED] * Tel: +44 114 281 6113.The usual disclaimers * * Standards (n). Battle insignia or tribal totems
looking for docs
anyone know where doc's for handling digest authentiction w/ m_p 1.25 live? having little luck finding any working examples and i'm running out of time... thanx. -- Steven Lembark 2930 W. Palmer St. Chicago, IL 60647 [EMAIL PROTECTED] 800-762-1582
Apache::Cookie-bake - When?
I'm slowly porting my development scripts from mod_cgi to mod_perl. I just moved my main authentication handler to PerlFixupHandler (later I'll probably move it to AuthenHandler, but I just want it to work for now). In any case, all of the sudden, my upload script is choking and giving me 400 (Bad request) errors. I wanted to ask if this is because I'm new() and bake()ing a session cookie before I even get around to parsing the upload (and any other data, for that matter), or am I barking up the wrong tree? The upload script itself was working very nicely under Apache::Registry and is using CGI, not Apache (yet). Any ideas? Issac Internet is a wonderful mechanism for making a fool ofyourself in front of a very large audience. --AnonymousMoving the mouse won't get you into trouble... Clicking it might. --AnonymousPGP Key 0xE0FA561B - Fingerprint:7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B
Re: ASP / Apache
I've used Apache::ASP and it worked quite well for me. With Apache::ASP (as for other mod_perl based frameworks) you should interface with your favourite relational database using the DBI (via. Apache::DBI is best). There are DBI drivers for MySQL. I don't know about SQLServer -- for that you could use the ODBC driver. See http://dbi.symbolstone.org/ for DBI. Also checkout HTML::Mason http://www.masonhq.com (my favourite) and EmbPerl http://perl.apache.org/embperl/ Matthew On 27 Mar 2001 09:41:29 +, Samuel Lellouche wrote: I'm planning on porting a website w/ ASP pages, from an IIS server, to an Apache Server... Does Apache::ASP work well ? Does Anyone have good experiences whit it ? Does Apache::ASP interacts with SQLServer or MySql ? Thanx alot for any informations...
Re: ASP / Apache
Samuel Lellouche wrote: I'm planning on porting a website w/ ASP pages, from an IIS server, to an Apache Server... Well the model is similar, but there is no support for VBScript. I'd be happy to give a go a writing a VBScript emulation layer which could help your port but I'll need a site's source to base my work on, will you volunteer yours? Does Apache::ASP work well ? Yes. It has the original ASP API mostly implemented, as well as extra features like: More Events http://www.apache-asp.org/events.html Custom Tags w/XMLSubs http://www.apache-asp.org/xml.html HTML Compression http://www.apache-asp.org/config.html#CompressGzip Auto FormFill http://www.apache-asp.org/config.html#FormFill Site Errors Emailed http://www.apache-asp.org/config.html#MailErrorsTo Cookieless Sessions http://www.apache-asp.org/config.html#Cookieless%20Sessions Its also very fast, you can download a benchmark suite I wrote for comparing Apache development environments at: http://www.chamas.com/bench/hello.tar.gz Note the h2000 benchmarks are more indicative of real world performance, as it tries to measure the runtime speed. Does Anyone have good experiences whit it ? Yes, I'm the author so I'm biased. You might contact admins running the sites listed at: http://www.apache-asp.org/sites.html Skip chamas.com nodeworks.com as those are my sites. Does Apache::ASP interacts with SQLServer or MySql ? Check out this faq on database support: http://www.apache-asp.org/faq.html#How%20is%20database%20connectivity%20handled%3F Also note that DBD::Sybase is probably the way to go to get to a MS SQLServer. They both share a common code base, and that driver is reputed to work. Lots of people use DBD::mysql, including myself, and its very fast. Should you got that route DBD::Oracle is very robust. Best of luck. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Getting a Cache::SharedMemoryCache started
I want to cache some values in my handlers so they don't keep having to look stuff up, and so I figured a Cache::SharedMemoryCache would be the way to go. I'm a little confused as to where to set the little fella up tho'. Is it as simple as saying: my $cache = new Cache::SharedMemoryCache( $options ); in my sub handler() { ... } ? If I've got it wrong, can someone give me a clue? Thanks in advance Matt
Re: Getting a Cache::SharedMemoryCache started
On Tue, Mar 27, 2001 at 09:50:33PM +0100, Matt wrote: I want to cache some values in my handlers so they don't keep having to look stuff up, and so I figured a Cache::SharedMemoryCache would be the way to go. It all depends on what you want to cache and why. If you wanted to save a trip to the database on each request, a really simple mod_perl handler could look something like this: package MyApplication; use strict; use Apache::Request; use Cache::SharedMemoryCache; sub handler { my ( $request ); my $cache = new Cache::SharedMemoryCache( ); my $data = $cache-get( 'data' ); if ( not defined $data ) { $data = expensive_database_request( ); $cache-set( 'data', $data ); } $request-content_type( 'text/plain' ); $request-send_http_header( ); $request-print( "data: $data" ); } The first time this handler is run, the data will not be found in the cache. The second time, however, the data will be returned from the cache, saving a trip to the database. The other question is whether or not to share the cache instance itself globally. Technically, this is up to you. Personally I wouldn't bother, considering the overhead of instantiating the cache is so low that I would rather keep it local to the handler (as I did above). I tend to only share data globally in mod_perl handlers very judiciously, and even then I wrap the data in an object that provides accessor methods. For an example of an object that wraps shared data, check out Cache::MemoryCache, which simply caches data inside the process. Hope this helps a bit. Cheers, -DeWitt
Re: Getting a Cache::SharedMemoryCache started
DeWitt Clinton wrote: The other question is whether or not to share the cache instance itself globally. Technically, this is up to you. Personally I wouldn't bother, considering the overhead of instantiating the cache is so low that I would rather keep it local to the handler (as I did above). I tend to only share data globally in mod_perl handlers very judiciously, and even then I wrap the data in an object that provides accessor methods. For an example of an object that wraps shared data, check out Cache::MemoryCache, which simply caches data inside the process. Wouldn't this cause the cache to be torn down and rebuilt for every request??? -- "The camel has not evolved to smell good. Neither has Perl." -- Larry Wall
Re: Getting a Cache::SharedMemoryCache started
On Tue, Mar 27, 2001 at 05:19:15PM -0500, Pierre Phaneuf wrote: DeWitt Clinton wrote: The other question is whether or not to share the cache instance itself globally. Technically, this is up to you. Personally I wouldn't bother, considering the overhead of instantiating the cache is so low that I would rather keep it local to the handler (as I did above). I tend to only share data globally in mod_perl handlers very judiciously, and even then I wrap the data in an object that provides accessor methods. For an example of an object that wraps shared data, check out Cache::MemoryCache, which simply caches data inside the process. Wouldn't this cause the cache to be torn down and rebuilt for every request??? The cache instance itself would be, but the data behind it (a global hash in the case of the MemoryCache, and a IPC::ShareLite store for the SharedMemoryCache ) would stay around. Since the instance isn't that heavy, I feel better instantiating them fresh every request. If you need optimal performance, however, you may want to keep the instance itself global. Which reminds me of something. These cache objects are not currently thread safe. When should I start expecting multi-threaded apache/mod_perl to become mainstream enough to warrant an overhaul of the code? I imagine that nearly most Perl libraries are not thread safe, of course. But code that will be used in mod_perl environments needs to be, right? -DeWitt
Re: Getting a Cache::SharedMemoryCache started
On Tue, 27 Mar 2001, DeWitt Clinton wrote: Which reminds me of something. These cache objects are not currently thread safe. When should I start expecting multi-threaded apache/mod_perl to become mainstream enough to warrant an overhaul of the code? I imagine that nearly most Perl libraries are not thread safe, of course. But code that will be used in mod_perl environments needs to be, right? You can read all about it here: http://www.apache.org/~dougm/modperl_2.0.html The gist is that you probably don't need to change any Perl code, but some XS modules on CPAN may have to change. - Perrin
Re: [PATCH] X-Forwarded-For (fwd)
Some day we'll have the X-Forwarded-For and friends in the default mod_proxy module. :-) - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do(); -- Forwarded message -- Date: Tue, 27 Mar 2001 12:47:12 +0200 From: Graham Leggett [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PATCH] X-Forwarded-For Ask Bjoern Hansen wrote: As an option it would be useful to be able to forward the Host: header too. Lots of people find this amusingly simple module useful for that http://develooper.com/code/mpaf/mod_proxy_add_forward.c I put in X-Forwarded-For and x-Forwarded-Host into mod_proxy with the last patch. I changed X-Host to X-Forwarded-Host so that if in the future these two become parts of HTTP and drop the X- there is not clash with the Host header. I also included the X-Forwarded-Server header (for X-Server-Host) - but this functionality is duplicated by the HTTP/1.1 Via header, so I am in two minds as to whether this should be included. Regards, Graham -- - [EMAIL PROTECTED]"There's a moon over Bourbon Street tonight..."
Getting unbuffered output from a subprocess
Hello, So, when doing a CGI and needing to execute a subprocess with input based on user input, I always do a open()-fork()-exec() like so: if(defined(my $pid = open(KID, '-|'))) { if($pid) { print while KID; close KID; } else { %ENV = ( ... ); exec('/full/path/to/bin', @args); } } When using a mod_perl script, I "use Apache::SubProcess" and the above stuff still works. However, let's say the subprocess I kicked off takes a while to process, but prints status information in the meantime (for example, tagging a big CVS tree, or indexing textfiles, or whatnot). I want the user to see the information "real-time" (so I'd probably have local $| = 1 inside the if($pid) block above). This no longer works under Apache::SubProcess. Tt buffers up all the output and then sends it all at once. So my parent process reads in an unbuffered way, but the child "exec()" outputs all at once. Is there any way to remedy this situation? Thanks in advance. Humbly, Andrew -- Andrew Ho http://www.tellme.com/ [EMAIL PROTECTED] Engineer [EMAIL PROTECTED] Voice 650-930-9062 Tellme Networks, Inc. 1-800-555-TELLFax 650-930-9101 --
[BUG-REPORT] missing header (minor)
Version: Apache/1.3.12 (Unix) mod_perl/1.24 What: PerlAuthenHandler returns headers without WWW-Authenticate field Work-around: set with $r-err_header_out Is this fixed in 1.25? Description: Modules called using the PerlAuthenHandler that eventually return AUTH_REQUIRED, will not send clients all RFC required headers under certain conditions. If the client already has cached login credentials in and is sending a cached Basic authentication token, the request looks something like this: GET /private/ www.foobar.com HTTP/1.1 Authorization: Basic ljkdhfoi984h0FGDH== If you want to force the client to resend the credentials via user input (dialog box), you can return a AUTH_REQUIRED to the apache request. You might want to do this for timing reasons, or if the user has changed their password, etc. If you return AUTH_REQUIRED the headers will look something like this: HTTP/1.1 401 Authorization Required Date: Tue, 27 Mar 2001 00:32:11 GMT Server: Apache/1.3.12 (Unix) mod_perl/1.24 Connection: close Content-Type: text/html If the client is using internet explorer (netscape doesn't seem to care) this will *not* pop up the dialog box; instead the 401 error document will be displayed. This is because MSIE follows the RFC (I'm as surprised as you are :-)) which requires the server to also send the WWW-Authenticate header. A properly formed header would look like this: HTTP/1.1 401 Authorization Required Date: Tue, 27 Mar 2001 00:32:11 GMT Server: Apache/1.3.12 (Unix) mod_perl/1.24 WWW-Authenticate: Basic realm="Alumni Database" Connection: close Content-Type: text/html Note, this *only* happens when using the Perl API (PerlAuthenHandler) and when the client is sending both a "GET/POST" and an "Authorization" header. A vanila apache server will return WWW-Authenticate header for a protected resource regardless of the client request. --
perl session management
Hello there.. Could u suggest a way to update a session variable. At present it is not possible for me to update a session variable from any other page. I thought it would be automatically updated when i do a new insertion into the session variable which in my case is a hash. Is there any other way. Could anyone please help. I am using the module Apache::Session::MYSQL. Thanks in advance Dups. Get free email and a permanent address at http://www.netaddress.com/?N=1
Re: perl session management
On 27 Mar 2001, tom joseph wrote: Hello there.. Could u suggest a way to update a session variable. At present it is not possible for me to update a session variable from any other page. I thought it would be automatically updated when i do a new insertion into the session variable which in my case is a hash. Is there any other way. Could anyone please help. I am using the module Apache::Session::MYSQL. How about some code so we can see where things might not be working? -- Brett http://www.chapelperilous.net/btfwk/ The star of riches is shining upon you.
Running Mod-Perl on Solaris 2.8
Title: Running Mod-Perl on Solaris 2.8 We have installed mod_perl-1.25 under apache-1.3.14 and Solaris 8, but have not been completely successful in configuring httpd.conf correctly for mod_perl modules. Whenever I browse my test page www.my.com/perl/test.pl, I get a Netscape pop-up message stating: The document contained no data. Try again later, or contact the server's administrator. I seem to get this for any file I try irrespective of whether it exists. The apache error_log provides the message: [date/time] [notice] child pid 19616 exit signal Segmentation Fault (11) The httpd.conf file was modified in the following way to accommodate mod_perl: AddModule mod_perl.c (very first directive after ClearModuleList) . IfModule mod_perl.c Alias /perl/ /usr/local/apache_1.3.14/lib/perl/ PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader On Options +ExecCGI allow from all /Location The following was added to define the test.pm perl module: PerlModule ModPerl::test4 Location /mod_perl_test SetHandler perl-script PerlHandler ModPerl::test4 /Location /IfModule All the evidence leads me to assume that their is something basic that I am missing.
mod_perl 1.25 install crashes with IBM HTTP Server 1.3.12.2 on AIX 4.3.3
Hi, I am trying to install mod perl 1.25 on my aix machine. I am using -- AIX 4.3.3 -- IBM HTTP Server 1.3.12.2 -- PERL version 5.005_03 following command i have used: perl Makeperl.PL \ APACHE_PREFIX=/usr/HTTPServer USE_APXS=1 \ WITH_APXS=/usr/HTTPServer/bin/apx \ EVERYTHING=1 The following error i get 1. it warns me to add a patch. perl5.005_03/ext/Dynaloader/dl_aix.xs.orig Fri Mar 3 17:00:58 2000 +++perl5.005_03/ext/Dynaloader/dl_aix.xs Fri Mar 3 17:00:58 2000 ... code . (Note: I don't have any "ext" directory. and i have installed perl from binary file.) Do I need this patch. If i do how to get this or where to add these lines. 2. it gives "apxs: Error: /usr/HTTPServer/bin/@TARGET@ not found or not executable" . is there any worng with my apxs file. do i have to add some thing in my apxs file? if i run make command after this. 1. It can't locate include library ( i have solved this by editing Makefile in ./apaci/Makefile) 2. It complains about target and stops. Can You help me? Thanks Azam
Re: perl session management
On 27 Mar 2001, tom joseph wrote: Hello there.. Could u suggest a way to update a session variable. At present it is not possible for me to update a session variable from any other page. I thought it would be automatically updated when i do a new insertion into the session variable which in my case is a hash. Is there any other way. Could anyone please help. I am using the module Apache::Session::MYSQL. You don't give us much to go on, but I'll give it a shot. I seem to remember that Apache::Session only does a very quick check to see if anything has changed in the session object. Here is an excerpt from the Docs: Note that Apache::Session does only a shallow check to see if anything has changed. If nothing changes in the top level tied hash, the data will not be updated in the backing store. You are encouraged to timestamp the session hash so that it is sure to be updated. So if all you are doing is changing one of the values in your hash, then Apache::Session will not see a change and will not rewrite the entry to the database. Cees
Re: ASP / Apache
Apache::ASP is much better software than original ASP. More functionality and freedom. For me, Apache::ASP was perfect start point for ride from MS technologies to rich GNU world (Perl, Apache, Unix). We wrote about 40 projects with Apache::ASP For big projects we use native Apache Perl modules with Template-Toolkit now, but for common projects among embedding scripting techniques Apache::ASP is perfect tool. - Sergey Polyakov aka "BeerBong" Chief of WebZavod http://www.webzavod.ru Tel. +7 (8462) 43-93-85 | +7 (8462) 43-93-86 mailto:[EMAIL PROTECTED] - Original Message - From: "Joshua Chamas" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: "Mod Perl" [EMAIL PROTECTED] Sent: Tuesday, March 27, 2001 11:55 PM Subject: Re: ASP / Apache Samuel Lellouche wrote: I'm planning on porting a website w/ ASP pages, from an IIS server, to an Apache Server... Well the model is similar, but there is no support for VBScript. I'd be happy to give a go a writing a VBScript emulation layer which could help your port but I'll need a site's source to base my work on, will you volunteer yours? Does Apache::ASP work well ? Yes. It has the original ASP API mostly implemented, as well as extra features like: More Events http://www.apache-asp.org/events.html Custom Tags w/XMLSubs http://www.apache-asp.org/xml.html HTML Compression http://www.apache-asp.org/config.html#CompressGzip Auto FormFill http://www.apache-asp.org/config.html#FormFill Site Errors Emailed http://www.apache-asp.org/config.html#MailErrorsTo Cookieless Sessions http://www.apache-asp.org/config.html#Cookieless%20Sessions Its also very fast, you can download a benchmark suite I wrote for comparing Apache development environments at: http://www.chamas.com/bench/hello.tar.gz Note the h2000 benchmarks are more indicative of real world performance, as it tries to measure the runtime speed. Does Anyone have good experiences whit it ? Yes, I'm the author so I'm biased. You might contact admins running the sites listed at: http://www.apache-asp.org/sites.html Skip chamas.com nodeworks.com as those are my sites. Does Apache::ASP interacts with SQLServer or MySql ? Check out this faq on database support: http://www.apache-asp.org/faq.html#How%20is%20database%20connectivity%20hand led%3F Also note that DBD::Sybase is probably the way to go to get to a MS SQLServer. They both share a common code base, and that driver is reputed to work. Lots of people use DBD::mysql, including myself, and its very fast. Should you got that route DBD::Oracle is very robust. Best of luck. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051