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

Garbled characters appear when starting tomcat on a linux server

王林
王林Original
2019-12-12 11:00:273290browse

Garbled characters appear when starting tomcat on a linux server

1. Ensure that the linux server uses utf-8

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

and change it to

zh_CN.UTF-8

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"

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

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!

Statement:
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