Enabling data compression on an IBM HTTP Server(IBM HTTP Server配置GZIP)

Technote (FAQ)


Question

What are the step-by-step instructions for enabling data compression on an IBM HTTP Server to optimize performance in Maximo Asset Management?

Answer

The Apache mod_deflate module can be used to improve response time in environments that have low bandwidth and high latency. The Apache mod_deflate module compresses output from your server before the data is sent to the client over the network. You can set the compression level to 3 or 6 to improve response time.
About the operating system versions
These instructions work for both Windows and AIX. The only difference is in how you start and stop the server. Refer to your IBM HTTP Server product documentation for more information.

Typically, the IBM HTTP Server on Windows is installed as a Windows Service, which you can start by using the NET START "<ServiceName>" command. The ServiceName parameter can vary depending on the version of IBM HTTP Server that you have installed. Alternatively, you can start the service from the Services graphical user interface by clicking Start > All Programs > Administrative Tools > Services then right-clicking on the IBM HTTP Server service and selecting Start.

Because it is possible to install the IBM HTTP Server without using a service in Windows, you can also use the following command to start the server on Windows: 

    <HTTPServer_installdir>\bin\apache.exe -k start

Before you begin
The mod_deflate module is only available in Apache server version 2.0 and higher.
To verify the server version, use the apachectl -V command.

Procedure
1. Stop the server by running the following command: apachectl stop

2. Create a backup copy of httpd.conf.

3. Open httpd.conf in a text editor.

4. Change the KeepAliveTimeout 10 line to KeepAliveTimeout 60. 
Changing the KeepAliveTimeout is useful in high latency environments or in environments with geographically distributed users. A higher KeepAliveTimeout value can prevent timeouts due to slow network traffic.

5. Uncomment the LoadModule deflate_module modules/mod_deflate.so line. If you cannot find the LoadModule deflate_module modules/mod_deflate.so line, in the # Dynamic Shared Object (DSO) Support section, immediately after the # LoadModule foo_module modules/mod_foo.so comment, add the line for the module.

6. Locate the section in the file for adding filters. Immediately under the #AddOutputFilter INCLUDES .shtml comment, add the following lines:
AddOutputFilterByType DEFLATE text/html text/plain text/xmlBrowserMatch
^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
#Highest 9 - Lowest 1
DeflateCompressionLevel 3

The compression level is now set to 3, which provides minimal CPU usage and a decent benefit from the compression. You can also set the compression level to 6, which provides even more compression benefit with a small CPU overhead.

http://www-01.ibm.com/support/docview.wss?uid=swg21624766

根据上述资料,自己配置的conf文件稍有不同,这里贴出了来,避免遗忘。

-----------------------------------------------------------------------------------------------------------


#added by Harry

LoadModule deflate_module modules/mod_deflate.so

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/x-javascript application/json
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
#Highest 9 - Lowest 1
DeflateCompressionLevel 6

-------------------------------------------------------------------------------------------------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值