バグ #567
みぞ @mizo0203 さんがほぼ5年前に更新
- ステータス を 新規 から 完了 に変更
- 進捗率 を 0 から 100 に変更
環境¶
- CentOS 7
- Tomcat 7
解決策¶
/etc/tomcat/server.xml
の 73 行目付近に
URIEncoding="UTF-8"
と useBodyEncodingForURI="true"
を追記して、Tomcat を再起動で解決
修正後の /etc/tomcat/server.xml
から抜粋¶
<!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true" />
Tomcat 再起動コマンド¶
# systemctl restart tomcat
参考にしたサイト¶
- http://kenken4320.hatenadiary.jp/entry/2013/02/21/233007
- https://blanche-toile.com/web/tomcat-form-input-garbled
- https://teratail.com/questions/16215
- http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html
# cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core)
# tomcat version Server version: Apache Tomcat/7.0.76 Server built: Mar 12 2019 10:11:36 UTC Server number: 7.0.76.0 OS Name: Linux OS Version: 3.10.0-1062.4.3.el7.x86_64 Architecture: amd64 JVM Version: 1.8.0_232-b09 JVM Vendor: Oracle Corporation
# diff /etc/tomcat/server.xml.org /etc/tomcat/server.xml 73c73 < redirectPort="8443" /> --- > redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true" />