我的 Apache Web 服務器在433帶有https協議的埠上運行。我希望在 port 上運行 Tomcat8080因為不需要額外的加密,Tomcat 在同一臺機器上,所以我不需要 port 8433。但是,當我將流量從通過轉發433到8080通過iptables但出現錯誤:此站點無法提供安全連接
ERR_SSL_PROTOCOL_ERROR
我需要在 tomcat 中進行哪些配置server.xml才能apache.conf使其正常作業?
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- I've tried this before when I thought I need an SSL for Tomcat. I think it's irrelevant now -->
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
certificateFile="conf/localhost-rsa-cert.pem"
certificateChainFile="conf/localhost-rsa-chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
在httpd.conf
<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot "/var/www/html"
DirectoryIndex index.html
ServerName mydomain.zone
ErrorLog "/var/log/httpd/mydomain.zone.error_log"
CustomLog "/var/log/httpd/mydomain.zone.access_log" common
RewriteEngine on
RewriteCond %{SERVER_NAME} =mydomain.zone
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Include /etc/httpd/conf/httpd-le-ssl.conf
編輯:我試圖洗掉 iptables 規則,然后在 httpd.conf 中添加:
ProxyPass / http://www.mydomain.zone:8080
ProxyPassReverse / http://www.mydomain.zone:8080
但我收到訊息:服務不可用 由于維護停機或容量問題,服務器暫時無法為您的請求提供服務。請稍后再試。(Tomcat 正在運行,我檢查并重新啟動了 Apache)。
I've noticed that my web app works with normal HTTP protocol currently, but not with https, and I need to type:8080
uj5u.com熱心網友回復:
我發生了 2 個問題,問題與代理規則無關,我正確地撰寫了它們。
我在這里找到了第一個問題的解決方案:http: //sysadminsjourney.com/content/2010/02/01/apache-modproxy-error-13permission-denied-error-rhel/
顯然,SELinux 不允許 httpd 無法發起出站連接。我需要允許它:/usr/sbin/setsebool -P httpd_can_network_connect 1
第二個問題是我的 Tomcat 使用了太多的 RAM 記憶體,因為我在 Apache 中配置了 SSL server.xml,但我的 Apache 中已經啟用了 SSL。當我對此發表評論時,Tomcat 減少了他的 RAM 消耗。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/432406.html
下一篇:在“org.springframework.beans.factory.config.BeanExpressionContext”型別的物件上找不到屬性或欄位
