News
Abstract
IBM HTTP Server for i - Large File Support Overview
Content
You are in: IBM i Technology Updates > Web Integration on i > News of Web Integration on IBM i > IBM HTTP Server for i - Large File Support Overview
Introduction
Large File Support
httpd is now built with support for files larger than 2GB on modern 32-bit Unix systems. Support for handling >2GB request bodies has also been added.
IBM HTTP Server on IBM i 7.1 is based on Apache HTTP Server Version 2.2.11, but it didn't have large file support enabled when it was initially released two years ago. Nowadays, large files like DVDs, HD movies and large sized program install image etc have become more and more common and popular. The requirements to provide the support to allow customers to download/upload large files through IBM HTTP Server for i has become more important and necessary. This new feature is only added to IBM i 7.1 and higher starting from HTTP Server Group SF99368 level 16 and will not be ported back to any earlier releases. This is an update that we would normally have delivered on a release boundary due to the potential impact. Due to the importance to allow large files to be handled by the IBM i HTTP Server we felt this change could not wait for the next new IBM i release.
How to check if your HTTP Server is large file support enabled
1. Check HTTP Server large file support PTFs/HTTP Server Group.
(1) HTTP Server Group PTF: SF99368 level 16
Note: These five PTFs are Corequisite PTFs, so they must be applied or removed together. These five PTFs and other large file support related PTFs are all included in the HTTP Server Group SF99368 level 16 . It's suggested to install the HTTP Server Group instead of applying individual PTFs.
First, please make sure error log is already enabled for your instance. You can use IBM Web Administration for i tool to select your HTTP Server instance and click the Logging link from the left navigation menu. See figure 1 for example:
![image-20200117102224-1](/support/pages/system/files/inline-images/image-20200117102224-1.png)
After HTTP server is fully started, open the error log and check. See figure 2 for example, you should find "with large file support " message from error log if your instance is large file support.
![image-20200117102236-2](/support/pages/system/files/inline-images/image-20200117102236-2.png)
Specify '-V' (uppercase) parameter to STRTCPSVR command to show the server compile settings, for example:
STRTCPSVR SERVER(*HTTP) HTTPSVR(WEBSVR '-V')
See figure 3 for example: the phase "with large file support" indicates your HTTP Server has large file support.
![image-20200117102249-3](/support/pages/system/files/inline-images/image-20200117102249-3.png)
Note: Specify '-V' parameter only displays all the compile settings, the HTTP Server won't be actually started.
HTTP Server for i code has been recompiled against macro _LARGE_FILES in order to support large file. All IBM and third-party developed HTTP Server Plug-in modules will not work correctly with the large file support HTTP Server anymore if they are not recompiled in the same way. Below section describe the reason and how to get old Plug-in modules work with large file support HTTP Server.
Background:
struct request_rec {
... ...
apr_off_t sent_bodyct; /* byte count in stream is for body */
apr_off_t bytes_sent; /* body byte count, for easy access */
... ...
apr_off_t clength; /* The "real" content length */
apr_off_t remaining; /* Remaining bytes left to read from the request body */
apr_off_t read_length; /* Number of bytes that have been read from the request body */
apr_finfo_t finfo;
... ...
};
... ...
apr_off_t size; /** The size of the file */
apr_off_t csize; /** The storage size consumed by the file */
... ...
};
If you have IBM i HTTP server associated to WebSphere Application Server, you must install the corresponding WebSphere Application Server fix packs that include the large file support Plug-in(new *SRVPGM name is QSVTAP22LF) first.
The minimum required version of fix pack that include the large file support Plug-in are:
WebSphere Application Server V6.1 - Fix pack 6.1.0.45
All fix pack can be downloaded from Fix Central: http://www-933.ibm.com/support/fixcentral/
We take WebSphere Application Server V7.0 for example, the below table shows what the value of directive LoadModule should be before and after large file support.
Large File Support | LoadModule directive value in httpd.conf |
N | LoadModule was_ap20_module /QSYS.LIB/QWAS7x.LIB/QSVTAP22.SRVPGM. |
Y | LoadModule was_ap20_module /QSYS.LIB/QWAS7x.LIB/QSVTAP22LF.SRVPGM |
Note: The letter "x" represents the WebSphere Application Server installation library, it can be A, B, C... depends on how many installations you have on your system.
Note:
- (1) Plug-in module will not be restored if the QSVTAP22LF service program already exists in the library. If you want to replace it, you need to manually rename/move/delete the existing QSVTAP22LF service program and then call the QHTTPSVR/QZHBLFPLG program or removing PTF SI48802 and applying it again.
- (2) If a new WebSphere Application Server installation is installed after the PTF applied and the fix pack level is older than the required, you need to call the QHTTPSVR/QZHBLFPLG program or removing PTF SI48802 and applying it again to get the correct Plug-in modules restored to the new created WebSphere Application Server libraries.
- (3) If the PTF SI48802 is applied first and then you install fix pack which is older than the required, the Plug-in runtime service program QSVTCMMNH will be replaced by the older version from the fix pack which is not compatible with the QSVTAP22LF service program. In this case, you need to manually rename/move/delete the existing QSVTAP22LF service program and then call the QHTTPSVR/QZHBLFPLG program or removing PTF SI48802 and applying it again to get the correct version Plug-in service programs restored.
- (4) The Plug-in runtime service program QSVTCMMNH shipped by PTF SI48802 is compatible with both large file Plug-in QSVTAP22LF and non large file Plug-in QSVTAP22 service programs.
- (5) IBM provides PTF SI44812 which automatically updates httpd.conf to use the large file support WAS Plug-in service program QSVTAP22LF on IBM i 7.1 when the HTTP Server is first started. This PTF requires that the previous plugin-cfg.xml which is specified by the WebSpherePluginConfig directive and the WAS plug-in service program QSVTAP22/QSVTAP20/QSVT2070/QSVT2270 which is specified by the LoadModule directive to be in the standard location, otherwise users will need to update the httpd.conf manually.
LoadModule was_ap20_module /QSYS.LIB/QHTTPSVR.LIB/QSVTAP22.SRVPGM
LoadModule was_ap20_module /QSYS.LIB/QHTTPSVR.LIB/QSVT2070.SRVPGM
LoadModule was_ap20_module /QSYS.LIB/QHTTPSVR.LIB/QSVT2270.SRVPGM
Error message: HTTP Server could not find the large file support WebSphere Application Server Plug-in <Plug-in path>.
See figure4 for example:
![image-20200117102309-4](/support/pages/system/files/inline-images/image-20200117102309-4.png)
- Message - HTTP Server could not find the large file support WebSphere Application Server Plug-in <Plug-in path>.
- Cause - The HTTP Server attempted to load the large file support WebSphere Application Server
- Plug-in &1 but was unsuccessful.
- Recovery - The large file support WebSphere Application Server Plug-in &1 may be misspelled or does
- not exist. Correct the Plug-in name or install the latest WebSphere Application Server
- fix pack and start the server again.
![image-20200117102322-5](/support/pages/system/files/inline-images/image-20200117102322-5.png)
IBM Web Administration for i provides a Web-based GUI interface to manage IBM HTTP server and application servers. When you start/restart a HTTP server or associate a HTTP server with a WebSphere Application Server by IBM Web Administration for i, the GUI will check if the WebSphere Application Server large file Plug-in can be found or not.
If the correct Plug-in can not be found on the system while starting/restarting HTTP server, or associating HTTP server with an existing WebSphere Application Server, the following error message is thrown:
- Error message: HTTP server <instance name>; can not be started. HTTP Server is enabled with large file support but the required plugin is not found from the associated WebSphere Application Server. Update the WebSphere Application Server to version <minimum required version>; or above.
In following example, start HTTP server while the WebSphere Application Server large file Plug-in can not be found.
![image-20200117102409-7](/support/pages/system/files/inline-images/image-20200117102409-7.png)
Warning message: HTTP Server is enabled with large file support on the system but the WebSphere Application Server installation is not at the required level. HTTP Server can not be started after the profile is created. Update the WebSphere Application Server to version <minimum required version> or above before or after the profile is created to ensure the entire Web environment work well.
Following gives an example in creating WebSphere Application Server V8.0.0.3.
![image-20200117102429-8](/support/pages/system/files/inline-images/image-20200117102429-8.png)
- WebSphere Application Server V8.5 -
- https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.iseries.doc/ae/welcome_basei.html
- WebSphere Application Server V9.0 -
https://www.ibm.com/support/knowledgecenter/SSEQTP_9.0.5/as_ditamaps/was9_welcome_base.html
Except IBM WebSpehre Application Server Plug-in module, all other IBM provided Plug-in module have been correctly recompiled, tested and ship by PTF together with HTTP server large file support PTFs in the same HTTP Group SF99368 level 16. It's strongly suggested install the HTTP Server Group as a whole to ensure all your Web solutions run correctly.
i) IBM Integrated Web Application Server for i / IBM Integrated Web Services Server for i
The HTTP Server Plug-in of IBM Integrated Web Application Server and IBM Web Services Server are the same:
LoadModule mod_ibm_lwi /QSYS.LIB/QHTTPSVR.LIB/QLWIIHSMOD.SRVPGM
It has been recompiled to support large file. If you have IBM i HTTP Server associated to IBM Integrated Web Application Server for i or IBM Integrated Web Services Serve for i, please apply PTF SI42003 or install the HTTP Group.
ii) Domino
The HTTP Server Plug-in of Domino Server is:
It has been recompiled to support large file. If you have IBM i HTTP Server to connect to domino server, please apply PTF SI42277 or install the HTTP Group.
iii) Tomcat
The HTTP Server Plug-in of Tomcat Server is:
It has been recompiled to support large file. If you have IBM i HTTP Server to connect to own installed tomcat server on IBM i 7.1, please apply PTF SI47667 or install the HTTP Group..
For all ISVs' and customers' own developed plug-in modules, all of them MUST be recompiled before installing the large file support HTTP Server PTFs/HTTP Group level 16. Please follow below 4 steps to ensure your own developed plug-in module can still correctly work with large file support HTTP server.
As mentioned in above section, there are some members defined as apr_off_t data type in the structure request_rec, if your plug-in code is using any of them and assign them to primary integer data types(i.e. int), please correct them to use the same data type definition in the httpd.h.
For example:
If your plug-in code is using the member bytes_sent and the below code snippet sample is not correct.
Wrong:
}
Correct:
void functionXXX(request_rec* r){
Please check and update your code to use the same data type defined in the httpd.h rather than using primary data type directly.
Step 2 Recompile your plug-in code with macro _LARGE_FILES
After step 1, your plug-in needs to be recompiled with the marco _LARGE_FILES to ensure your modules is still working correctly with the large file support HTTP server.
Suppose our example plug-in module source code is /home/plugin/testMod.c and the plug-in module service program library/name is PLUGIN/TESTMOD. There are two ways to recompile your code.
i) Add _LARGE_FILES to the DEFINE parameter when using the CRTCMOD CL command to compile your code
CRTCMOD MODULE(PLUGIN/TESTMOD) SRCSTMF('/home/plugin/testMod.c') INCDIR('/qibm/proddata/httpa/include') DEFINE(AS400 AS400_UTF8 '_LARGE_FILES') LOCALETYPE(*LOCALEUTF) TERASPACE(*YES)
See Fig.9 for example:
ii) Add #define _LARGE_FILES to the beginning of your module's source files.
See Fig.10 for example:
Source code: /home/plugin/testMod.c
![image-20200117111011-10](/support/pages/system/files/inline-images/image-20200117111011-10.png)
Step 3 Ensure the new plug-in has the correct authority as before
See Fig.11 for example:
Plug-in module: /QSYS.LIB/PLUGIN.LIB/TESTMOD.SRVPGM:
![image-20200117111020-11](/support/pages/system/files/inline-images/image-20200117111020-11.png)
Step 4 Restart HTTP server and test
Restart your HTTP Server instance to get the new compiled plug-in module loaded and run your tests to see if everything works well as before.
The large file support new feature has been added to HTTP Server for i on IBM i 7.1 to provide the ability to allow users to transfer large size files(>2G) through HTTP Server. User can install HTTP Group SF99368 level 16 to enable your HTTP instance with large file support on your IBM i 7.1 system.
In order to ensure your Web solutions contiue to work correctly with large file support HTTP Server, the following two actions must be performed.
- [1] Apache HTTP Server 2.2 new features - http://httpd.apache.org/docs/2.2/new_features_2_2.html
- [2] WebSphere Application Server 8.5 Knowledge Certer -
- https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/as_ditamaps/was855_welcome_base_dist_iseries.html
- [3] WebSphere Application Server 9.0 Knowledge Certer -
- https://www.ibm.com/support/knowledgecenter/SSEQTP_9.0.5/as_ditamaps/was9_welcome_base.html
Was this topic helpful?
Document Information
Modified date:
08 March 2020
UID
ibm11170292