In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to solve the Vsftpd Chinese garbled code in CentOS 6.4". In the daily operation, I believe that many people have doubts about how to solve the problem of Vsftpd Chinese garbled code in CentOS 6.4. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt that "how to solve the Vsftpd Chinese garbled code in CentOS 6.4". Next, please follow the editor to study!
Garbled code occurred when the Windows client accesses the FTP application server. This is due to the headache caused by the incompatibility between UTF-8 and GBK, which can be solved by compiling and installing with source code.
Garbled resolution process:
1. First use rpm-e vsftpd to uninstall the default VSFTPD application server installed by the system:
[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 will be 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
At this point, you need to use the adduser mockbuild command to create a mockbuild user:
[root@localhost birdofprey] # adduser mockbuild
4. Use rpm-ivh vsftpd-2.2.2-11.el6_3.1.src.rpm again 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. Use the command cd / root/ rpmbuild/SOURCES/vsftpd/SOURCES to enter the directory of the vsftpd source package, and use tar-zxvf vsftpd-2.2.2.tar.gz to decompress the vsftpd-2.2.2.tar.gz source package:
[root@localhost SOURCES] # tar-zxvf vsftpd-2.2.2.tar.gz
6. Use the command cd vsftdp-2.2.2 to enter the vsfftpd-2.2.2 source directory:
[root@localhost SOURCES] # cd vsftpd-2.2.2
7. Use the command vi features.c to modify the features.c file; change the line content to: vsf_cmdio_write_raw (p_sess, "UTF8\ r\ n")
Modify to: / / vsf_cmdio_write_raw (p_sess, "UTF8\ r\ n").
8. Use the command vi opts.c to modify the opts.c file
Modify the handle_opts function as follows:
The code is as follows:
Void
Handle_opts (struct vsf_session* p_sess)
{
Str_upper (& pairsesss-> ftp_arg_str)
/ / if (str_equal_text (& UTF8 ON-> 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 recompress the vsftpd-2.2.2.tar.gz file:
[root@localhost SOURCES] # tar-zcvf vsftpd-2.2.2.tar.gz vsftpd-2.2.2/
Using the ls-command, we can see that the creation time of the vsftpd-2.2.2.tar.gz file in the list is the current creation time, as shown below:
The code is 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 13 00:06 vsftpd-2.2.2-uint-uidgid.patch
-rw-r--r--. 1 mockbuild mockbuild 1640 February 13 00:06 vsftpd-2.2.2-v6only.patch
-rw-r--r--. 1 mockbuild mockbuild 514 February 13 00:06 vsftpd-close-std-fds.patch
-rwxr-xr-x. 1 mockbuild mockbuild 338 February 13 00:06 vsftpd_conf_migrate.sh
-rw-r--r--. 1 mockbuild mockbuild 125 February 13 00:06 vsftpd.ftpusers
-rwxr-xr-x. 1 mockbuild mockbuild 2824 February 13 00:06 vsftpd.init
-rw-r--r--. 1 mockbuild mockbuild 335 February 13 00:06 vsftpd.pam
-rw-r--r--. 1 mockbuild mockbuild 361 February 13 00:06 vsftpd.user_list
-rw-r--r--. 1 mockbuild mockbuild 345 February 13 00:06 vsftpd.xinetd
10. Enter the SPECS directory under the source code package, 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
At this point, the following error will be reported because the system lacks a dependency package:
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 manually install the following RPM package from the CentOS6.4 installation disk, and 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. Use the command rpm-ivh * .rpm-force-- nodeps to forcibly install the above packages:
[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. Use rpmbuild-bb vsftpd.spec to recompile the vsftpd-2.2.2-11.el6.1.x86_64.rpm package again:
[root@localhost SPECS] # rpmbuild-bb vsftpd.spec
13. Enter the x86room64 directory, and you can see that the relevant RPM packages have been generated in this directory:
The command mode is as follows:
The code 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 source code:
[root@localhost x861464] # rpm-ivh vsftpd-2.2.2-11.el6.1.x86_64.rpm
Preparing... # [100%]
1:vsftpd # # [100%]
15. CentOS6.4 modifies the system default character set:
[root@localhost /] # vi / etc/sysconfig/i18n
Modify the original file to the following:
The code is as follows:
# 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, and after we restart the FTP application server, we use the IE browser in the windows system and the previous application software to test the Chinese garbled problem disappeared. This solution is also applicable to the garbled problem caused by the compatibility of VSFTPD with windows client character sets in RHEL6 operating systems.
At this point, the study of "how to solve the Vsftpd Chinese garbled code in CentOS 6.4" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.