[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cgi-bin
Quoting hcrouch@mchsi.com:
> KH> Perl scripts load the perl interpreter and compile the script on
> KH> every single execution... Php is a module of the server. It is a
> KH> built in handler for the server and is loaded into memory with the
> KH> server...
>
> Debian has multiple Apache packages. The one that I installed -- Apache-Perl
> --
> is Apache with mod_perl statically linked. Under the circumstances, Perl
> availability versus PHP availability should be a non-issue.
>
PERL and MOD_PERL are actually not the same thing. Any web server with cgi
execution enabled and PERL on the server can run cgis written in PERL.
MOD_PERL is a module compiled into the web server or linked by the web server
(like a DLL in the Wintel world) that keeps the PERL compiler resident and
greatly speeds up execution of PERL scripts. MOD_PERL can be used to write
actual modules for the server that will become part of the guts of the server
or it can be used to greatly speed up certain cgis if properly configured.
> There still remains the fact that the Perl modules will compile the cgi
> scripts
> every time they are executed. Is there a way to keep compiled scripts
> resident?
> Is the biggest hit on performance going to be loading Perl (when it isn’t a
> module) or compiling the Perl-cgi scripts? Are PHP scripts compiled ahead
> of
> time or interpreted without run-time compiling?
>
MOD_PERL will pretty much eliminate the overhead of compiling cgi scripts.
Making the application a MOD_PERL module will completely wipe out the
overhead.
PHP scripts are compiled as they are run but the compiler is already in memory
so you don't have the overhead of loading up a several hundred kilobyte binary
and then compiling a script. You just have the overhead of compiling the
script which you're going to have with any web application unless you write it
as a server module.
>
> KH> If you have to use PERL for some reason, use MOD_PERL but if you're
> KH> new to this stuff and just learning, MOD_PERL is going to get you
> KH> WAY over your head...
>
> http://www.peachpit.com/title/0201735687 :-)
>
That book is about PERL and not MOD_PERL in particular.
http://www.amazon.com/exec/obidos/tg/detail/-/156592567X/qid=1082053187/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/102-2661096-6379315?v=glance&s=books&n=507846
Writing Apache Modules in PERL and C is the definitive book on MOD_PERL but it's
almost definitely not what you're looking for if you just need to write a
moderately used database application.
>
> KH> You can also use the address of the greatest warez site in the
> KH> world: http://127.0.0.1/cgi-bin/my_script.cgi and it will magically
> KH> find your
computer no matter where it is.
>
> You’re trying to tell me something here, but it went over my head.
>
It was a lame attempt at a joke explaining that the IP address 127.0.0.1 can
always be typed in as a way to reference your own computer (loopback). People
on IRC and Usenet love to tell people it's the best FTP/Warez/pr0n site on the
net but it's really just another way to get back to localhost.
The non-lame of what I was trying to say is that /cgi-bin/ should always be
where Apache maps your configured cgi-bin directory. /usr/lib/cgi-bin/ or
whatever it's called will be magically translated into
http://localhost/cgi-bin/
Ken Hagan
Technology Consultant
Alacrity-IT, Inc
http://www.alacrity-it.com/
618.499.0108
----------------------------------------------------------------
This message was sent using Alacrity-IT Webmail
http://www.alacrity-it.com/
-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.