Install and configure Apache on centos

Source: Internet
Author: User

I. Installation

# Yum install httpd

 

Ii. Question about the Chinese file name

Run the RPM command to install mod_encoding. in Linux, Apache supports Chinese names.
---------------------- RPM installation mod_encoding ------------------------
In Linux, Apache supports Chinese names, all of which are about mod_encoding.
Mod_encoding-20021209.tar.gz this version has serious memory leakage issues. Generally, 4G memory runs out within one day.
I wonder if this RPM package has been resolved

1. My version is Apache 2.2.3. Please note that your Apache version is generally 2.2.x.
2. To enable mod_encoding, you must enable the mod_headers module.
VI httpd. conf modification (the installation of this module is not described. For details, refer to my Apache built-in ):
Loadmodule headers_module modules/mod_headers.so
3. the/etc/httpd/CONF. d/mod_encoding.conf file is automatically generated when the mod_encoding RPM package is installed.

----------- The installation steps are as follows:
Wget ftp://ftp.aconus.com/fc5/mod_encoding/mod_encoding-2.2.0-1.i386.tar.gz
Tar zxvf mod_encoding-2.2.0-1.i386.tar.gz
Rpm-IVH iconv_hook-1.0.0-1.i386.rpm mod_encoding-2.2.0-1.i386.rpm
Rpm-SQL mod_encoding-2.2.0-1.i386
Rpm-SQL iconv_hook-1.0.0-1.i386

 

The content of/etc/httpd/CONF. d/mod_encoding.conf is as follows:

LoadFile/usr/local/lib/libiconv_hook.so.1
Loadmodule encoding_module modules/mod_encoding.so
<Ifmodule mod_encoding.c>
Encodingengine on
Normalizeusername on
Setserverencoding GBK
Defaultclientencoding UTF-8 GBK gb2312
</Ifmodule>

5. Modification completed

 

3. webpage garbled

Modify:/etc/httpd/CONF/httpd. conf

# Adddefacharset UTF-8
Adddefacharcharset gb2312
# Adddefacharcharset off

 

4. Configure mime

Append in/etc/mime. Types
For example, application/X-Silverlight-app xap

Restart Apache
# Service httpd restart

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.