茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1670942 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_0296.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2016/9/16 8:46:04
Tomcat listen only on localhost

We want to run servlets on Tomcat and serve them via Apache using the proxy_ajp connector.

On the standard installation, Tomcat was listening on port 8080, which was not blocked by a firewall. This means a servlet was not only accessible via Apache on port 80:
http://www.example.com/servlet


But also via Tomcat on port 8080:
http://www.example.com:8080/servlet


To ensure the only way in to our servlets is via apache, you can try the following fix:
In the Tomcat server.xml add the attribute ‘address=”127.0.0.1″‘ to the HTTP and AJP connectors. This makes Tomcat listen only on the localhost.

Examples:
<Connector address="127.0.0.1" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Connector address="127.0.0.1" port="8009" protocol="AJP/1.3" redirectPort="8443" />


Then in your apache config, ensure that your proxy_ajp is connecting on localhost.
ProxyPass /my_servlet ajp://localhost:8009/my_servlet
ProxyPassReverse /my_servlet ajp://localhost:8009/my_servlet


冷日:
先上這個範例,他是教你如何讓 Tomcat 只 Listen localhost!
因為他要讓前端交給 Apache 來處理,畢竟大多數時候我們還是比較信任 Apache 及 80 Port!
原文出處: Tomcat listen only on localhost » Computational Geoscience Rant
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|