wdcp apache,nginx中文url404问题解决,版本CentOS 6.5 + Apache 2.2.4 32位
1.查看apcahe版本
1 |
/www/wdlinux/apache/bin/apachectl |
2.下载对应的mod_encoding模块
下载安装包
1 |
wget ftp://ftp.aconus.com/fc5/mod_encoding/mod_encoding-2.2.0-1.i386.tar.gz |
直接解压
1 |
tar zxvf mod_encoding-2.2.0-1.i386.tar.gz |
看到2个rpm安装包,进行安装
1 2 |
rpm -ivh iconv_hook-1.0.0-1.i386.rpm rpm -ivh mod_encoding-2.2.0-1.i386.rpm |
3、用 find / -name httpd.conf 找到apache配置文件httpd.conf,vi编辑
vi /www/wdlinux/httpd-2.2.24/conf/httpd.conf
加入以下内容
1 2 3 4 5 6 7 8 9 |
LoadModule encoding_module 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 |
4、重启apache
1 |
service httpd restart |
如果安装的是WDCP,重启apache会失败,需要将mod_encoding.so复制到/www/wdlinux/httpd-2.2.24/modules下
1 |
cp /usr/lib/httpd/modules/mod_encoding.so /www/wdlinux/httpd-2.2.24/modules |
nginx
一、确定你的Linux系统是UTF编码,Root登录SSH:
1 2 |
env|grep LANG LANG=en_US.UTF-8 |
二、NGINX配置文件里默认编码设置为utf-8
1 2 3 4 5 6 7 8 |
server { listen 80; server_name xxxx.com ; index index.html index.htm index.php; root /usr/local/nginx/html/inginx.com; charset utf-8; } |
重启nginx
1 |
service nginxd restart |