Home > Operation and Maintenance > Linux Operation and Maintenance > Garbled characters appear when starting tomcat on a linux server

Garbled characters appear when starting tomcat on a linux server

王林
Release: 2019-12-12 11:00:27
Original
3458 people have browsed it

Garbled characters appear when starting tomcat on a linux server

1. Ensure that the linux server uses utf-8

local -a   //查看支持的字体
Copy after login
vi /etc/sysconfig/i18n
Copy after login

and change it to

zh_CN.UTF-8
Copy after login

2. Client software Xshell, putty, SSH Secure Shell Client and other client encodings are changed to utf-8

Free video tutorial sharing:linux video tutorial

3. Modify the server.xml file encoding to utf-8

URIEncoding="UTF-8"
Copy after login

4. Modify the catalina.sh file

if [ -z "$LOGGING_MANAGER" ]; then
  JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dfile.encoding=UTF8 
  -Dsun.jnu.encoding=UTF8"
else 
  JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Dfile.encoding=UTF8 -Dsun.jnu.encoding=UTF8"
fi
Copy after login

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of Garbled characters appear when starting tomcat on a linux server. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template