Ask a Question related to PERL Modules, Design and Development.
-
Kio #1
Several questions about ModPerl
Several questions about ModPerl
Hello. I am Webmaster and after reading some documentation I decided
test my CGI Scripts as ModPerl
To work I have installed in local PC ActiveState Perl 5.6.1 Buld 635 +
Apache Win32 1.3.27.
I downloaded mod_perl and install it via PPM install mod_perl.....
After this I have created a directory /mod_perl under my Doc_root and
I have put this simple one .htaccess file
#####
Options +Indexes +ExecCgi
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
#####
First Test:
The test Script is the following one
##################################
#! /usr/bin/perl
use strict;
print Content-type: text/html\n\n";
print" <HTML><BODY><H3>Environment variables </H3><UL>";
foreach (sort keys %ENV) {
my $val = $ENV{$_};
$val = ~ s|\n|\\n|g;
$val = ~ s |" | \ \ |g;
print" <LI>$_ = \" ${val} \" </LI>\n";
}
print" </UL></BODY></HTML>";
######################################
The script output under /mod_perl look like this:
Environment variables(*)
DOCUMENT_ROOT = "e:/home/emprear_com/htdocs"
GATEWAY_INTERFACE = "CGI-Perl/1.1"
HTTP_ACCEPT = "*/*"
HTTP_ACCEPT_ENCODING = "gzip, deflate"
HTTP_ACCEPT_LANGUAGE = "es-ar"
HTTP_CONNECTION = "Keep-Alive"
HTTP_HOST = "www.emprear.com"
MAIL_ADMIN = "webmaster@emprear.com"
MOD_PERL = "mod_perl/1.27_01-dev"
PERL_SEND_HEADER = "On"
SCRIPT_NAME = "/mod_perl/demo_mp.cgi"
SERVER_PROTOCOL = "HTTP/1.1"
SERVER_SOFTWARE = "Apache/1.3.27 (Win32) PHP/4.3.0
mod_perl/1.27_01-dev"
-----------------------------------------------------------------------------------------------
The same Script in /cgi_em (cgi-bin) show this:
DOCUMENT_ROOT = "e:/home/emprear_com/htdocs"
GATEWAY_INTERFACE = "CGI/1.1"
HTTP_ACCEPT = "*/*"
HTTP_ACCEPT_ENCODING = "gzip, deflate"
HTTP_ACCEPT_LANGUAGE = "es-ar"
HTTP_CONNECTION = "Keep-Alive"
HTTP_HOST = "www.emprear.com"
SCRIPT_NAME = "/cgi_em/demo_mp.cgi"
SERVER_PROTOCOL = "HTTP/1.1"
SERVER_SOFTWARE = "Apache/1.3.27 (Win32) PHP/4.3.0
mod_perl/1.27_01-dev"
(*) I have put here alone some variables to make easier the
explanation - [url]www.emprear.com[/url] is a server name defined in VirtualHost
Directive in my Local PC
Comparing both, the most remarkable differences are
ModPerl:
GATEWAY_INTERFACE = "CGI-Perl/1.1"
MOD_PERL = "mod_perl/1.27_01-dev"
PERL_SEND_HEADER = "On"
PerlCGI
GATEWAY_INTERFACE = "CGI/1.1"
************************************************** **
Second Test:
I create my own perl_module hello.pm and save in
/Perl/Site/Lib/Apache/hello.pm
####################3
package Apache::Hello;
use strict;
use Apache::Constants qw(OK);
sub handler {
my $r = shift;
$r->send_http_header;
$r->print("<html><body>Hello World!</body></html>\n");
return OK;
}
1;
#####################
Then add in httpd.conf:
PerlModule Apache::Hello
<Location /hello>
SetHandler perl-script
PerlHandler Apache::Hello
</Location>
Finally go to "http://www.emprear.com/hello" and get
"Hello World! "
all it's OK
My questions are:
1. Are these two tests enough to check that ModPerl has been
installed correctly?
2. View my .htaccess at the top "Options +Indexes...", However if I
call to http: //.... /mod_perl / I always get a 404 errorpage
Only putting full url to the script ..../mod_perl/demo_mp.cgi the
script is executed fine.
Kio Guest
-
Two Questions
1. I am fairly new to FH but things after a month of learning are now getting better and my first questions is, is there a FH site where I can... -
2 questions please
Hi, I would like to put a little mpeg movie (to use with Windows Media player) onto our website. I have a 6GB AVI file (captured from my MINI DV... -
Questions!
1) How do I change the color of the horizontal scroll bar on the browser window? 2) Is there any good scripts to use for automating the... -
2 questions :) - portal questions
Say the portal displays a relationship that uses the Box_ID field as the match field on both sides. In the child file (items in the box), add two... -
HELP! I've got 2 questions
THis depends on what server language you are using. If you are using ASP or ASP.NET you will use CDONTS If you are using Cold Fusion you will use...



Reply With Quote

