1.oneinstack装完nginx默认解析php的,要支持java,得把/usr/local/nginx/conf里的nginx.conf换成tomcat版本的,在oneinstack/config里面可以找到nginx_tomcat.conf文件
2./usr/local/tomcat/webapps/ROOT
新建index.jsp 和 WEB-INF文件夹,里面包含三个文件:web.xml,lib,classes
~~~~~~~~~~~~~~web.xml~~~~~~~~~~~~~~~~~~~~~~
[code]
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
[/code]
~~~~~~~~~~~~~~~~~~~index.jsp~~~~~~~~~~~~~~~~~~~~
[code]
<%@ page language="java" contentType="text/html; charset=gbk"
pageEncoding="gbk"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<title>Insert title here</title>
</head>
<body>
hello, this if from tomcat
<%="cool girl"%>
<% out.println("hi, today is 20170116");%>
</body>
</html>
[/code]