UTF-8 Problems on Centos/Cpanel with Tomcat 5

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

cjhowland

Thread Starter
Joined
Aug 6, 2007
Messages
2
I am having problems with a site for a hong-kong based customer who wants to use chinese characters in web page URIs. I have set up all the configuration options I have found in various forums and have this working perfectly for pure HTML pages served by Apache and for Tomcat served pages following a system reboot. However, although this is working correctly at reboot as soon as Tomcat is restarted the UTF-8 characters are no longer accepted and generate a 404 not found error (even on a pure HTML page within a Tomcat context).

This is driving me slightly mad - what is the difference between starting Tomcat at a server reboot and starting Tomcat on its own?

Any help or pointers would be greatly appreciated ...

My setup is on a Centos/CPanel server where I have WHM access :

Tomcat 5.5.36
Centos 5.11
WHM : 54.0 Build 16
Cpanel :
Apache : Apache/2.4.10 (Unix) OpenSSL/0.9.8e-fips-rhel5 mod_jk/1.2.37 mod_bwlimited/1.4

I have the following configurations set to get a /hongkong context to route through Tomcat and use UTF-8 (with various custom options that are server wide that relate to other Tomcat sites) :

1. Custom Tomcat startup options in : /var/cpanel/tomcat.options

-Xmx2048m
-Xms2048m
-Xmn1024m
-XX:permSize=5120m
-XX:MaxPermSize=5120m
-XX:+DisableExplicitGC
-verbose:gc
-Dsun.jnu.encoding=UTF-8
-Dfile.encoding=UTF-8


2. Context set up in : /var/cpanel/templates/tomcat/server.xml.host_entry.default

<Context
path="hongkong"
docbase="[% appbase %]/hongkong"
debug="0"
reloadable="true"/>

3. Server.xml entries in : /usr/local/jakarta/apache-tomcat-5.5.36/conf/server.xml :

<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
useBodyEncodingForURI = "true" URIEncoding="UTF-8"/>
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->

<!-- Note : To use gzip compression you could set the following propert
ies :

compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
-->

<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<!--
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
useBodyEncodingForURI = "true" URIEncoding="UTF-8"/>
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3"
useBodyEncodingForURI = "true" URIEncoding="UTF-8"/>
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top