2019.9.21 Tomcat缃戦〉浣嶇疆鐨勪慨鏀瑰強璐熻浇鍧囪
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2019.9.21 Tomcat缃戦〉浣嶇疆鐨勪慨鏀瑰強璐熻浇鍧囪相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/http' title='http'>http
alt mkdir img idt height tle kill lin涓€銆佽嚜瀹氫箟榛樿缃戠珯鐩綍锛堥渶涓ゅ彴铏氭嫙鏈猴級
1銆乕root@localhost ~]# mkdir -pv /web/webapp
[root@localhost ~]# vim /web/webapp/index.jsp 娣诲姞浠ヤ笅鍐呭锛?/p>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
<title>JSP test page</title>
</head>
<body>
<%out.println("Welcome come to test site,http://wwww.test1.com");%>
</body>
</html>
[root@localhost ~]# cd /usr/local/tomcat8/conf/
[root@localhost conf]# cp server.xml server.xml.bak //鍋氬浠?/p>
灏嗛厤缃枃浠惰繘琛屼慨鏀癸細vim server.xml
150锛?/p>
<Context docBase="/web/webapp" path="" reloadable="flase">
</Context>
2銆佸湪鍙︿竴鍙拌櫄鎷熸満涓婁篃鏄互涓婅繖鏍锋搷浣?/p>
3銆乕root@localhost conf]# tail -f /usr/local/tomcat8/logs/catalina.2019-09-21.log //鏌ョ湅鏃ュ織锛岀湅鏈€鍚庣殑涓夎锛岀粨鏉燂紒
浜屻€佽礋杞藉潎琛★紙Nginx+Tomcat 璐熻浇鍧囪 闆嗙兢锛?/p>
nginx鍋氳礋杞藉潎琛″櫒锛堣疆璇級
鍦?92.168.200.111涓畨瑁卬ginx
[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf //娣诲姞浠ヤ笅鍐呭
upstream tomcat_pool {
server 192.168.200.112:8080 weight=1;
server 192.168.200.113:8080 weight=1;
}
location ~ .jsp$ {
proxy_pass http://tomcat_pool;
proxy_set_header Host $http_host;
}
[root@localhost ~]# nginx -t
[root@localhost ~]# killall -HUP nginx
鍦ㄧ綉椤典笂杈撳叆192.168.200.111/index.jsp
以上是关于2019.9.21 Tomcat缃戦〉浣嶇疆鐨勪慨鏀瑰強璐熻浇鍧囪的主要内容,如果未能解决你的问题,请参考以下文章