Re: Another Perl/Apache question
On Wed, 29 Aug 2001, Mathew Benson wrote: Hi, I know you helped me before, but I had to rebuild my server and now I'm having the same problem as before. I changed my ServerName directive to the correct IP address (I don't have a DNS name). These are the only other changes I made to httpd.conf: # FOR MOD_PERL: PerlModule Apache::Registry KeepAlive Off Alias /dm/ /var/www/html/dm/ Location /dm SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all PerlSendHeader On /Location Redirect /demarc http://10.1.6.42/dm/demarc Looks quite sound to me... I originally tried making the changes you suggested before, but that didn't do anything. The source code still came straight through. Which source code shows up? Your DirectoryIndex script, or another file? (I suppose a perl-source, not the html-source, otherwise you need to check mime-types) I know the perl script works, because I can run it from the console. After playing with things I was able to get the browser to sit there for a few seconds, and display a server error message. According to their documentation I skimmed, using mod_perl is optional. Perhaps you might want to run it on plain mod_cgi to test it all out? Once it runs through the web, then throw in mod_perl again. What modifications did you made, what were the resulting http-errors, and what was the error.log telling you when you were playing around? I've since learned that the documentation from the www.demarc.org site on installing the software is lacking and very problematic. One change I had to make was to the base html directory. Their instructions say that it would be /usr/local/www/, but on my machine it was /var/www/html/. You could try a grep on their code to check for the /local/www/ path, they could have some nasty hard-coded ones (they probably won't be the first)... The strangest thing is when I tried to hit http://10.1.6.42/demarc, I got a bunch of pop ups saying something about the server sending a certificate. I was browsing the page from my Linux box and the text is very small and hard to read, so I just kept clicking Ok and Next. It finally redirected to http://10.1.6.42/dm/demarc, but wound up with the same server error. I didn't setup https, so I don't understand why it would have sent the browser a certificate. What is the result when you requested the document directly (like with telnet or a lwp-request). This should turn out to be a redirect response. Try every followiung request manually in the same, since brwosers might do _lot's_ of things you hardly notice. Any help would be much appreciated. I'm helping somebody else install the same software, so I imagine he's going to run into same problem and I'd like to be able help him through it. Bye, Remco P.S: Please use the mod_perl maillinglist as addressee or at least as CC, since more people will read it and can be able to help you solve your problem, thus including more expertism. This might lead to faster / better help.
Re: $r-args()
Robert Landrum writes: sub escaped { my $val = shift; $val =~ s/(\W)/sprintf(%%%.2X,ord($1))/g; return $val; } my $content = join('',map{$_.=.escaped($r-param($_))}($r-param)); my $internal_url = /some/path/to/handler?$content; $r-internal_redirect($internal_url); Isn't it considered good practice to use Apache::Util::escape_uri() on the constructed URI or URI::Escape::uri_escape() instead of writing one's one character escaping routines? For one, it should be faster, especially the Apache::Util method as it is written in C.
Compile problem w/ mod_perl-1.26 apache_1.3.20
I'm getting this error when I make mod-perl. I'm running on TurboLinux 5.0. I'd appreciate any info on why this is failing. (cd ../apache_1.3.20 PERL5LIB=/home/software/mod_perl-1.26/lib make) make[1]: Entering directory `/home/software/apache_1.3.20' === src make[2]: Entering directory `/home/software/apache_1.3.20' make[3]: Entering directory `/home/software/apache_1.3.20/src' === src/regex make[4]: Nothing to be done for `all'. === src/regex === src/os/unix make[4]: Nothing to be done for `all'. === src/os/unix === src/ap make[4]: Nothing to be done for `all'. === src/ap === src/main make[4]: Nothing to be done for `all'. === src/main === src/lib === src/lib === src/modules === src/modules/standard make[5]: Nothing to be done for `all'. === src/modules/standard === src/modules/perl I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [mod_perl.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [perlxsi.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [perl_config.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [perl_util.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [perlio.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [mod_perl_opmask.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [Apache.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [Constants.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [Connection.o] Error 127 (ignored) I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [Server.o] Error 127 (ignored)
internal redirect with byterange (was: open downloaded file)
Hello again I'm still having troubles delivering my pdf-files ... I'm using the code-snippets Geoffrey Young gave me, but i need to use an internal redirect, because i provide the files with better (longer) filenames. I can't find any tutorials or example-code for it, so I hope you guys can help me ... so what I'm actually doing is: initial request: - check permissions - search the filename of the filesystem - if it is not a static file: generate deliever file - otherwise: make an internal redirect to the specific file handle the internal redirect: - generating header - deliver file (if necessary with byterange ...) this looks approx. like this: if ($r-is_initial_req) { if (static ()) { $r-internal_redirect (newfilename); } else { $r-send_header (); $r-send_fd($fh); }; } else { $s-headers_out-set('Accept-Ranges' = 'bytes'); $r-headers_out-set(Content-Disposition = inline; filename=$name); my $size = stat($file)-size; $r-set_content_length($size); $r-content_type($contenttypes{$type}); # determine if the request is a range request my $range_request = $r-set_byterange; # yea or nea if ((my $status = $r-meets_conditions) == OK) { $r-send_http_header; } else { return $status; } my $fh = IO::File-new($file); # handle a range request properly if (($type eq 'pdf') $range_request) { while( my($offset, $length) = $r-each_byterange) { seek $fh, $offset, 0; $r-send_fd($fh, $length); } } else { $r-send_fd($fh); }; $fh-close(); return DONE; } My problem is now, that i know not exactly what i should return if i make an internal_redirect and what i have to return handling this internal_redirect accessing a file like this results in the access-log in: [30/Aug/2001:17:13:13 +0200] GET /files/sid00017/AR_1000A-TSS_report-TSS.PDF HTTP/1.1 200 32768 https://ida.festbrueder.ch/site/files.pl?siteid=17; Mozilla/4.0 (compatible; MSIE 5.01; Windows [30/Aug/2001:17:13:14 +0200] GET /files/sid00017/AR_1000A-TSS_report-TSS.PDF HTTP/1.1 200 40960 - Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)195.141.44.1 - - [30/Aug/2001:17:13:14 +0200] GET /files/sid00017/AR_1000A-TSS_report-TSS.PDF HTTP/1.1 206 397776 - Mozilla/4.0 (compatible; MSIE 5.01; Windows NT) All three entries comes out of an access to one file ... *?* am i doing this right? Il'd be very thankfull if you could help me inhere ... I'm really in trouble with this, and i won't loose my pleasure using mod_perl ;-) Thank you very much in advance!! Thomas Bach think karo.. www.bkaro.net
Re: Compile problem w/ mod_perl-1.26 apache_1.3.20
On Thu, 30 Aug 2001, Scott Chapman wrote: I'm getting this error when I make mod-perl. I'm running on TurboLinux 5.0. I'd appreciate any info on why this is failing. I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 -DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [mod_perl.o] Error 127 (ignored) looks like a broken Makefile. How did you configure mod_perl? Did you follow the instructions as per http://perl.apache.org/guide/installation.html ? _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
RE: internal redirect with byterange (was: open downloaded file)
accessing a file like this results in the access-log in: [30/Aug/2001:17:13:13 +0200] GET /files/sid00017/AR_1000A-TSS_report-TSS.PDF HTTP/1.1 200 32768 https://ida.festbrueder.ch/site/files.pl?siteid=17; Mozilla/4.0 (compatible; MSIE 5.01; Windows [30/Aug/2001:17:13:14 +0200] GET /files/sid00017/AR_1000A-TSS_report-TSS.PDF HTTP/1.1 200 40960 - Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)195.141.44.1 - - [30/Aug/2001:17:13:14 +0200] GET /files/sid00017/AR_1000A-TSS_report-TSS.PDF HTTP/1.1 206 397776 - Mozilla/4.0 (compatible; MSIE 5.01; Windows NT) All three entries comes out of an access to one file ... *?* am i doing this right? yes, that's right - this is how your browser plugin handles byterange requests, usually by terminating the current request and initiating a new one with the appropriate Range headers. last time I checked Netscape ended up with 2 requests and MSIE with 3. that final request ought to be a 206, though. add a PerlLogHandler that spits out $r-as_string (such as Apache::DumpHeaders or Apache::DebugInfo) to see what is really going on. fear not - Apache detects the closed connection and all writes to the wire are changed into noops, meaning your handler will still run but not send any data to the client. sounds strange, but the point of Range requests was to reduce bandwith, not the processes of your server ;) other than that, your code looks ok on first glance. what this the only problem? HTH --Geoff --Geoff
Re: Compile problem w/ mod_perl-1.26 apache_1.3.20
Stas, I just do an Install.simple: [root@river mod_perl-1.26]# perl Makefile.PL DO_HTTPD=1 USE_APACI=1 APACHE_PREFI X=/www Will configure via APACI cp apaci/Makefile.libdir ../apache_1.3.20/src/modules/perl/Makefile.libdir cp apaci/Makefile.tmpl ../apache_1.3.20/src/modules/perl/Makefile.tmpl cp apaci/README ../apache_1.3.20/src/modules/perl/README cp apaci/configure ../apache_1.3.20/src/modules/perl/configure cp apaci/libperl.module ../apache_1.3.20/src/modules/perl/libperl.module cp apaci/mod_perl.config.sh ../apache_1.3.20/src/modules/perl/mod_perl.config.sh cp apaci/load_modules.pl ../apache_1.3.20/src/modules/perl/load_modules.pl cp apaci/find_source ../apache_1.3.20/src/modules/perl/find_source cp apaci/apxs_cflags ../apache_1.3.20/src/modules/perl/apxs_cflags cp apaci/perl_config ../apache_1.3.20/src/modules/perl/perl_config cp apaci/mod_perl.exp ../apache_1.3.20/src/modules/perl/mod_perl.exp PerlDispatchHandler.disabled (enable with PERL_DISPATCH=1) PerlChildInitHandlerenabled PerlChildExitHandlerenabled PerlPostReadRequestHandler..disabled (enable with PERL_POST_READ_REQUEST=1) PerlTransHandlerdisabled (enable with PERL_TRANS=1) PerlHeaderParserHandler.disabled (enable with PERL_HEADER_PARSER=1) PerlAccessHandler...disabled (enable with PERL_ACCESS=1) PerlAuthenHandler...disabled (enable with PERL_AUTHEN=1) PerlAuthzHandlerdisabled (enable with PERL_AUTHZ=1) PerlTypeHandler.disabled (enable with PERL_TYPE=1) PerlFixupHandlerdisabled (enable with PERL_FIXUP=1) PerlHandler.enabled PerlLogHandler..disabled (enable with PERL_LOG=1) PerlInitHandler.disabled (enable with PERL_INIT=1) PerlCleanupHandler..disabled (enable with PERL_CLEANUP=1) PerlRestartHandler..disabled (enable with PERL_RESTART=1) PerlStackedHandlers.disabled (enable with PERL_STACKED_HANDLERS=1) PerlMethodHandlers..disabled (enable with PERL_METHOD_HANDLERS=1) PerlDirectiveHandlers...disabled (enable with PERL_DIRECTIVE_HANDLERS=1) PerlTableApidisabled (enable with PERL_TABLE_API=1) PerlLogApi..disabled (enable with PERL_LOG_API=1) PerlUriApi..disabled (enable with PERL_URI_API=1) PerlUtilApi.disabled (enable with PERL_UTIL_API=1) PerlFileApi.disabled (enable with PERL_FILE_API=1) PerlConnectionApi...enabled PerlServerApi...enabled PerlSectionsdisabled (enable with PERL_SECTIONS=1) PerlSSI.disabled (enable with PERL_SSI=1) Will run tests as User: 'nobody' Group: 'root' (cd ../apache_1.3.20 CC=cc CFLAGS= -fno-strict-aliasing -D_LARGEFILE_SOURC E -D_FILE_OFFSET_BITS=64 ./configure --activate-module=src/modules/perl/libperl .a --disable-rule=EXPAT --prefix=/www) Configuring for Apache, Version 1.3.20 + using installation path layout: Apache (config.layout) + activated perl module (modules/perl/libperl.a) Creating Makefile Creating Configuration.apaci in src + id: mod_perl/1.26 + id: Perl/v5.6.0 (linux) [perl] modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory Creating Makefile in src + configured for Linux platform + setting C pre-processor to cc -E + checking for system header files + adding selected modules o perl_module uses ConfigStart/End + mod_perl build type: OBJ + setting up mod_perl build environment + adjusting Apache build environment + checking sizeof various data types + doing sanity check on compiler and options Creating Makefile in src/support Creating Makefile in src/regex Creating Makefile in src/os/unix Creating Makefile in src/ap Creating Makefile in src/main Creating Makefile in src/modules/standard Creating Makefile in src/modules/perl Checking CGI.pm VERSION..ok Checking for LWP::UserAgent..failed Can't locate LWP/UserAgent.pm in @INC (@INC contains: ./lib /usr/local/lib/perl5 /5.6.0/i586-linux /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6. 0/i586-linux /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .) at Makefile.PL line 1136. The libwww-perl library is needed to run the test suite. Installation of this library is recommended, but not required. Checking for HTML::HeadParserok Writing Makefile for Apache Writing Makefile for Apache::Connection Writing Makefile for
Apache::Session::File and free memory weirdness
Hi All - I'm running Apache, mod_perl and HTML::Mason on Solaris 2.6, and using Apache::Session::File for session management. I've been monitoring free memory as reported by top, and I'm seeing some behavior that is totally baffling me. (If you're interested, there's a graph at: http://www.furph.com/graph.png) Here's the scenario: Around 6 AM, when things are relatively quiet, the graph shows about 1.3GB free memory (out of 4GB total). As traffic picks up during the course of the day, free memory drops to about 300MB by 3 or 4 PM. So far so good, no big surprise - there's a lot more httpd processes running so you'd expect more memory in use. Odd thing #1: As it gets into evening time, load on the machine drops off and there are fewer httpd children running, but I am not seeing free memory return to that 1.3GB level. At most it comes back up to 400MB or so. I don't think the httpd children are hanging on to memory, because they cycle through pretty quickly - MaxRequestsPerChild is set to 512 and none of the processes are ever more than a couple minutes old when I look in. Is there any reason to think the parent httpd process would hang on to anything? Odd thing #2: (This part seems most bizarre to me.) At 5:15 AM, we run a Perl script that finds and deletes Apache::Session::File session and lock files that are older than 28 days. Usually there are about 50,000 old files that get deleted out of about 2,300,000 total. Almost immediately, free memory on the machine jumps back up to 1.3GB. What's up with that? If I run the script during the middle of the day, when things are busier, I still see the free memory jump up although not all the way to 1.3GB - maybe to 800MB or so. Because of the rate the httpd children cycle, I don't think it's possible any of them could be holding open filehandles to session files that haven't changed for 28 days. Is there something weird about the way top reports free memory? The numbers I get seem consistent with the free column from vmstat. Why would deleting a bunch of files free up 1GB of memory? Any ideas or explanations would be much appreciated! Thanks! Larry Leszczynski [EMAIL PROTECTED]
Re: Apache::Session::File and free memory weirdness
Odd thing #1: As it gets into evening time, load on the machine drops off and there are fewer httpd children running, but I am not seeing free memory return to that 1.3GB level. At most it comes back up to 400MB or so. I don't think the httpd children are hanging on to memory, because they cycle through pretty quickly - MaxRequestsPerChild is set to 512 and none of the processes are ever more than a couple minutes old when I look in. Is there any reason to think the parent httpd process would hang on to anything? I have noticed that over time the new processes will spawn with less memory shared. I'm not sure exactly why this is, but it does seem to happen. A nightly complete restart of the server will reset things, but you may not have that option. Odd thing #2: (This part seems most bizarre to me.) At 5:15 AM, we run a Perl script that finds and deletes Apache::Session::File session and lock files that are older than 28 days. Usually there are about 50,000 old files that get deleted out of about 2,300,000 total. Almost immediately, free memory on the machine jumps back up to 1.3GB. What's up with that? Sounds like you're counting the buffers and cache in your used memory. Depending on what OS you're on, you may want to look at a tool other than top. The memory used for buffers and cache will be available to applications if they need it. - Perrin
mod_perl build
Hello, I am wondering whether there is a way of knowing how mod_perl was built? I have inhereted a box with mod_perl configured. Thanks -r
RFC: Apache::FileMan 0.07d
I have updated Apache::FileMan.pm to pre-release version 0.07d. I substantially reorganized to code. FileMan provides a file manager for a web sites through a web browser. It is an extensive rewrite of the Apache::AutoIndex.pm module (written by Philippe M. Chiasson), which in turn was a remake of the autoindex Apache C module. FileMan can provide the same functionality as AutoIndex.pm, so it can be used to both to navigate and manage a web site. This update includes HTML frame support, import of arbitrary menu commands, and the HOLD directory was restructured to allow it to manage any directory on the web server. The source is available at: http://www.xorgate.com/FileMan A demo is also available. I need help from others to fill in the FileMan.dic file for Apache::Language with the language phrases. I included all the English entries. I would like to release FileMan to CPAN. Please provide any comments, suggestions, or feedback. Thanks
Re: mod_perl memory consumption
[EMAIL PROTECTED] (Perrin Harkins) wrote: I guess that DBI gets all records if you use fetchall_array|hashref and that it is else OK. No, the behavior that I saw was when fetching a row at a time. Behind the scenes, DBI would fetch ALL the rows into RAM and then iterate over them. This may have been changed since then. It was a couple of years ago. It's still true, mysql will fetch all records at once, whether you ask for them or not. You can control it with mysql_(use|store)_result, which is documented as a feature so I think it's not going away anytime soon. mysql_store_result/mysql_use_result determine whether or not the server sends all the rows to the client at once, or one at a time as the client asks for them. mysql_store_result is therefore more memory intensive for the client (which must hold the entire result set). mysql_use_result is less memory intensive for the client, which needs memory only for one row at a time, but can cause other processes trying to use the server to block, because the tables from which you're retrieving rows are read-locked for the duration of the query (that is, until the client actually fetches the last row). ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: Apache::Session::File and free memory weirdness
Perrin Harkins wrote: Odd thing #1: As it gets into evening time, load on the machine drops off and there are fewer httpd children running, but I am not seeing free memory return to that 1.3GB level. At most it comes back up to 400MB or so. I don't think the httpd children are hanging on to memory, because they cycle through pretty quickly - MaxRequestsPerChild is set to 512 and none of the processes are ever more than a couple minutes old when I look in. Is there any reason to think the parent httpd process would hang on to anything? I have noticed that over time the new processes will spawn with less memory shared. I'm not sure exactly why this is, but it does seem to happen. A nightly complete restart of the server will reset things, but you may not have that option. I have noticed this also. I have a theory about its cause, but I haven't had the free time to hack with it yet. My theory is that when the VM subsystem swaps pages of the mod_perl parent process, those pages become forever unshared (even after they return to memory from swap). So I was going to test the mlockall() Linux system call to see if it made a difference. (Search the archives for mlockall). However, I am using the Linux platform - the VM behavior may be totally different on Solaris. If anyone else has some time to play with mlockall() on Linux, I'd like to know the results. It'll be a few more weeks till I get a chance. -Adi
Re: mod_perl memory consumption
Paul DuBois wrote: mysql_store_result/mysql_use_result determine whether or not the server sends all the rows to the client at once, or one at a time as the client asks for them. mysql_store_result is therefore more memory intensive for the client (which must hold the entire result set). mysql_use_result is less memory intensive for the client, which needs memory only for one row at a time, but can cause other processes trying to use the server to block, because the tables from which you're retrieving rows are read-locked for the duration of the query (that is, until the client actually fetches the last row). For more information see Paul's great book 'MySQL' (New Riders), p257-259. If you're not lucky enough to have the book, there's a brief description here: http://perl.apache.org/guide/databases.html#mysql_use_result_vs_mysql_store
Re: mod_perl memory consumption
At 2:55 PM +1000 8/31/01, Jeremy Howard wrote: Paul DuBois wrote: mysql_store_result/mysql_use_result determine whether or not the server sends all the rows to the client at once, or one at a time as the client asks for them. mysql_store_result is therefore more memory intensive for the client (which must hold the entire result set). mysql_use_result is less memory intensive for the client, which needs memory only for one row at a time, but can cause other processes trying to use the server to block, because the tables from which you're retrieving rows are read-locked for the duration of the query (that is, until the client actually fetches the last row). For more information see Paul's great book 'MySQL' (New Riders), p257-259. If you're not lucky enough to have the book, there's a brief description here: http://perl.apache.org/guide/databases.html#mysql_use_result_vs_mysql_store Note that the documentation at this link uses the notation mysql_store_result() and mysql_use_result(), as though these things are functions. They aren't. They're statement handle attributes, typically accessed like this: $sth-{mysql_store_result} = 1 or 0 $sth-{mysql_use_result} = 1 or 0
Re: Compile problem w/ mod_perl-1.26 apache_1.3.20
On Thu, 30 Aug 2001, Scott Chapman wrote: Stas, I just do an Install.simple: [root@river mod_perl-1.26]# perl Makefile.PL DO_HTTPD=1 USE_APACI=1 APACHE_PREFI X=/www Will configure via APACI [snip] cp apaci/perl_config ../apache_1.3.20/src/modules/perl/perl_config ^^ the file is copied all right [snip] Creating Makefile Creating Configuration.apaci in src + id: mod_perl/1.26 + id: Perl/v5.6.0 (linux) [perl] modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory You probably have a wrong path to perl in the first line of ./modules/perl/perl_config, that's what the error message says (I know it's not very clear from the error message, but it's a perl's error). noticed the errors: modules/perl/mod_perl.config.sh: ./modules/perl/perl_config: No such file or directory ?? Scott On 30 Aug 2001, at 23:38, Stas Bekman wrote: On Thu, 30 Aug 2001, Scott Chapman wrote: I'm getting this error when I make mod-perl. I'm running on TurboLinux 5.0. I'd appreciate any info on why this is failing. I/usr/local/lib/perl5/5.6.0/i586-linux/CORE -DMOD_PERL_VERSION=\1.26\ -DMOD_PERL_STRING_VERSION=\mod_perl/1.26\ -DNO_PERL_DISPATCH=1 -DNO_PERL_POST_READ_REQUEST=1 -DNO_PERL_TRANS=1 -DNO_PERL_HEADER_PARSER=1 -DNO_PERL_ACCESS=1 -DNO_PERL_AUTHEN=1 -DNO_PERL_AUTHZ=1 -DNO_PERL_TYPE=1 - DNO_PERL_FI /bin/sh: I/usr/local/lib/perl5/5.6.0/i586-linux/CORE: No such file or directory make[5]: [mod_perl.o] Error 127 (ignored) looks like a broken Makefile. How did you configure mod_perl? Did you follow the instructions as per http://perl.apache.org/guide/installation.html ? _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://localhost/ http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: mod_perl build
On Thu, 30 Aug 2001, Rasoul Hajikhani wrote: Hello, I am wondering whether there is a way of knowing how mod_perl was built? I have inhereted a box with mod_perl configured. http://perl.apache.org/guide/install.html#Discovering_Whether_Some_Option_ assuming that you have a pretty recent mod_perl you will get more satisfying results. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://localhost/ http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/