在虚拟主机上的Apache 2.4中,我有: UseCanonicalName On ServerName somename ServerAlias www.someothername.com 根据文件: 使用UseCanonicalName在Apache上将使用ServerName指令中指定的主机名和端口来构造服务器的规范名称。 此名称用于所有自引用URL,以及CGI中的SERVER_NAME和SERVER_PORT的值。 所以在我的Tomcat / CFML应用程序中,当我访问URL www.someothername.com我期望在CGI范围内看到: server_name: somename 但是我得到: server_name: www.someothername.com 就像这个指令完全被忽略了一样。 # Proxy CFML files to Tomcat RewriteCond %{REQUEST_FILENAME} /[^/:]+\.cfml*($|/) RewriteRule (.*) ajp://%{HTTP_HOST}:8009$1 [P,L] 我也试过: RewriteRule (.*) ajp://%{SERVER_NAME}:8009$1 [P,L] 并使用mod_proxy而不是AJP: RewriteRule (.*) http://%{SERVER_NAME}:8888$1 [P,L] 最后2个在somename上引起DNS查询,但是仍然返回CGI.SERVER_NAME字段中的www.someothername.com 我应该指出,我这样做的唯一原因是因为我正在使用mod_cfml进行大量虚拟主机以自动创buildtomcat上下文,我希望上下文和应用程序使用从vhostconfiguration派生的简短名称。 我想我可以只设置一个头(甚至重写主机:头),但使用ServerName似乎是最优雅的解决scheme。 更新:有一些我注意到在客户端头可能是相关的。 有2个我以前没见过的标题: x-forwarded-host: www.someothername.com x-forwarded-server: somename 我需要知道什么设置这些标题和原因。 我假设它是Tomcat或mod_cfml。 […]
跨源资源共享是一种支持跨源请求的机制[1] 。 正如您可以在链接[1]中看到的那样,在Apache Tomcat 7中启用CORS很容易。只需要在文件web.xml进行configuration即可。 当我正在testing通常在Tomcat上执行的Glassfish的服务以决定从Tomcat到Glassfish的迁移时,我需要在Glassfish上启用CORS。 又怎样? 我正在使用Glassfish 3.0.1。
按照我的标题,我能够在我的VPS上成功安装和运行Railo和Apache。 它运行Ubuntu 14.04。 我的dillema是我无法获取example.com指向我的Railo根目录。 现在, example.com指向/ var / www 而 example.com:8888指向我的Railo根目录。 如何让example.com指向Railo根? 我很感激任何人都可以指出我正确的方向。 谢谢! 这是我追加到/opt/railo/tomcat/conf/server.xml <Host name="example.com" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="/opt/railo/tomcat/webapps/ROOT/gph" /> <Alias>www.example.com</Alias> inheritance人我的默认configuration <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # […]
我正在使用mod_proxy_ajp来Tomcat 。 如果我启用mod_spdy … 这是否意味着通过代理连接将启用SPDY ?
我必须在各种应用程序服务器(一开始,这将是JBoss 6,Tomcat 8独立和Tomcat 8embedded到Spring引导1.2应用程序)与Apache 2.4。 因此,我决定去mod_proxy(而不是jk,ajp或类似的东西)。 从我所知道的我设置Apache和应用程序服务器重用/池连接。 但是当我计算开放端口的数量时,我看到了几千个: $ netstat | grep :80 | wc -l 4630 (我在Windows上,上面的命令在Cygwin中运行,所以不要混淆,Apache等运行本地,这意味着没有cygwin模拟层)我可能已经预计可能有一千个端口,但不是更多。 这是我的Apache反向代理configuration: <VirtualHost *:80> ServerAdmin … ProxyRequests Off ProxyPreserveHost On ProxyPass / http://localhost:8080/ connectiontimeout=5 timeout=30 ProxyPassReverse / http://localhost:8080/ ServerName … ErrorLog "logs/foo.log" CustomLog "logs/foo-access.log" common </VirtualHost> MPM是活跃的,我可以使用多达150个传入连接,至less这是我从判断服务器状态来判断… … 1 requests currently being processed, 149 idle workers … ..和Apache的configuration: […]
我是服务器端的新手,想要在Eclipse环境下在eclipse的tomcat中configurationAJP连接器来启用SSL。 我想在不使用密钥库的情况下在tomcat中启用SSL。 我创build了key.pem,cert.pem和cert.crt。 而且不要接下来做什么。 任何身体可以帮助吗? 使用以下命令: openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 999 openssl x509 -outform der -in cert.pem -out cert.crt 在server.xml <Connector port="8443" maxThreads="200" scheme="https" secure="true" SSLEnabled="true" SSLCertificateFile="/root/keyTest/cert.pem" SSLCertificateKeyFile="/root/keyTest/key.pem" clientAuth="optional" SSLProtocol="TLSv1"/> 但有一个错误 SEVERE: Failed to load keystore type JKS with path /root/.keystore due to /root/.keystore (No such file or directory) […]
我有我的API在tomcat服务器上运行,并想知道如何处理多个传入的请求,即当服务器同时收到多个请求是并行处理还是一个接一个地处理?
我有一个运行Apache反向代理的Tomcat应用程序。 我试图限制只能从本地主机访问经理和主机pipe理器上下文。 所以我从两个上下文中取消了关于context.xml文件的以下行: <!– Remove the comment markers from around the Valve below to limit access to the manager application to clients connecting from localhost –> <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> 但是当我尝试从本地主机访问这些上下文时,它总是向我显示错误403页面。 我没有在allow属性中得到d +的东西,所以我也试过allow =“127 \ .0 \ .0 \ .1 | :: 1 | 0:0:0:0:0:0:0:1”也没有运气。 在我的context.xmlconfiguration中有什么问题吗? 当它们首先通过apache的mod_proxy( ProxyPass ajp:// localhost:8009 )进行过滤时,它的行为是否有所不同? 谢谢
我有两个服务器,我一直在努力configuration使用现代密码。 一个正在工作,另一个似乎报告结果不一。 我不确定问题是什么。 具体来说,当我检查ServerA我得到: 连接使用AES_256_CBCencryption,使用HMAC-SHA1进行消息authentication,使用DHE_RSA作为密钥交换机制 但是当我检查ServerB时,我得到: 连接使用AES_128_GCM进行encryption,并使用DHE_RSA作为密钥交换机制 ServerA – Linux tomcat 7.0.37 java 1.7_0_17 ServerB – Linux tomcat 7.0.54 java 1.8.0_31-b13 我已经使用这里指定的密码进行了configuration: https://blog.eveoh.nl/2014/02/tls-ssl-ciphers-pfs-tomcat/ 工作的ServerA具有以下server.xml def: <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="conf/keystore.jks" keystorePass="changeit" ciphers="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA" /> 非工作的ServerB具有以下server.xml def <Connector port="8443" scheme="https" secure="true" protocol="HTTP/1.1" SSLEnabled="true" sslProtocol="TLS" URIEncoding="UTF-8" compression="on" keyPass="changeit" keyAlias="tomcat" compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css,application/x-javascript,application/javascript,application/json" useServerCipherSuitesOrder="true" server="WCC" sslEnabledProtocols="TLSv1.2,TLSv1.1,TLSv1" […]
我试图重新启动tomcat8,但我得到了以下警告: SEVERE [main] org.apache.coyote.AbstractProtocol.init Failed to initialize java.net.BindException: Address already in use 我试图通过在线发现的各种方法来确定进程,包括杀死java和tomcat。 每次我杀死进程时,我再次检查另一个tomcat进程已经开始。 我将如何去从源头上杀死进程。 以下是从输出 ps -ef | grep [t]omcat 我假设第二列是PID,但是鉴于有这么多我不想杀了所有的东西,因为害怕会变得更糟。 tomcat 4328 14814 0 09:48 pts/1 00:00:00 ps -ef tomcat 4329 14814 0 09:48 pts/1 00:00:00 grep –color=auto [t]omcat root 13659 947 0 Oct01 ? 00:00:00 sshd: tomcat [priv] tomcat 13707 13659 0 […]