|
|
Setup Perl and Apache to use it on iSeries |
| All iSeries steps are performed with a user that has *SECOFR authority.
This was done on V5R2 with all the latest PTFs as of 1/2004.
1. Download the Perl 5.8.0 iSeries PASE binaries from CPAN website at http://www.cpan.org/ports/os400/ (this will install Perl in /QOpenSys/perl)9. Enter command: ln -fs /QOpenSys/perl/bin/* /QOpenSys/usr/bin (This will create symbolic links to the Perl binaries in the/QOpenSys/usr/bin folder which is part of the standard PATH environment variable.) 10. If you want to see what your PATH environment variable contains enter the command: env PATH11. To make sure Perl installed correctly enter command: perl -v The command should return: This is perl, v5.8.0 built for aix (with 1 registered patch, see perl -V for more detail) Copyright 1987-2002, Larry Wall etc...
*************** STRTCPSVR *HTTP *ADMIN8. In a browser enter: http://yourserver:2001 9. Provide an iSeries profile and password that has *SECOFR security. 10. Select IBM HTTP Server for iSeries 11. Set the Server to your Apache server instance. 12. Set Server area: "Global Configuration" 13. Left hand Menu item: "URL Mapping" 14. Tab: "Aliases" 15. Add a "Script Alias" with "URL path" of "/perl-bin/" 16. and Host Directory "/QOpenSys/perl/webwrap/" 17. Left hand Menu: "Container Management" 18. Tab: "Directories" 19. Add a directory "/QOpenSys/perl/webwrap" 20. Left hand Menu: "Content Settings" 21. Tab: "Mime" 22. Add a "File extension" of ".pl" 23. with "Action" of "Add" 24. and "Type" of "Content-Type" 25. and "Value" of "application/x-httpd-perl" 26. Left hand Menu: "Request Processing" 27. Tab: "Handlers" 28. Section: :Automatically run CGI programs for MIME-types:" 29. Add a "CGI program" of "/perl-bin/paseweb" 30. and "MIME-type or handler" of "application/x-httpd-perl" 31. Server area: "/QOpenSys/perl/webwrap" 32. Left hand Menu: "Dynamic Content and CGI" 33. Tab: "General Settings" 34. Set "Allow CGI programs to be run" to "enabled" 35. Left hand Menu: "Security" 36. Tab: "Control Access" 37. Set "Order for evaluating access" to "Allow then Deny" 38. Check "Allow access to all, except the following:" 39. Restart the server
*************** ScriptAlias /perl-bin/ /QOpenSys/perl/webwrap/
AddType application/x-httpd-perl .pl
Action application/x-httpd-perl /perl-bin/paseweb
<Directory /QOpenSys/perl/webwrap>
Options +ExecCGI
order allow,deny
allow from all
</Directory>
***************
40. Create a folder "webwrap" under "/QOpenSys/perl" #!/QOpenSys/perl/bin/perl
exec $ENV{PATH_TRANSLATED};
print "Content-Type: text/html;\r\n\r\n";
print "Error running CGI";
***************
44. Start a PASE terminal session by entering CALL QP2TERM in your
*************** This converts the end of lines to a single carriage return.
If you use the EDTF command it should not be needed and you can directly
create paseweb.
This needs to be done on all perl scripts as advised by Bryan Logan.
***************
47. Exit the PASE session.
With this setup I used #!/usr/bin/perl as the first line of the scripts
I found that the default folder for file operations varies by OS/Server
The folder that contains your scripts and the script files also need
The user profile QTMHHTTP is the normal profile that the APACHE
The user profile QTMHHTP1 is the normal profile that the APACHE
Getting and installing Perl was mostly from "PHP on IBM iSeries"
Configuring Apache was mostly from Byran Logan of IBM.
| |
| Step 52 can be achieved by running the following: QSH CMD('find /QOpenSys/perl/* -exec system "CHGAUT OBJ(''"{}"'') USER(QTMHHTP1) DTAAUT(*RX) OBJAUT(*OBJREF)" \;') | |
| What is the function of 'paseweb' in directory /QOpenSys/perl/webwrap? When trying to link to my "Hello World' webpage I get the following: The page cannot be displayed.The following appears in the joblog: 00 08/09/06 07:48:02.787792 QWTPIIPP QSYS 05D4 *EXT *N Message . . . . : Job 904410/QTMHHTTP/QRYSERVER started on 08/09/06 at
07:48:02 in subsystem QHTTPSVR in QHTTPSVR. Job entered system on 08/09/06
at 07:48:02.
00 08/09/06 07:48:03.298032 QZSRCGI QHTTPSVR *STMT QZSRCGI QHTTPSVR *STM
From module . . . . . . . . : ZSRVHJOB
From procedure . . . . . . : sendMessage
Statement . . . . . . . . . : 3
To module . . . . . . . . . : ZSRVHJOB
To procedure . . . . . . . : sendMessage
Statement . . . . . . . . . : 3
Message . . . . : This is a CGI job for IBM HTTP Server instance QRYSERVER.
Technical description . . . . . . . . : All Common Gateway Interface (CGI)
programs for the IBM HTTP Server run in separate jobs from the server job.
This job is reused for other CGI programs.
30 08/09/06 07:48:04.416112 QP2USER QSYS *STMT QZSRCGI QHTTPSVR *STM
From module . . . . . . . . : QP2EXERR
From procedure . . . . . . : sendmsg__FPCcN21e
Statement . . . . . . . . . : 188
To module . . . . . . . . . : ZSRVCGI
To procedure . . . . . . . : CGICall
Statement . . . . . . . . . : 249
Message . . . . : Cannot load OS/400 PASE module
/QOpenSys/perl/webwrap/paseweb.
Cause . . . . . : The stream file for OS/400 PASE module
/QOpenSys/perl/webwrap/paseweb may not exist, or you may not have sufficient
authority to load from it. You must have read authority to load an OS/400
PASE shared object, or read and execute authority to load an OS/400 PASE
program. The error occurred attempting to load OS/400 PASE program
/QOpenSys/perl/webwrap/paseweb. Recovery . . . : Correct the error and
then try the request again.
| |
Append to This Answer | |
| rv-lists, colin.williams, george.morey |
| Previous: |
|
| Next: |
|
| ||||||||