CentOS 6.4 vsftpd Chinese garbled how to do

Source: Internet
Author: User
Tags character set ftp gz file pack sha1 centos rpmbuild

Windows Client access to the FTP application server appears garbled. This is due to the UTF-8 and GBK incompatible with headaches caused by the source way to compile the installation can solve this problem.

Garbled resolution process:

1, first use the RPM-E vsftpd Uninstall system installation default VSFTPD Application server:

[Root@localhost ~]# rpm-e vsftpd

2, download the vsftpd-2.2.2-11.el6_3.1.src.rpm source package from the http://vault.centos.org/6.3/updates/Source/SPackages/website.

3. Use RPM-IVH vsftpd-2.2.2-11.el6_3.1.src.rpm to install the package:

[Root@localhost birdofprey]# RPM-IVH vsftpd-2.2.2-11.el6_3.1.src.rpm

An error similar to the following is prompted during installation:

Warning:vsftpd-2.2.2-11.el6_3.1.src.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey

1:VSFTPD Warning:user Mockbuild does not exist-using root

########################################### [100%]

Warning:user Mockbuild does not exist-using root

Warning:group Mockbuild does not exist-using root

Warning:user Mockbuild does not exist-using root

Warning:group Mockbuild does not exist-using root

Warning:user Mockbuild does not exist-using root

Warning:group Mockbuild does not exist-using root

You need to create a mockbuild user using the AddUser mockbuild command:

[Root@localhost birdofprey]# AddUser Mockbuild

4, reuse the RPM-IVH vsftpd-2.2.2-11.el6_3.1.src.rpm to install the package:

[Root@localhost birdofprey]# RPM-IVH vsftpd-2.2.2-11.el6_3.1.src.rpm

Warning:vsftpd-2.2.2-11.el6_3.1.src.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey

1:VSFTPD ########################################### [100%]

5, the use of command cd/root/rpmbuild/sources/vsftpd/sources into the VSFTPD source code package directory, and the use of TAR-ZXVF Vsftpd-2.2.2.tar.gz Decompression vsftpd-2.2.2.tar.gz Source pack:

[Root@localhost sources]# TAR-ZXVF vsftpd-2.2.2.tar.gz

6, use the command CD vsftdp-2.2.2 into the vsfftpd-2.2.2 source directory:

[Root@localhost sources]# CD vsftpd-2.2.2

7, the use of the command VI features.c Modify FEATURES.C file, the line content is: Vsf_cmdio_write_raw (p_sess, "Utf8rn");

Modified to://vsf_cmdio_write_raw (p_sess, "Utf8rn").

8, use the command VI opts.c Modify the OPTS.C file;

Modify the Handle_opts function as follows:

void

Handle_opts (struct vsf_session* p_sess)

{

Str_upper (&P_SESS->FTP_ARG_STR);

if (Str_equal_text (&p_sess->ftp_arg_str, "UTF8 on"))

//{

Vsf_cmdio_write (p_sess, Ftp_optsok, "Always in UTF8 mode");

//}

Else

//{

Vsf_cmdio_write (p_sess, ftp_badopts, "Option not understood.");

//}

}

9, return to the upper directory and use the TAR-ZCVF vsftpd-2.2.2.tar.gz vsftpd-2.2.2/command to compress vsftpd-2.2.2.tar.gz files:

[Root@localhost sources]# TAR-ZCVF vsftpd-2.2.2.tar.gz vsftpd-2.2.2/

We use the LS-command to see that the vsftpd-2.2.2.tar.gz file creation time in the list is already in the current creation time, as follows:

-rw-rw-r--. 1 mockbuild mockbuild 186982 May 3 15:39 vsftpd-2.2.2.tar.gz

-rw-r--r--. 1 mockbuild mockbuild 2828 February 00:06 vsftpd-2.2.2-uint-uidgid.patch

-rw-r--r--. 1 mockbuild mockbuild 1640 February 00:06 Vsftpd-2.2.2-v6only.patch

-rw-r--r--. 1 mockbuild mockbuild 514 February 00:06 Vsftpd-close-std-fds.patch

-rwxr-xr-x. 1 mockbuild mockbuild 338 February 00:06 vsftpd_conf_migrate.sh

-rw-r--r--. 1 mockbuild mockbuild 125 February 00:06 vsftpd.ftpusers

-rwxr-xr-x. 1 mockbuild mockbuild 2824 February 00:06 vsftpd.init

-rw-r--r--. 1 mockbuild mockbuild 335 February 00:06 Vsftpd.pam

-rw-r--r--. 1 mockbuild mockbuild 361 February 00:06 vsftpd.user_list

-rw-r--r--. 1 mockbuild mockbuild 345 February 00:06 vsftpd.xinetd

10, enter the source code under the specs directory, and use the RPMBUILD-BB vsftpd.spec command to generate VSFTPD-2.2.2-11.EL6.1.X86_64.RPM:

[Root@localhost specs]# RPMBUILD-BB Vsftpd.spec

The following error is reported because the system lacks a dependency pack:

error:failed Build Dependencies:

Libcap-devel is needed by vsftpd-2.2.2-11.el6.1.x86_64

Tcp_wrappers-devel is needed by vsftpd-2.2.2-11.el6.1.x86_64

We can find the following RPM package from the CentOS6.4 installation disk to install manually, the package name is as follows:

libattr-2.4.44-7.el6.i686.rpm libcap-devel-2.16-5.5.el6.x86_64.rpm

libattr-2.4.44-7.el6.x86_64.rpm tcp_wrappers-devel-7.6-57.el6.i686.rpm

libattr-devel-2.4.44-7.el6.i686.rpm tcp_wrappers-devel-7.6-57.el6.x86_64.rpm

libattr-devel-2.4.44-7.el6.x86_64.rpm tcp_wrappers-libs-7.6-57.el6.i686.rpm

libcap-2.16-5.5.el6.i686.rpm tcp_wrappers-libs-7.6-57.el6.x86_64.rpm

libcap-2.16-5.5.el6.x86_64.rpm vsftpd-2.2.2-11.el6_3.1.src.rpm

libcap-devel-2.16-5.5.el6.i686.rpm

11, the above packages using the RPM-IVH *.rpm-force--nodeps command for forced installation:

[Root@localhost rpm]# rpm-ivh *.rpm--force--nodeps

Warning:libattr-2.4.44-7.el6.i686.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey

Preparing ... ########################################### [100%]

1:libattr ########################################### [8%]

2:libcap ########################################### [17%]

3:tcp_wrappers-libs ########################################### [25%]

4:libattr ########################################### [33%]

5:libcap ########################################### [42%]

6:tcp_wrappers-libs ########################################### [50%]

7:tcp_wrappers-devel ########################################### [58%]

8:libcap-devel ########################################### [67%]

9:libattr-devel ########################################### [75%]

10:tcp_wrappers-devel ########################################### [83%]

11:libcap-devel ########################################### [92%]

12:libattr-devel ########################################### [100%]

12, again use RPMBUILD-BB Vsftpd.spec to recompile the VSFTPD-2.2.2-11.EL6.1.X86_64.RPM package:

[Root@localhost specs]# RPMBUILD-BB Vsftpd.spec

13, into the x86_64 directory, you can see that the directory has been generated by the relevant RPM package:

The command mode is as follows:

[Root@localhost rpms]# CD x86_64/

[Root@localhost x86_64]# ls

vsftpd-2.2.2-11.el6.1.x86_64.rpm vsftpd-debuginfo-2.2.2-11.el6.1.x86_64.rpm

14. Reinstall the VSFTPD Application Server component package that has been modified by the source code:

[Root@localhost x86_64]# RPM-IVH vsftpd-2.2.2-11.el6.1.x86_64.rpm

Preparing ... ########################################### [100%]

1:VSFTPD ########################################### [100%]

15, CentOS6.4 Modify the system default character set:

[Root@localhost/]# vi/etc/sysconfig/i18n

Modify the original file to the following:

#LANG = "ZH_CN." UTF-8 "

Lang= "ZH_CN. GB18030 "

Supported= "ZH_CN. GB18030:zh_CN:zh:zh_CN. Gb2312:en_us. Utf-8:en_us:en "

Sysfont= "Latarcyrheb-sun16"

At this time all the modification work has been completed, after the FTP application server, we use IE browser in the Windows system and early application software to test the Chinese garbled problem disappeared. This workaround also applies to garbled problems that exist in the RHEL6 series operating system that are vsftpd to Windows client character set compatibility.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.