Win32 platform Apache 2.0.52 Configure MOD

xiaoxiao2021-03-06  94

1. Before installation, make sure you have installed the Perl interpreter, and I have an ActivePerl 5.8 on my machine. You can go to http://www.perl.org download, end address: http://downloads.ActiveState.com/activeperl/windows/5.8/ActivePerl-5.8.4.810-mswin32-X86.ZIP (ZIP package) http: / /downloads.activestate.com/activeperl/windows/5.8/ActivePerL-5.8.4.810-Mswin32-X86.MSI (MSI)

There are also 5.6 versions of Perl, download page: http://www.activestate.com/products/download/download.plex? Id = ActivePerl

After installation, check the path item of the system environment variable. If there is no Perl path, you will add it. It is generally added automatically when installing.

2, download MOD_PERL source code, apache2 needs to download 1.9 or 2.0, recommended download 2.0http: //perl.apache.org/dist/mod_perl-2.0-current.tar.gz

3, unzip mod_perl-2.0-current.tar.gz, such as H: /MOD_PERL-2.0-Current Start Compilation: h: /mod_perl-2.0-current> perl makefile.pl mp_ap_prefix = D: / Server / Apache2

Here D: / Server / Apache2 is the path you installing Apache.

When compiles, INSTALL APXS now? [YES] is YES by default, enter Y, enter the return continuation. After the compilation is complete, you should get mod_perl.so. Next on the command line execution: h: /> ppm install http ://theoryx5.uwinnipeg.ca/ppms/mod_perl.ppd

4, configure apache: Modify https.conf, join: loadModule Perl_module modules / mod_perl.soloadfile "D: /server/perl/bin/perl58.dll" Perlrequire "D: /server/apache2/conf/EXTRA.PL" here EXTRA.PL content is:

User :: servers; us :: serverut); use apache :: serverautil (); user :: serveruti (); use apache :: connection (); use apache :: log (); use apache :: const -compile => ': common'; use a Apr :: const --compile => ': common APR: : Table (); Use apache :: compat (); use moDperl :: registry (); USE CGI (); 1;

was added httpd.conf: Alias ​​/ perl / "E: / wwwroot / perl /" SetHandler perl-script PerlResponseHandler ModPerl :: Registry Options ExecCGI PerlOptions ParseHeaders where added AddHandler: AddHandler perl -Script .pl .cgi

Restart Apache2.

5, set the EVERYO permission for the Perl virtual directory, plus execution permissions. Suggest a test for Perl scripts in your virtual directory physical path: Test.pl

## Printenv - Demo CGI Program Which Just Prints Its Environment ## Use Strict; Print "Content-Type: Text / HTML / N / N"; Print "

Environment Variables
    "; Foreach (sort keys% env) {MY $ VAL = $ env {$ _}; $ val = ~ s | / n | // n | g; $ val = ~ s |" | // " | g; print "
  • $ _ = /" $ {val} / " / n";} #sleep (10); Print " ";

    Access to http://localhost/test.pl, you should be able to see

    Environment variablesCOMSPEC = "C: /WINDOWS/system32/cmd.exe" DOCUMENT_ROOT = "E: / wwwroot / wwcec / www /" GATEWAY_INTERFACE = "CGI / 1.1" HTTP_ACCEPT = "image / gif, image / x-xbitmap, image / jpeg, image / pjpeg, application / vnd.ms-excel, application / vnd.ms-powerpoint, application / msword, application / x-shockwave-flash, * / * "HTTP_ACCEPT_LANGUAGE =" en-us "HTTP_CONNECTION =" Keep- Alive "http_host =" localhost "http_user_agent =" mozilla / 4.0 (compatible; msie 6.0; windows nt 5.2; .NET CLR 1.1.4322) "MOD_PERL =" mod_perl / 1.99_17 "path =" D: / Server / Perl / bin /; D: / program design / mingw / bin; c: / windows / system32; c: / windows; c: / windows / system32 / wbem; d: /server/java/jdk1.5.0/bin; d: / server / CVSNT "PATHEXT =" .com; .exe; .bat; .cmd; .vbs; .vbe; .js; .jse; .wsf; .wsh "query_string =" "remote_addr =" 127.0.0.1 "remote_port =" 4346 "REQUEST_METHOD =" GET "REQUEST_URI =" /perl/hello.cgi "SCRIPT_FILENAME =" E: /wwwroot/perl/hello.cgi "SCRIPT_NAME =" /perl/hello.cgi "SERVER_ADDR =" 127.0.0.1 "SERVER_ADMIN = "Webmaster@wwcec.net" SER Ver_name = "localhost" server_port = "80" server_protocol = "http / 1.0" server_signature = "apache / 2.0.52 (win32) mod_Perl / 1.99_17 Perl / v5.8.4 php / 5.0.2 mod_python / 3.1.3 Python / 2.3 .4 Server At LocalHost Port 80 / N "Server_software =" apache / 2.0.52 (Win32) mod_Perl / 1.99_17 Perl / V5.8.4 PHP / 5.0.2 MOD_PYTHON / 3.1.3 Python / 2.3.4 "SystemRoot =" C : / Windows "Temp =" C: / Windows / Temp "WINDIR =" C: / Windows "

    This is some information about the system. At this point, your mod_perl should be configured successfully. Just write a script: Hello.pl

    Print "Content-Type: TEXT / HTML"; Print "Hello World";

    You can see Hello World after running

    6, pay attention to the question: (1) When compiled, it will not find the error of the library. I don't have managed. My purpose is to get mod_perl.so (2) This step cannot be less, otherwise, PerlRequire "D: / Server /Apache2/conf/extra.pl "will be wrong. PPM install http://theoryx5.uwinnipeg.ca/ppms/mod_perl.ppd

    Reference: http://theory.uwinnipeg.ca/modperl/docs/2.0/OS/Win32/Install.htmlhttp: //Theory.uwinnipeg.ca/modperl/docs/2.0/OS/Win32/config.html

转载请注明原文地址:https://www.9cbs.com/read-96723.html

New Post(0)