Configure Apache on Linux and support the download of Chinese name files

Source: Internet
Author: User
Configure Apache on Linux and support the download of Chinese name files-Linux Enterprise Application-Linux server application information. See the following for details. By default, Apache on Linux does not support downloading files with Chinese names. For some time, I was very depressed because in a project, the customer requested that files with Chinese names be downloaded, later, I had to solve the problem in the program, but I was a little unwilling. I felt that Apache could certainly support it. I recently saw the mod_encoding module on the Internet, MS is written by a Japanese (Bs Japanese first, and then use their good stuff :)).

First download the file from here: mod_encoding-20021209.tar.gz this module package, this package by default is support Apache 1.3.X, if you want to use on Apache2, You need to download another file, download here

The configuration steps are as follows:

# Cp mod_encoding-20021209.tar.gz/usr/local/

# Cd/usr/local/

# Tar-zxvf mod_encoding-20021209.tar.gz

For Apache2

# Cp mod_encoding.c.apache2.20020616/usr/local/mod_encoding-20021209/mod_encoding.c

# Cd mod_encoding-20021209/lib

#./Configure

# Make

# Make install

# Vi/etc/ld. so. conf

Add/usr/local/lib at the bottom to save and exit.

# PATH = "$ PATH:/sbin"

# Ldconfig

# Cd/usr/local/mod_encoding-20021209

#./Configure -- with-apxs =/www/bin/apxs -- with-iconv-hook =/usr/local/include

Modify/www above to your Apache installation directory

# Make

# Ls? L

Check whether the mod_encoding.o file has been generated. If yes, make continues the following operations.

# 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

In the preparation of the Apache configuration file

# Vi/www/conf/httpd. conf

Add at the end of the file:

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



That's all. What happens after Apache is restarted? The above method is successfully tested on RedHat 9.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.