Re: Apache::UploadMeter
I had some problems with my server-configuration (httpd.conf) but now it works perfect. Thanks to Issac for the fast help and the cool module. Hope this gets you started, Issac
Apache::UploadMeter
Hi there, I want to use the Apache-UploadMeter. I set my configuration to: -use Apache::UploadMeter;$Apache::UploadMeter::UploadForm='/formtag.htm';$Apache::UploadMeter::UploadScript='/perl/upload.pl';$Apache::UploadMeter::UploadMeter='/meter';$Apache::UploadMeter::DEBUG = 2;Apache::UploadMeter::configure;- The UploadMeter works perfect - but I don´t know how I can catchthe files within upload.plMy Uploadform has 2 Uploadfields (file1 and file2) an some hidden-fields (which I need to know where the files to store)In my upload.pl I have the follwing Code to Test something: -use Apache ();use Apache::Request ();$apr = Apache::Request-new($r);foreach $parm($apr-param){print "-".$parm." : ".$apr-param($parm)."\n";}print "-\n";- The system it´s running on : RedHat 7.3 / Apache 1.3.27 / mod_perl 1.26 / Perl 5.6.1Apache::Request 1.1 / Apache::UploadMeter 0.22 But the only value I get is the "hook_id" and this is a GET value.How can I get the POST values ?I´m on the beginning with mod_perl - the last time I used Perl and the CGI.pm Can someone show me an example of a "upload.pl" where a file is stored on the server please?
Re: Apache::UploadMeter
Thanks - I´ll try it and send response. I´ve read all readme-files and the build-in manual but I did´nt find something about that I have to use instance()... - Original Message - From: Issac Goldstand [EMAIL PROTECTED] To: Sven [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 3:21 PM Subject: Re: Apache::UploadMeter Sven wrote... [snip] - use Apache (); use Apache::Request (); $apr = Apache::Request-new($r); foreach $parm($apr-param){ print -.$parm. : .$apr-param($parm).\n; } print -\n; - First of all, use instance() instead of new(). I believe the documentation for Apache::UploadMeter mentions this. [snip] Can someone show me an example of a upload.pl where a file is stored on the server please? Sure. Here is the response handler for the testbed for Apache::UploadMeter at http://epoch.beamartyr.net/umtest/form.html package ApacheUploadMeterTest; use Apache::Request; use Apache::Constants qw(OK DECLINED); use CGI::Carp qw(fatalsToBrowser); use Data::Dumper; sub handler { my $r=shift; my $q=Apache::Request-instance($r, POST_MAX=2097152); # Actually, the above line doesn't work - POST_MAX will be a parameter to # Apache::UploadMeter in future releases local($|)=1; my $num=0; print PART1; Content-Type: text/html HTML HEAD TITLEApache::UploadMeter Test Module/TITLE /HEAD BODY H1Upload Complete/H1 PART1 foreach my $upload ($q-upload) { $num++; my $name=$upload-name; my $size=$upload-size; my $filename=$upload-filename; my $type=$upload-type; my $info=Dumper($upload-info); my $tempname=$upload-tempname; print EOP UL LIUpload field: $num/LI LIDetected upload field: $name/LI LIDetected filename: $filename ($size bytes)/LI LIReported MIME type: $type/LI LISpool file: $tempname/LI LIOther debug info: $info/LI /UL EOP } print /BODY/HTML\n; return OK; } 1; Hope this gets you started, Issac
Re: Best compression for mod_perl application?
Hi Nigel, I had the same question three month ago. There are a few sources which compare the different modules. See mod_perl guide. My solution is now mod_deflate 1.0.18 with apache 1.3.27. My configuration in httpd.conf is: # activate compress IfModule mod_deflate.c # main switch DeflateEnable on DeflateMinLength1024 DeflateCompLevel8 # compress over proxies DeflateProxied on # switch off MSIE 4.x - has bugs DeflateDisableRange MSIE 4. # experimentell - for uploads DeflateVary on # DeflateHTTP 1.1 # default # activate for HTTP 1.0 DeflateHTTP 1.0 # DeflateTypestext/html # default # add more content types for compression DeflateTypestext/css DeflateTypestext/plain DeflateTypestext/rtf DeflateTypestext/xml DeflateTypestext/javascript DeflateTypesimage/vnd.dwg DeflateTypesimage/vnd.dxf DeflateTypesapplication/msword DeflateTypesapplication/vnd.hp-HPGL DeflateTypesapplication/vnd.ms-access DeflateTypesapplication/vnd.ms-excel DeflateTypesapplication/vnd.ms-powerpoint DeflateTypesapplication/vnd.ms-project DeflateTypesapplication/vnd.visio DeflateTypesapplication/x-javascript # pdf does no work # DeflateTypesapplication/pdf /IfModule I hope that helps you. Regards, Sven. Am Die, 2003-07-01 um 17.02 schrieb Slava Bizyayev: Apache::Dynagzip is not supposed to work on Apache-2. That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Thanks, Slava - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: Bill Marrs [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 9:56 AM Subject: Re: Best compression for mod_perl application? HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
This is one of the source I had in mind. Well done Slava. BTW. Do you consider the latest version of mod_deflate? Regardsm Sven. Am Die, 2003-07-01 um 18.12 schrieb Slava Bizyayev: And how about http://devl4.outlook.net/devdoc/FAQ/compression.html for Apache 1.3.27? ;-) Slava - Original Message - From: Sven Geisler [EMAIL PROTECTED] To: Nigel Hamilton [EMAIL PROTECTED]; Slava Bizyayev [EMAIL PROTECTED] Cc: Bill Marrs [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 10:48 AM Subject: Re: Best compression for mod_perl application? Hi Nigel, I had the same question three month ago. There are a few sources which compare the different modules. See mod_perl guide. My solution is now mod_deflate 1.0.18 with apache 1.3.27. My configuration in httpd.conf is: # activate compress IfModule mod_deflate.c # main switch DeflateEnable on DeflateMinLength1024 DeflateCompLevel8 # compress over proxies DeflateProxied on # switch off MSIE 4.x - has bugs DeflateDisableRange MSIE 4. # experimentell - for uploads DeflateVary on # DeflateHTTP 1.1 # default # activate for HTTP 1.0 DeflateHTTP 1.0 # DeflateTypestext/html # default # add more content types for compression DeflateTypestext/css DeflateTypestext/plain DeflateTypestext/rtf DeflateTypestext/xml DeflateTypestext/javascript DeflateTypesimage/vnd.dwg DeflateTypesimage/vnd.dxf DeflateTypesapplication/msword DeflateTypesapplication/vnd.hp-HPGL DeflateTypesapplication/vnd.ms-access DeflateTypesapplication/vnd.ms-excel DeflateTypesapplication/vnd.ms-powerpoint DeflateTypesapplication/vnd.ms-project DeflateTypesapplication/vnd.visio DeflateTypesapplication/x-javascript # pdf does no work # DeflateTypesapplication/pdf /IfModule I hope that helps you. Regards, Sven. Am Die, 2003-07-01 um 17.02 schrieb Slava Bizyayev: Apache::Dynagzip is not supposed to work on Apache-2. That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Thanks, Slava - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: Bill Marrs [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 9:56 AM Subject: Re: Best compression for mod_perl application? HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Upgrading to perl 5.8.0 (newbie question)
Hi, mod_perl 1.27 is the latest stable version of mod_perl 1. You're fine. Regards, Sven. Am Mon, 2003-02-24 um 12.24 schrieb Gazi, Nasser (London): Hi, I have a server which has the following pre-installed on it: Apache/1.3.27 mod_perl/1.27 Perl/5.6.1 If I upgrade to Perl/5.8.0 will I have to upgrade mod_perl to a newer version as well? Thanks, NG
Re: array through pages
Hi koudjo, easy: use Storable qw(freeze thaw); use MIME::Base64 qw(encode_base64 decode_base64); # to encode use: $pass_throw_var = encode_base64(freeze(\@your_array)); ... # to decode use: $your_array_ref = thaw(decode_base64($pass_throw_var)); Regards Sven. Am Mon, 2003-01-13 um 10.26 schrieb koudjo ametepe: hello everybody thank you for al your request and suggests. I have a problem with array in perl cgi .I want to pass an array trhough two pages , just like we do with a simple varaiable ; but i can't find the way to do it . Please can you give me sme ideas about it Thank you koudjo _ MSN Search, le moteur de recherche qui pense comme vous ! http://search.msn.fr/worldwide.asp
Re: pre-spawning database connections[newbie]
Hi Ben, Do you use Apache::DBI? I mean yes because you're using connect_on_init. Apache::DBI do not really close your DBI connection. You will get the same connection with the same connection parameters, when you call DBI-connect. All connections are cached by Apache::DBI. Yes, you should call DBI-connect. Each sub process will get it's own connections. Regards Sven. Am Mon, 2003-01-13 um 13.08 schrieb Ben Wrigley: Hi All, I'm a mod_perl newbie and just trying to understand a little more about the startup.pl files and prespawning databases. I am using the connect_on_init routine in the startup.pl which is fine. What I'm not sure is then how to use this most economically in my scripts. It seems that in the scripts you should call the DBI-connect again, but that seems to be bypassing the connection I made at startup or am I misunderstanding completely. Thanks for your help Ben
Re: cookies and IE
Hi Alan, I guess your mistake is to send the refresh header as http header. You should use a meta tag in html or redirect in http. Sven. On Tue, 1 Oct 2002, Alan wrote: Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. I'm setting a cookie and then doing a redirect as follows: my $c = Apache::Cookie-new( $r, -name = 'userdata', -value = $cookie, -expires = '1d', -path = '/dealers' ); $r-content_type('text/html'); $c-bake; $r-header_out(Refresh=0;url=/dealers$request_uri); $r-no_cache(1); $r-send_http_header; $r-print( print_refresh_page_content() ); (print_refresh_page_content() just returns a string of authenticated) After the authenticated message is printed it should refresh back to the /dealers/ URL, except this time the handler will see there is a cookie and print out the real data, not a username/pass prompt. This works *perfectly* in mozilla linux, galeon, mozilla windows, and ie6 under windows XP. It *doesn't* work on ie 6 under win98, winME, or ie 5.5 run through crossover office. It displays the authenticated page, but then refreshes back to the login page. No cookie is set, but debug when setting the cookie shows the following: Set-Cookie=userdata=[data]; path=/dealers; expires=1d at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Refresh=0;url=/dealers/ at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Pragma=no-cache at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Cache-control=no-cache at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Connection=close at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Content-Type=text/html at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. Expires=Tue, 01 Oct 2002 18:30:31 GMT at /home/alan/code/rubberoven/mod_perl/Rubberoven/Dealer.pm line 139. This is the same that is printed out when a working browser gets cookies set. I've played around with the security settings, and even at the lowest setting, with IE set to prompt for any cookies, it won't even acknowledge that I'm trying to set a cookie. Anyone have any ideas/solutions/thoughts? -- Sven Geislere-mail: [EMAIL PROTECTED] Senior Developertel:(+49 30) 53 62 16 27
apache mod_perl compiled with gcc 3.1 or Intel C/C++?
Hi, has someone experiences in gcc 3.1 or Intel C/C++ compiler for apache, perl mod_perl on a production system with P4/XEON RedHat. At this time I use gcc 2.96. I heard with gcc 2.96 the code optimization for P4/XEON is not good. Any ideas? Sven. -- Sven Geislere-mail: [EMAIL PROTECTED] Senior Developertel:(+49 30) 53 62 16 27
modperl compile problems!
Hello! i try to build a apache with mod_perl and ActiveState Perl. The compiler stops always with the same error message, I tried several different ways which are described in the Readme docs, and I try the Apache Toolbox (automated apache build). I saw a thread which deals which the same question but there was not a solution (only some ideas). Hope somebody can help ;-) bye Here is my compile log: gcc -c -I.. -I/usr/local/ActivePerl-5.6/lib/5.6.1/i686-linux-thread-multi/CORE -I../os/unix -I../include -DLINUX=22 -DMOD_PERL -DUSE_PERL_SSI -DUSE_REENTRANT_API -D_POSIX_C_SOURCE=199506L -D_REENTRANT -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_HSREGEX -DNO_DL_NEEDED `../apaci` http_core.c In file included from /usr/include/sys/sem.h:28, from ../include/ap_config.h:495, from ../include/httpd.h:72, from http_core.c:61: /usr/include/sys/ipc.h:25: warning: #warning Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE http_core.c: In function `default_handler': http_core.c:3802: `caddr_t' undeclared (first use in this function) http_core.c:3802: (Each undeclared identifier is reported only once http_core.c:3802: for each function it appears in.) http_core.c:3802: parse error before `mm' http_core.c:3866: `mm' undeclared (first use in this function) make[3]: *** [http_core.o] Error 1 make[2]: *** [subdirs] Error 1 make[2]: Leaving directory `/data/INSTALL/APACHE/apache_1.3.24/src' make[1]: *** [build-std] Error 2 make[1]: Leaving directory `/data/INSTALL/APACHE/apache_1.3.24' make: *** [build] Error 2 -- Sven Sternberger Tel.: +49 (0) 40 8998 4397 Desy Email: [EMAIL PROTECTED] Notkestr. 85 D-22607 Hamburg
RE: modperl compile problems!
Hello! in the meantime i also solved the problem for me (hope it really works :-) I just compiled a perl source from cpan, and it worked, I don´t see any advantages in using the ActivePerl Binary in the moment. bye Am Mit, 2002-04-03 um 17.37 schrieb OCNS Consulting: Here's what I did: 1. Retrieve the latest build of the mod_perl at - http://cvs.apache.org/snapshots/modperl/ 2. Compile mod_perl outside of the Apache Source Tree, as described in file INSTALL.apaci; suggest - perl Makefile.PL USE_APXS=1 EVERYTHING=1 WITH_APXS=/usr/bin/apxs make make test make install 3. Compile Apache cd apache_1.3.23 and issue the following to configure APACHE make distclean env CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ SSL_BASE=/usr/local/ssl \ EAPI_MM=SYSTEM LIBS=-ltcl8.3 -lm -lpthread \ ./configure \ --verbose \ --server-uid=nobody \ --server-gid=nobody \ --enable-rule=EAPI \ --enable-rule=SHARED_CORE \ --enable-module=ssl \ --enable-module=status \ --enable-module=so \ --enable-module=headers \ --enable-module=info \ --enable-module=speling *** Note: You may or may not need the EAPI - Read the Documentation *** *** If not, then remove EAPI_MM=SYSTEM and --enable-rule=EAPI \ *** *** If not SSL then remove SSL_BASE=/usr/local/ssl \ and*** *** --enable-module=ssl \ *** make make install 4. Edit /usr/local/apache/conf/httpd.conf file; comment out - AddModule directives and remove and redundant loadModule directives. 5.Restart APACHE - /usr/local/apache/bin/apachectl start/restart RB -Original Message- From: Randy Kobes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 9:30 AM To: Sven Sternberger Cc: [EMAIL PROTECTED] Subject: Re: modperl compile problems! On 3 Apr 2002, Sven Sternberger wrote: Hello! i try to build a apache with mod_perl and ActiveState Perl. The compiler stops always with the same error message, I tried several different ways which are described in the Readme docs, and I try the Apache Toolbox (automated apache build). I saw a thread which deals which the same question but there was not a solution (only some ideas). gcc -c -I.. -I/usr/local/ActivePerl-5.6/lib/5.6.1/i686-linux-thread-multi/CORE -I../os/unix -I../include -DLINUX=22 -DMOD_PERL -DUSE_PERL_SSI -DUSE_REENTRANT_API -D_POSIX_C_SOURCE=199506L -D_REENTRANT -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_HSREGEX -DNO_DL_NEEDED `../apaci` http_core.c In file included from /usr/include/sys/sem.h:28, from ../include/ap_config.h:495, from ../include/httpd.h:72, from http_core.c:61: /usr/include/sys/ipc.h:25: warning: #warning Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE http_core.c: In function `default_handler': http_core.c:3802: `caddr_t' undeclared (first use in this function) http_core.c:3802: This has come up before - at least one person found that building mod_perl as a dso outside of the Apache source tree, as described at the end of INSTALL.apaci in the mod_perl sources, worked. best regards, randy kobes -- Sven Sternberger Tel.: +49 (0) 40 8998 4397 Desy Email: [EMAIL PROTECTED] Notkestr. 85 D-22607 Hamburg