server.xml

Tomcat 7 GZIP compression not working

时光毁灭记忆、已成空白 提交于 2019-12-02 20:16:34
I have added the following lines in tomcat's conf/server.xml file to enable gzip compression but its not working. Pages are still uncompressesd. <Connector port="8080" compression="on" compressionMinSize="2048" noCompressionUserAgents="gozilla, traviata" compressableMimeType="text/html,text/xml,text/plain,text/css, text/javascript,text/json,application/x-javascript, application/javascript,application/json"/> Any idea? If Tomcat is fronted by Apache on port 80, you will need to enable compression in Apache itself. The compression in Tomcat will only work if you access it directly on port 8080.

does maxPostSize apply to multipart/form-data file uploads

为君一笑 提交于 2019-12-01 03:28:04
I have a webapp on a Tomcat server that allows files to be uploaded. There is a limit on the size of a file upload, and I'd like that limit to be enforced preemptively (ie, once you cross the limit, the file upload fails, rather than transferring the whole file, checking that it's too big and then sending an error). I tried to do this by add maxPostSize="1000" to the connector section in the relevant connector in server.xml, but I can still upload larger files. I've seen a post indicating that maxPostSize only works for a specific content type. So my question is whether what I'm doing is

Encrypt tomcat keystore password

烈酒焚心 提交于 2019-11-30 02:26:24
Is there an option to encrypt keystorePass value in tomcat server.xml ? I don't want it to be a plain text <Connector port="8403" //... keystorePass="myPassword" /> If someone has access to your server.xml, the plain text value of your keystorePass appearing are only one of your worries. If someone has access from there, they could do much more harm. Encrypting the password here is really just moving the problem elsewhere as then someone could find the encryption key for this encryption key (a bit like a Russian doll). If you want to encrypt the password, you have to override the Connector

Failed to initialize connector [duplicate]

不打扰是莪最后的温柔 提交于 2019-11-29 15:45:28
问题 This question already has answers here : What does “The APR based Apache Tomcat Native library was not found” mean? (11 answers) APR based Apache Tomcat Native library was not found on the java.library.path? (4 answers) Closed 5 months ago . SEVERE: Failed to initialize component [Connector[org.apache.coyote.http11.Http11AprProtocol-8443]] org.apache.catalina.LifecycleException: The configured protocol [org.apache.coyote.http11.Http11AprProtocol] requires the APR/native library which is not

Encrypt tomcat keystore password

假装没事ソ 提交于 2019-11-28 23:22:03
问题 Is there an option to encrypt keystorePass value in tomcat server.xml ? I don't want it to be a plain text <Connector port="8403" //... keystorePass="myPassword" /> 回答1: If someone has access to your server.xml, the plain text value of your keystorePass appearing are only one of your worries. If someone has access from there, they could do much more harm. Encrypting the password here is really just moving the problem elsewhere as then someone could find the encryption key for this encryption

Start webapps in tomcat in a determinate order

依然范特西╮ 提交于 2019-11-28 03:29:06
问题 I have 2 webapps: WebApp 2 depends from WebApp 1 If WebApp 1 is not running, WebApp 2 fails Can I define in tomcat that I always want that webapp 1 starts before webapp 2? 回答1: According to the Apache wiki (at http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q27): There is no expected startup order. Neither the Servlet spec nor Tomcat define one. You can't rely on the apps starting in any particular order. 回答2: It is true that tomcat does not provide any way to enforce deployment order. Tomcat

Redirect HTTP to HTTPS:PORT in Tomcat

元气小坏坏 提交于 2019-11-27 03:06:45
问题 I have a running tomcat application that already have the following redirection rule from HTTP to HTTPs: <Connector executor="tomcatThreadPool" port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" /> Is it possible to add an exception/rule, that a specific HTTPrequest (http://www.example.com), will be redirected to another specific address , with a port specified (say https://www.example.com:8443/test), without changing/removing the above Connector ? 回答1: The connector