我正在做一个path重写设置和环境variables,这将导致mod_jk使用特定的JBoss服务器。 适用于任何应用程序path。 当我尝试我们的监视servelet(做一个简单的数据库来certificate堆栈是可操作的),它匹配重写,重写,设置env var,但却无法实际处理URL的第二次。 为什么通过重写引擎第二次旅行的不一致行为? 模式是,如果/workername/被预先添加到path中,它将删除,但将该值用作mod_jk装载的JK_WORKER_NAME 。 configuration示例: SetHandler jakarta-servlet SetEnv JK_WORKER_NAME mexico RewriteEngine on RewriteRule ^/(mexico[1-2])/(.*)$ /$2 [E=JK_WORKER_NAME:$1,L] (mod_jk工人被命名为mexico1和mexico2) 点击https://hostname/mexico2/public/gateway.sf得到重写,然后第二遍通过重写引擎,由mod_JK处理并传递给应用程序服务器。 一切顺利,看到日志(向右滚动好位) 10.1.1.163 – – [26/Aug/2013:14:10:44 –0400] [publisher.internal.test.hnw.com/sid#2ad8c96bc310][rid#2ad8bde6fae0/initial] (2) init rewrite engine with requested uri /mexico2/public/gateway.sf 10.1.1.163 – – [26/Aug/2013:14:10:44 –0400] [publisher.internal.test.hnw.com/sid#2ad8c96bc310][rid#2ad8bde6fae0/initial] (3) applying pattern '.*' to uri '/mexico2/public/gateway.sf' 10.1.1.163 – – [26/Aug/2013:14:10:44 –0400] [publisher.internal.test.hnw.com/sid#2ad8c96bc310][rid#2ad8bde6fae0/initial] […]
我正在实施一个Grails / Groovynetworking应用程序,我想限制用户的file upload大小,我不希望有人上传一个10GB的文件到我的服务器。 我想到的是大多数的方法来计算大小是在文件已经上传之后完成的,如果有人提出了10个configuration文件并上传了10GB大小的10个文件? 这可以耗尽服务器,并占用服务器磁盘上的这么多空间。 所以我试图阻止这一点。 我发现Apache Tomcat允许进行以下configuration,使用硬编码或Annotation方法。 我不确定是否在上传过程中或在将file upload到临时位置之后计算最大文件大小。 文件显示如下: @MultipartConfig批注支持以下可选属性: 位置:文件系统上目录的绝对path。 位置属性不支持相对于应用程序上下文的path。 此位置用于在处理零件时或文件大小超过指定的fileSizeThreshold设置时临时存储文件。 默认位置是“”。 fileSizeThreshold:文件大小(以字节为单位),文件临时存储在磁盘上。 默认大小是0字节。 MaxFileSize:上传文件允许的最大大小(以字节为单位)。 如果上传文件的大小大于这个大小,Web容器将抛出一个exception(IllegalStateException)。 默认大小是无限的。 maxRequestSize:多部分/表单数据请求所允许的最大大小(以字节为单位)。 如果所有上传的文件的总大小超过此阈值,则Web容器将引发exception。 默认大小是无限的。 注解方式: @MultipartConfig(location="/tmp", fileSizeThreshold=1024*1024, maxFileSize=1024*1024*5, maxRequestSize=1024*1024*5*5) 这里是硬编码值: <multipart-config> <!– 50MB max –> <max-file-size>52428800</max-file-size> <max-request-size>52428800</max-request-size> <file-size-threshold>0</file-size-threshold> </multipart-config> 我很感激,如果任何人都可以澄清,如果在上传过程中计算MaxFileSize。
尝试使用Tomcat启动新应用程序时出现此错误: Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used. For more information, see: http://wiki.apache.org/solr/SolrLogging 我没有使用Jetty,我使用的是Tomcat,所以我的安装说明略有不同。 我已经检查了这个链接,并在这里广泛阅读 – 看起来像库需要在$ CATALINA_BASE / lib – 在我的情况应该是: /usr/local/easy/share/easy-tomcat7/lib 不过我把图书馆放在那里 – 没有骰子。 这是lib目录: ./ commons-io-2.3.jar jsp-api.jar slf4j-api-1.7.6.jar […]
我正在通过RUNNING.txt文件来安装Tomcat。 它说: (3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional) The CATALINA_HOME environment variable should be set to the location of the root directory of the "binary" distribution of Tomcat. 所以我知道我可以做 export CATALINA_HOME=/usr/local/tomcat 但是下次重新启动机器时就不会这样了。 我应该把这些在根帐户.bashrc或.bash_profile或其他地方?
我正在使用Apache HTTPD代理本地Tomcat服务器: ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ 一切工作正常,除非我有一个302redirect。 出于某种原因,ProxyPassReverse不会重写localhost:8080,客户端将被redirect到localhost:8080,从而导致浏览器错误。 我怎样才能得到ProxyPassReverse 302redirect工作?
在我们的老服务器(托pipe)上,Artifactory运行在Apache代理之后。 公开的url是http://repo.example.com/ 我们的托pipe服务提供商把我们搬到了新的服 安装了新版本的Artifactory,从旧服务器导出数据并导入到新服务器中 Artifactory现在运行在Nginx之后 公开的url现在是http://repo.example.com/artifactory/ 我们要求我们的托pipe服务提供商将url更改回http://repo.example.com/ ,因为现在我们的Jenkins工作正在中断,而外部用户可能依赖于该url。 他们告诉我,我首先需要改变Artifactory中的一些设置(没有详细说明),但是我可以在Web界面中find的唯一设置是自定义url库,并且已经设置为http:// repo。 example.com 。 我最好的猜测是在运行Artifactory的Tomcat服务器的configuration中需要改变某些东西 Tomcat的configuration不在我的专业领域 我无法自己更改configuration,我没有对这些文件的写入权限。 我真正需要的是一个configuration,我可以发送到我们的托pipe服务提供商,所以他们可以从我的电子邮件复制粘贴。 短版本: 如何在http://repo.example.com上访问运行在Nginx后面的Artifactory? 编辑:这是当前的/usr/local/artifactory/tomcat/conf/server.xml : <Server port="8015" shutdown="SHUTDOWN"> <Service name="Catalina"> <Connector port="8083"/> <Engine name="Catalina" defaultHost="localhost"> <Host name="localhost" appBase="webapps"/> </Engine> </Service> </Server> 将它改为: <Server port="8015" shutdown="SHUTDOWN"> <Service name="Catalina"> <Connector port="8083"/> <Engine name="Catalina" defaultHost="localhost"> <Host name="localhost" appBase="webapps"> <Context path="" docBase="."/> </Host> </Engine> […]
我有以下清单configurationTomcat使用8983端口,而不是: include java class { 'tomcat': install_from_source => false } tomcat::instance {'default': package_name => 'tomcat7'} -> tomcat::service {'default': use_jsvc => false, use_init => true, service_name => 'tomcat7' }-> tomcat::config::server { 'tomcat7': catalina_base => '/usr/share/tomcat7', port => 8983, } 但是,运行时,我有以下错误: $ sudo puppet apply -vd tomcat-test.pp debug: Augeas[server-/usr/share/tomcat7](provider=augeas): Augeas version 1.3.0 is installed debug: Augeas[server-/usr/share/tomcat7](provider=augeas): sending […]
我发现,当访问使用客户端证书身份validation的Web应用程序在Firefox或Chrome上运行Tomcat / APR(在Windows上)时,客户端证书在短时间内“丢失”。 对于应用程序,它似乎没有发送客户端证书。 示例代码(JSP片段): User client cert data: <%= ((java.security.cert.X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate"))[0]. getSubjectX500Principal().toString()%> 刷新页面(显示客户端证书的DN)后,页面将失败,并发出NullPointerExceptionexception, request.getAttribute将返回null 。 它通常发生在不到一分钟的时间。 更确切地说,每秒重新加载一次,几乎每次都在30秒后出现。 之后,每个请求将以相同的方式失败,直到我重新启动tomcat(或者重新启动Firefox,或者只是清除Firefox中的“Active Logins”,然后在新的连接上重新select证书)。 重新启动后,问题总是返回(如果我再次重新启动,则会消失30秒)。 Firefox(v39和v40)和Chrome(v44)发生这种情况,IE v11则不会。 它也发生在不同版本的tomcat和Java(以及操作系统位数)上。 使用最新版本的testing案例是: 下载并解压apache-tomcat-8.0.24-windows-x64.zip 在webapps文件夹中创build一个名为cert的文件夹,在那里创build一个名为ccertA.jsp的文件,其中包含上面的代码片段 在server.xml中添加一行: <连接器端口=“8443”protocol =“org.apache.coyote.http11.Http11AprProtocol”secure =“true”scheme =“https”maxThreads =“150”URIEncoding =“UTF-8”SSLVerifyClient =“可选”SSLProtocol =“ TLSv1 + TLSv1.1 + TLSv1.2“SSLPassword =”testing“SSLEnabled =”true“SSLCertificateKeyFile =”C:/your_server_key_private.pem“SSLCertificateFile =”C:/ your_server_key _public.pem“SSLCACertificateFile =”C:/supported_client_CAs.pem “/> 通过执行startup.bat启动tomcat 打开https:// localhost:8443 / cert / […]
我的IT团队使用Tenable的日志关联引擎,我们的Linux服务器将syslog写入LCE。 有没有办法将我们的Tomcat和PostgreSQL应用程序日志写入LCE?
我试图优化网站的速度,在这个过程中,我发现。 每次请求页面时都会产生大约620毫秒的连接时间。 详细信息请参见下面的截图 这是持久的。 有什么办法可以减less这个时间吗? 可能的原因是什么? 这是因为SSL吗? 本网站仅作为https://www.winni.in访问 或者这是DNS的问题? 截至目前,我正在使用Godaddy DNS。 切换到AWS Route 53会带来什么好处。 我使用nginx服务器作为Apache Tomcat的代理。