1、安装mod_encoding
需要下载两个rpm包(iconv_hook-1.0.0-1.i386.rpm和mod_encoding-2.2.0-1.i386.rpm):
- wget http://www.xiit.cn/attachments/tools/iconv_hook-1.0.0-1.i386.rpm
- wget http://www.xiit.cn/attachments/tools/mod_encoding-2.2.0-1.i386.rpm
用rpm命令安装:
- rpm -ivh iconv_hook-1.0.0-1.i386.rpm
- rpm -ivh mod_encoding-2.2.0-1.i386.rpm
2、配置:
(1) 开启mod_encoding支持,需要开启Apache自带的mod_header模块
在/etc/httpd/conf/httpd.conf中,
LoadModule headers_module modules/mod_headers.so //一般默认为开启,无需更改
(2) 安装mod_encoding RPM包时会自动生成mod_encoding.conf
vi /etc/httpd/conf.d/mod_encoding.conf
- LoadModule encoding_module modules/mod_encoding.so
- <IfModule mod_encoding.c>
- EncodingEngine on
- NormalizeUsername on
- SetServerEncoding GBK
- DefaultClientEncoding UTF-8 GBK GB2312
- AddClientEncoding "cadaver/" UTF-8 GBK GB2312
- </IfModule>
保存后,重启Apache服务
评论前必须登录!
注册