今天在给客户调试他的程序的时候.发现他的网站有中文名称.而lnmpa的一键配置的环境貌似apache无法认识中文路径,于是乎.只有自己动手解决,解决方法很简单
下载iconv_hook和mod_encoding的RMP包

wget http://d.kiiyi.com/mod_encoding-2.2.0-1.i386.tar.gz 

之后解压他

tar zxvf mod_encoding-2.2.0-1.i386.tar.gz 

之后导入RPM


rpm -ivh iconv_hook-1.0.0-1.i386.rpm
rpm -ivh mod_encoding-2.2.0-1.i386.rpm
 

导入的时候,可能还会出现

ldconfig: /usr/lib/libmysqlclient.so.16 is not a symbolic link

ldconfig: /usr/lib/libmysqlclient_r.so.16 is not a symbolic link(不是符号连接) 

没关系啦...

我们只要在lnmpa的安装包下执行如下命令即可

ln -sf /usr/local/mysql/lib/mysql/libmysqlclient_r.so.16 /usr/lib/libmysqlclient_r.so.16
ln -sf /usr/local/mysql/lib/mysql/libmysqlclient_so.16 /usr/lib/libmysqlclient.so.16 

之后就可以修改httpd.conf了.在httpd.conf中加入如下代码:


    LoadModule encoding_module modules/mod_encoding.so

    <IfModule mod_headers.c>
    Header add MS-Author-Via "DAV"
    </IfModule>
    <IfModule mod_encoding.c>
    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
    </IfModule>

 

然后重启lnmpa环境...这个时候.你肯定会发现这货出错了..

httpd: Syntax error on line 34 
of /usr/local/apache/conf/httpd.conf: 
Cannot load /usr/local/apache/modules/mod_encoding.so 
into server: /usr/local/apache/modules/mod_encoding.so: 
cannot open shared object file: No such file or directory 

没关系...我们将之前导入的mod_encoding.so(位置在/usr/lib/httpd/modules/下面),复制到/usr/local/apache/modules即可


cp /usr/lib/httpd/modules/mod_encoding.so /usr/local/apache/modules 

之后.重启环境

root/lnmpa restart 

好了.打完收工.祝各位玩的愉快!

最后修改:2014 年 03 月 29 日 09 : 13 PM
如果觉得我的文章对你有用,请随意赞赏