1.download & patch:
#cd /usr/local/
# wget
# wget
新版本mod_encoding.c 覆盖
# tar -zxvf mod_encoding-20021209.tar.gz
# cp mod_encoding.c.apache2.20040616 mod_encoding-20021209/mod_encoding.c
这里必须要打一个apache 2.2的补丁。否则make也会出apxs rc=65536 之类的错误。
# cd mod_encoding-20021209
# wget ~oyaji/faq/mod_encoding.c-apache2.2-20060520.patch
# patch -p0 < mod_encoding.c-apache2.2-20060520.patch
2.install
# cd mod_encoding-20021209/lib
# ./configure
# make
# make install
# vi /etc/ld.so.conf
在最下面添加/usr/local/lib 保存退出。
#ldconfig
3 build mod_encoding
#cd /usr/local/mod_encoding-20021209
#./configure --with-apxs=/usr/sbin/apxs --with-iconv-hook=/usr/local/include
#make
#ls –l
查看是否已经生成了mod_encoding.o文件,如果有,则make成功继续下边的操作。
#gcc -shared -o mod_encoding.so mod_encoding.o -Wc,-Wall -L/usr/local/lib -Llib -liconv_hook
#cp mod_encoding.so /usr/lib/httpd/modules/mod_encoding.so
4. config apache 2.2在配制Apache配置文件
#vi /www/conf/httpd.conf
在文件最后添加:
LoadModule encoding_module /usr/lib/httpd/modules/mod_encoding.so
Header add MS-Author-Via "DAV"
EncodingEngine on
NormalizeUsername on
SetServerEncoding GBK
DefaultClientEncoding UTF-8 GBK GB2312
AddClientEncoding "(Microsoft .* DAV $)" UTF-8 GBK GB2312
AddClientEncoding "Microsoft .* DAV" UTF-8 GBK GB2312
AddClientEncoding "Microsoft-WebDAV*" UTF-8 GBK GB2312
重启Apache,