MOD_PERL

Antonis Kanavouras ankan at med.auth.gr
Fri Sep 22 14:50:34 EEST 2000


Se enan 486 sta 100 pou kanei kai ton web server (xe xe,never mind. Gia to
traffic pou exei kai polys einai...) eipa toulaxiston na spidarw ligo ta
scripts vazontas mod_perl. Afou den eida orath diafora  eipa na kanw ena
benchmarking.

to script exei ws exhs: 

sto /home/httpd/cgi-bin/
-----------------------------------------------
#!/usr/bin/perl

use Benchmark;

$lala = new Benchmark;


print "Content-type:text/html\n\n\n";

for($i=0;$i<100000;$i++){
	$j=sin($i);
}	

$lolo = new Benchmark;                     
$diff = timediff($lolo, $lala);
if (exists  $ENV{MOD_PERL}){print "MOD_PERL OK<BR>";}
else{print "DEN TREXW ME MOD_PERL<BR>";}

print "Doylepsame:",timestr($diff,'all',"5.5f"),"\n";
----------------------------------------------------------
sto /home/httpd/cgi (to directory  pou dhlwsa sto mod perl)  yparxei to
idio script xwris to arxiko sheebang.

======APACHE CONFIGURATION======
Sto  httpd.conf :
---------------------------------
LoadModule perl_module        modules/libperl.so
AddModule mod_perl.c

Alias /cgi/   /home/httpd/cgi/
PerlRequire Benchmark.pm
PerlModule Apache::Registry
PerlHandler Apache::Registry


<Location /cgi>
 PerlSendHeader On
 SetHandler perl-script
 Options ExecCGI
</Location>
---------------------------------

sto access.conf
----------------------
ScriptAlias /cgi-bin/  /home/httpd/cgi-bin/

<Directory /home/httpd/cgi-bin>
 AllowOverride None
 Options ExecCGI
</Directory>
-----------------------
========================
Loipon...

marilena~$ lynx -dump marilena/cgi/test.pl

  MOD_PERL OK
  Doulepsame: 1 wallclock secs (1.67000 usr 0.00000 sys + 0.00000
  cusr 0.00000 csys = 0.00000 CPU)
----------------------------------------------------------------
marilena~$ lynx -dump marilena/cgi-bin/test.pl
  
  DEN TREXW ME MOD_PERL
  Doulepsame: 1 wallclock secs (1.64000 usr 0.00000 sys + 0.00000
  cusr 0.00000 csys = 0.00000 CPU)

Sta8era mou dinei kalyterous xronous xwris mod perl...
Pws dikaiologeitai? Vlepete tipota stravo  sta conf files ?

Antonis

--
Computers are useless.They can only give answers...

	Pablo Picasso



--
linux-greek-users mailing list -- http://lists.hellug.gr




More information about the Linux-greek-users mailing list