RE : Mod_perl Application Development
Check CGI::Application from CPAN, Very useful. It uses differents "Run Mode" for Application. Originally, it uses HTML::Template, but can be easily subclassed to use another Template System. We use it with Text::Template. Fred -Message d'origine- De : Jonathan Lonsdale [mailto:[EMAIL PROTECTED]] Envoyé : dimanche 18 août 2002 01:31 À : [EMAIL PROTECTED] Objet : Mod_perl Application Development I'm curious to know how people approach application development with mod_perl in situations where there could be dozens of distinct screens/interfaces. I'm currently using the HTML::Template system. Here's a few approaches I thought of: 1. Single monolithic content handler. Could be hard to maintain. 2. Distinct content handlers each with their own Location directive. Could be a pain to maintain the server config. 3. Take a small performance hit and use an Apache::Registry script for each screen to handle the content phase. Use 'PerlSetupEnv Off', $r and Apache:: modules and don't bother being backwardly compatible with CGI. Thanks, Jonathan
RE: load balancing on apache
Well, Linux Virtual Server is using ipchains (on the load balancer), and you can use any kind of OS on your real servers (those running your application), since it's only TCP/IP routing and/or forwarding. Fred -Message d'origine-De : Derek Jones [mailto:[EMAIL PROTECTED]]Envoyé : vendredi 14 décembre 2001 15:00À : Hemant Singh; [EMAIL PROTECTED]Cc : Derek G JonesObjet : RE: load balancing on apache Hi all, You can do load balancing using ipchains as well. Can't remember the program name offhand, but if I have time I'll look it up and let the list know. Only works if your servers are Linux of course. Kind regards Derek. --Derek Jones 1051, Bollinger Road,Tel: 717 359 8817 Littlestown,Mobile: 717 977 4556 PA, 17340, USAEmail: [EMAIL PROTECTED]AIM: scunacc
RE: load balancing on apache
With this amount of connections, you may want to check LVS at http://www.linuxvirtualserver.com or Ultra Monkey et http://ultramonkey.sourceforge.net/ (althought i never used the last one, I think it might be easier to use). This is open, efficient and reliable load balancing and high availability software. Using it, you just have to install several (common) apache server running your application, and tell the load-balancer to forward to one of the real servers. Nothing special to install exept an NFS or Coda service to share your Web sites. Fred -Message d'origine-De : Hemant Singh [mailto:[EMAIL PROTECTED]]Envoyé : vendredi 14 décembre 2001 09:51À : [EMAIL PROTECTED]Objet : load balancing on apache Hi All I am planning to host an application and its size is going to be big one , so expect the concurrent number of connection s to be around 2200.To combat the same , want to perform load sharing on 3-4 servers.So the ide is to put one machine on external IP and this machine , after receiving the requests would forward them to any of the other three machines having the application deployed and running on the same environment.Pls suggest how can i achieve this on apache. Thanks in advance Hemant
startup.pl for configuration
Hi, I would like to have a config file like /etc/mywebapp.conf where I would put all my modules configuration. Then I would have a WebApp::LoadConfig module that would run from startup.pl, and initialize my Perl modules default variables at Apache start. My config file would be some like : ### /etc/mywebapp.conf ### ### MyPackageOne::Default_Value_One = 1 MyPackageOne::Default_Value_One = 2 and my startup.pl would have : ### startup.pl WebApp::LoadConfig->run("/etc/mywebapp.conf") Of course,this means that i would have to use those modules whithin mod_perl only, or have to call that WebApp::LoadConfig->run("/etc/mywebapp.conf") at the begining of each console script that use those modules ... Would this be a good idea ? What do you think about? does somebody already use it ? Thanks, Fred
File Space Usage ... in perl ?
Hi, I'm wondering if there is a way to get exactly the same result of system fonction "du" in Perl. I need to know the disk Space tooken by a directory and it's sub-directory. To do that, I used the find method in File::Find to get the size (using -s file test) of each file and dir in a directory, recursivly. But the size I get is never the same as du ... why ? Both give a result in bytes, shouldn't it be the same ? #!/usr/bin/perl -w use strict;use File::Find; ###Subs ...## sub MyTraverseFolder # # Recursive Function#sub MyTraverseFolder($&) { my $dir = shift; my $wanted = shift; find($wanted, "$dir");} ## sub getsize()## modify the $main::size_value variable to add it the current # File::Find::name 's size in bytes;#sub getsize() {my $_size = -s $File::Find::name; $main::size_value += $_size; # debug it ... print sprintf("%d",(-s $File::Find::name)),"\t$File::Find::name\n";} ###Main ...# $main::size_value = 0; MyTraverseFolder("$ARGV[0]",\&getsize);print "Total size: [",sprintf("%d",($main::size_value)),"] \n"; For example on /etc , su gives 3552 kB, mydu gives 2882 kB !!! I did not find any module that was doing the du function . THanks for your help Fred
having several mod_perl virtualhosts on the same machine
Hi, i'am encouring problems with a machine that is hosting several completly independant modperl featured host. It is crashing without any apparent reason (nothing in the logs), and it seems to be a lack of memory (1 GB !). The only visual aspect is that it becomes impossible to login in via ssh after it has crashed. The reboot is necessary !!! My configuration is Linux 2.2.14, 1GB Memory, apache 1.3.12 modperl 1.24 Perl 5.6 There is no significant traffic over run due to the new sites added using modperl. At the begining, it was running 3 virtualhosts, everything was working fine for months ! As soon as I added 3 new virtualhosts, it starting crashing 2 or 3 times a week. I removed some of them that were not vital, and then it is crashing once a week . The httpd process is only 12 Mb big, I do not think it is too heavy , is it ? Is anybody having any advice ? I'm running out of ideas ... THanks a lot Fred
Re: open(FH,'|qmail-inject') fails
> Might be a faq, but why would open(FH,'|qmail-inject') fail with > fatal: read-error from within mod_perl? Use open MAIL, "| /var/qmail/bin/qmail-inject" or &die_html("test"); print MAIL "[your mail]"; close MAIL; I suppose you forgot the full path to qmail-inject ... Fred > > Thanks for your help. > >
Apache::Session : DBI->Too many connections
Hi , I am using Perl 5.6.0 whith MySql 3.22.32 , Apache 1.3.12 , modperl 1.24 . On our Production Server , Apache error logs are showing sometimes : [Thu Jun 8 14:53:34 2000] [error] DBI->connect failed: Too many connections at /usr/local/lib/perl5/site_perl/5.6.0/Apache/Session/ DBIStore.pm line 117 (in cleanup) DBI->connect failed: Too many connections at /usr/local/lib/perl5/site_perl/5.6.0/Apache/Session/DBIStore.pm li ne 117 Does Anybody knows how solve this ? THanks, Fred __ Sur WebMailS.com, mon adresse de courrier électronique gratuite. Service multilingue, sûr, et permanent. http://www.webmails.com/
Fwd: apache_1.3.12 / mod_perl-1.22 ... Bug in mod_perl 1.22 on certain platform ?
Hi Following to my last email, I tried to build apache_1.3.12 with mod_perl-1.21. And it worked well with the same makepl_args.mod_perl file . So does that mean that there is a bug in mod_perl-1.22 ? Or That my conf file had wrong arguments in it, even if I could build it on an other server (see my other email)? Fred - here is my make makepl_args.mod_perl file : #example makepl_args.mod_perl files #copy this file to $ENV{HOME}/.makepl_args.mod_perl and edit to taste #mod_perl's Makefile.PL will also look for this file in ./ ../ relative #to the mod_perl-x.xx source tree #EVERYTHING=1 will enable: #ALL_HOOKS=1 PERL_SSI=1 PERL_SECTIONS=1 #PERL_STACKED_HANDLERS=1 PERL_METHOD_HANDLERS=1 PERL_TABLE_API=1 EVERYTHING=1 #build against the first apache_x.xx source tree found, without prompts # DO_HTTPD=1 DO_HTTPD=1 #could tell Makfile.PL exactly where the source is # APACHE_SRC=/tmp/apache_x.xx/src APACHE_SRC=../apache_1.3.12/src #this would configure in mod_proxy, mod_unique_id, mod_info and mod_status # ADD_MODULE=proxy,usertrack,unique_id,info,status ADD_MODULE=info,status #if you wish to use a Configuration file other than what's in the #apache_x.xx/src directory # CONFIG=Configuration.custom #depending on your os and site_perl modules, see mod_perl's INSTALL # PERL_STATIC_EXTS=... #apache header files are installed by default, stop that if you wish # APACHE_HEADER_INSTALL=0 #Apache and Apache::Constants modules will be built as shared libraries # DYNAMIC=1 DYNAMIC=1 USE_APACI=1 APACI_ARGS=--enable-module=so #turn on mod_perl tracing # PERL_TRACE=1 #for perl.c's perl_destruct() which in run by mod_perl during child_exit #comment from perl.c: /* 0=none, 1=full, 2=full with checks */ #default level is 0 # PERL_DESTRUCT_LEVEL=2 #-add `-g' to EXTRA_CFLAGS #-turn on PERL_TRACE #-set PERL_DESTRUCT_LEVEL=2 #-link against libperld if -e $Config{archlibexp}/CORE/libperld$Config{lib_ext} # PERL_DEBUG=1 # #experimental features, use at own risk #but please report success or failure if you try #try to stop "Use of uninitialized value." with no line/filename info # PERL_MARK_WHERE=1 -- -- ======== | Frédéric Schwien | Administrateur WebMails.com | E-mail: [EMAIL PROTECTED] Solutions Internet/Intranet sécurisées" |http://www.igtech.fr |Centre de Formation Agréé |CheckPoint Software | 153, avenue Jean Lolive | 93500 Pantin | Tél: 33 (0) 1 56 96 01 23 | Fax: 33 (0) 1 56 96 01 33 |Votre Email gratuit et sécurisé : http://www.webmails.com
apache_1.3.12 / mod_perl-1.22 ... install crash !
Hi, I'm using apache_1.3.12 / mod_perl-1.22 , on Suse 6.1 . when I try to install modperl, when perl Makefile.PL, I get the result before. After that, I can't make && make test && make install : make test crashes at listening to the port 8529. I think I did everything recommended in mod_perl guide . ?? with the same makepl_args_mod_perl , I succeed in building it this afternoon on a Redhat 5.1 machine . We only difference is that the Redhat one is running perl version 5.005_3 , whereas the other one is running 5.005_2 . ANY IDEA ??? Thanks for your help, fred ## #/usr/local/src/mod_perl-1.22 > perl Makefile.PL Reading Makefile.PL args from ./makepl_args.mod_perl Will configure via APACI cp apaci/Makefile.libdir ../apache_1.3.12/src/modules/perl/Makefile.libdir cp apaci/Makefile.tmpl ../apache_1.3.12/src/modules/perl/Makefile.tmpl cp apaci/README ../apache_1.3.12/src/modules/perl/README cp apaci/configure ../apache_1.3.12/src/modules/perl/configure cp apaci/libperl.module ../apache_1.3.12/src/modules/perl/libperl.module cp apaci/mod_perl.config.sh ../apache_1.3.12/src/modules/perl/mod_perl.config.sh cp apaci/load_modules.pl.PL ../apache_1.3.12/src/modules/perl/load_modules.pl.PL cp apaci/find_source.PL ../apache_1.3.12/src/modules/perl/find_source.PL cp apaci/apxs_cflags.PL ../apache_1.3.12/src/modules/perl/apxs_cflags.PL cp apaci/mod_perl.exp ../apache_1.3.12/src/modules/perl/mod_perl.exp Will build Apache::* extensions dynamic PerlDispatchHandler.enabled PerlChildInitHandlerenabled PerlChildExitHandlerenabled PerlPostReadRequestHandler..enabled PerlTransHandlerenabled PerlHeaderParserHandler.enabled PerlAccessHandler...enabled PerlAuthenHandler...enabled PerlAuthzHandlerenabled PerlTypeHandler.enabled PerlFixupHandlerenabled PerlHandler.enabled PerlLogHandler..enabled PerlInitHandler.enabled PerlCleanupHandler..enabled PerlRestartHandler..enabled PerlStackedHandlers.enabled PerlMethodHandlers..enabled PerlDirectiveHandlers...enabled PerlTableApienabled PerlLogApi..enabled PerlUriApi..enabled PerlUtilApi.enabled PerlFileApi.enabled PerlConnectionApi...enabled PerlServerApi...enabled PerlSectionsenabled PerlSSI.enabled Will run tests as User: 'nobody' Group: 'root' (cd ../apache_1.3.12 && CC="cc" ./configure --activate-module=src/modules/perl/libperl.a --enable-module=so --enable-module=info --enable-module=status) Configuring for Apache, Version 1.3.12 + 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.22 + id: Perl/5.00502 (linux) [perl] 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 + enabling Perl support for SSI (mod_include) + using -ldl for vendor DSO support + 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/lib/expat-lite Creating Makefile in src/modules/standard Creating Makefile in src/modules/perl Checking CGI.pm VERSION..ok Checking for LWP::UserAgent..ok Checking for HTML::HeadParserok Checking if your kit is complete... Looks good apxs:Error: Sorry, no shared object support for Apache apxs:Error: available under your platform. Make sure apxs:Error: the Apache module mod_so is compiled into apxs:Error: your server binary `/usr/sbin/httpd'. Writing Makefile for Apache apxs:Error: Sorry, no shared object support for Apache apxs:Error: available under your platform. Make sure apxs:Error: the Apache module mod_so is compiled into apxs:Error: your server binary `/usr/sbin/httpd'. Writing Makefile for Apache::Connection apxs:Error: Sorry, no shared object support for Apache apxs:Error: available under your platform. Make sure apxs:Error: the Apache module mod_so is compiled into apxs:Error: your server binary `/usr/sbin/httpd'. Writing Makefile for Apache::Constants apxs:Error: Sorry, no shared object support for Apache apxs:Error: available under your platform. Make sure apxs:Error: the Apache module mod_so is compiled into apxs:Error: your server binary `/usr/sbin/httpd'. Writing Makefile for Apache::File Writing Makefile for Apache::Leak apxs:Error: Sorry, no shared object support for Apache apxs:Error: available under yo