apache默认是不支持中文文件名的,想要apache的URL中支持中文,需要安装mod_encoding模块。
1.安装模块编译过程如下:# 我的apache在/usr/local/apache2.2.21
cd /usr/local
wget https://www.8a.com/osdn/webdav/19350/mod_encoding-20060316.tar.gz
tar zxf mod_encoding-20060316.tar.gz
mv mod_encoding mod_encoding_20060316
cd mod_encoding_20060316
vi Makefile
#需要修改Makefile,指定apxs和apachectl的绝对路径:
# APXS=apxs改为APXS=/usr/local/apache2.2.21/bin/apxs
# apacheCTL=apachectl改为apacheCTL=/usr/local/apache2.2.21/bin/apachectl
make #make后mod_encoding.so文件位于 ./libs/ 中
find / -name mod_encoding.so
#/usr/local/mod_encoding_20060316/.libs/mod_encoding.so
cp /usr/local/mod_encoding_20060316/.libs/mod_encoding.so /usr/local/apache2.2.21/modules/
2.修改httpd.conf#引入以下两个模块
LoadModule headers_module modules/mod_headers.so
LoadModule encoding_module modules/mod_encoding.so
#再添加
EncodingEngine on
NormalizeUsername on
SetServerEncoding UTF-8