rpm -ivh jdk-8u201-linux-x64.rpm
export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile
tar zxvf apache-tomcat-9.0.16.tar.gz -C /usr/local/
mv apache-tomcat-9.0.16/ tomcat
ln -s /usr/local/tomcat/bin/startup.sh /usr/bin/
ln -s /usr/local/tomcat/bin/shutdown.sh /usr/bin/
mkdir -p /web/webapp1
vim /web/webapp1/index.jsp
添加以下内容:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
<title>JSP test1 page</title>
</head>
<body>
<% out.println("Welcome to test site, http://www.test1.com");%>
</body>
</html>
)
vim server.xml
添加以下代码:
<Context docBase="/web/webapp1" path="" reloadable="false">
</Context>
./shutdown.sh
./startup.sh
upstream tomcat-server {
server 192.168.220.136:8080 weight=1;
server 192.168.220.137:8080 weight=1;
}
proxy_pass http://tomcat-server;
killall -1 nginx
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。