Container doesn't use UTF-8 to decode URLs - utf-8

Now, I am trying to use Jenkins. So, I deploy Jenkins.war file in JBoss 7.1.1. And the call from browser using 8080 port. When I click "Manage Jenkins" link, the following warning message is shown.
"Your container doesn't use UTF-8 to decode URLs.
If you use non-ASCII characters as a job name etc,
this will cause problems. See Containers and Tomcat i18n for more details."
I tried to solve it and Find from internet about this problem. I not see any answer to solve.I don't know how to solve it. Please help me! Thanks!

I had the same problem in JBoss 4.2.2. I solved it by editing $JBOSS_HOME/deploy/jboss-web.deployer/server.xml and adding URIEncoding="UTF-8" in the Connector.
<Connector port="9443" protocol="HTTP/1.1" URIEncoding="UTF-8" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />

Related

Completely hide server name Apache Windows

Hope you guys are doing well.
I have one query so I have added the below lines in my windows Apache httpd.conf file with the below tags:-
ServerSignature Off,
ServerTokens Prod,
HostnameLookups Off,
TraceEnable off
And I am getting the below O/P like Server: Apache by using curl -I
Actually I am looking for the O/P like Server: Unknown or Server:""
Note :- Here my windows Apache version is Server version: Apache/2.4.46 (Win64)
Kindly help me here how I can hide this Server information as well, as its a security threat to our Instances.
Thanks
Apache say:
Also note that disabling the Server: header does nothing at all to make your server more secure. The idea of "security through obscurity" is a myth and leads to a false sense of safety.
You would need to modify the source code, or install mod_security, and then you can add:
SecRuleEngine On
SecServerSignature Unknown
You can modify the source code as follows: How to change Apache's 'Server:' header without mod_security?
To remove server header by editing source: https://stackoverflow.com/a/66667833/12154890
Editing the source is probably the only way to remove the Server: header completely.
Since you are using windows, if you cannot install additional modules like mod_security or recompile, you cannot remove it.

I run my first tomcat and i got an error, what should i do?

enter image description here
I got this problem, when first run tomcat, i knew that the first running have always problem, but i did not found resolve for the windows user.
Error running 'Unnamed':..port out of range-1
what should I do?
Inside your Tomcat installation folder, go to "server.xml" file and change:
from:
<Server port="-1" shutdown="SHUTDOWN">
To:
<Server port="8005" shutdown="SHUTDOWN">

Allowing access based on hostname for Manager application in Tomcat

I can't get the configuration for Tomcat right to allow access to the Manager Webapp. We have configured tomcat-users.xml, manager.xml etc. When we allow access based on the IP address it works, but based on the hostname it doesn't. This is the configuration we use:
<Context privileged="true"
docBase="/path/to/tomcat_home/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteHostValve"
allow="localhost|otherhostname" deny="" />
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="172\.30\.\d+\.\d+|127\.0\.0\.1"/>
</Context>
When I remove the RemoteHostValve we can access the manager app (jmxproxy).
Any ideas?
Regards,
Johan-Kees
Check for the exact hostname that host is sending via http (for example with Wireshark), put the hostname with a prefix . into the config and make sure that the hostname is resolvable (i.e. via DNS and/or hosts)...
For reference see:
http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Remote%20Host%20Filter
http://tomcat.apache.org/tomcat-7.0-doc/config/engine.html
http://tomcat.apache.org/migration.html#Manager_application

SSL Enabling Problem: Tomcat in Windows 7 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I downloaded Tomcat 7.08 Windows Service Installer and installed it.
I edited the server.xml to enable https connector port # 8443
I already created the certificate and key pair using the keytool.
keytool -genkey -alias techtracer -keypass ttadmin -keystore techtracer.bin -storepass ttadmin
i started the server then, and tried https://localhost:8443/ but it was not showing anything. Firefox had shown "connected to localhost..." and nothing more.
I cant load any pages in https.
My System: Windows 7 64-bits / 4GB RAM /JDK_JRE 6/ Tomcat 7.08/ Firefox 3.6
Can Any one tell me what is the problem with the SSL in my system.?.Any way to fix this?
Thanks
Mr.k
Solution: Update the server.xml file as follows:
<Connector port="8443"
protocol="org.apache.coyote.http11.Http11Protocol"
SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="C:\Program Files\Java\jdk1.6.0_25\keystore\.keystore"
keystorePass="changeit"
clientAuth="false"
sslProtocol="TLS" />
Please note that I changed the protocol from "HTTP/1.1" to "org.apache.coyote.http11.Http11Protocol" This should fix the problem.
Same system, same configuration, same problem but with Tomcat 6. My solution was to switch to 32bit version of Tomcat. I think this is an issue related to 64bit distributions.
seems like you have to configure your TOMCAT to work with SSL (in addition to all the things that are written above)
have a look here.
In addition, you might need to make another change in your settings.xml (tomcat configuration) and delete the line that refers to the APR listener.
Hope this helps...
Ohad

use multiple CATALINA_BASE to setup tomcat 6 instances on windows

The RUNNING.txt that comes with tomcat distribution indicates the use of CATALINA_BASE variable to enable multiple tomcat instance. But how can I set the CATALINA_BASE environment variable for each tomcat instance directory?
Having multiple Tomcat instances on your development machine is great. Here's how I usually do it for Windows (the important parts for setup are in steps 2, 3, 4 and 5):
Install a copy of Tomcat 6 to a directory (like C:\apache-tomcat-6.0.20).
Copy the conf directory to another directory (like C:\tomcat-1)
Under C:\tomcat-1, create a bin directory
In the C:\tomcat-1\bin directory, create a file called startup.bat that reads like this:
set CATALINA_BASE=C:\tomcat-1
set CATALINA_HOME=C:\apache-tomcat-6.0.20
C:\apache-tomcat-6.0.20\bin\startup.bat
In the C:\tomcat-1\bin directory, create a file called shutdown.bat that reads like this:
set CATALINA_BASE=C:\tomcat-1
set CATALINA_HOME=C:\apache-tomcat-6.0.20
C:\apache-tomcat-6.0.20\bin\shutdown.bat
OPTIONAL: create a file called setenv.bat in the C:\tomcat-1\bin directory to set any environment variables mentioned in C:\apache-tomcat-6.0.20\bin\catalina.bat. This is the place to set system properties, JPDA addresses, etc.
Create the logs, temp, webapps and work directories under C:\tomcat-1
From the C:\tomcat-1 directory, run bin\startup.bat
Repeat for your other installs from step 2 for as many tomcat instances as you need.
Try not to install Tomcat in a directory that has spaces in its name. It should work, but you'll experience fewer problems that way. I do not know how this would work if you were using the "tomcat as a service" option for Windows.
From here, you should be able to isolate tomcat instances. Just be sure to edit your conf\server.xml file so that the shutdown ports and HTTP connector ports don't interfere with other Tomcat instances that may be running. I usually assign values like 8005, 8006, 8007, etc. for the shutdown port and 8080, 8081, 8082, etc. for the HTTP connector port.
There is an easier way. Simply don't define the CATALINA_HOME as a Environment variable on your machine. startup.bat and shutdown.bat already come with the following code:
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
You should be all set.
PS: Remember to edit server.xml and put a new port number though. :)
This link has an answer that worked well for me. One thing some of the other answers seems to ignore is that there are multiple places in the server.xml file that must be modified. Before stumbling on this answer mu tomcat servers were competing with each other for certain ports. I had changed the HTTP/1.1 connector port to 8081, but neglected to change some other ports that apparently mattered for my tomcat (version 7). FWIW I had one tomcat service version and one non-service version.
First server.xml file
<connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<server port="8005" shutdown="SHUTDOWN"/>
<connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<connector port="8100" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
Second server.xml file
<connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<server port="8006" shutdown="SHUTDOWN"/>
<connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
<connector port="8101" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
http://www.ansoncheunghk.info/article/5-steps-install-multiple-apache-tomcat-instance-windows

Resources