首先找到服务器Tomcat的server.xml配置,然后在原来的基础上,多复制一份Host节点,然后 name 改成我们需要设置的域名以及Context节点对应好项目路径即可

1
2
3
4
5
6
7
8
9
10
11
<Host name="jxc.zoutl.cn"  appBase="webapps" unpackWARs="true">
<Context path="" docBase="/home/tomcat9/apache-tomcat-9.0.46/webapps/JXC" debug="0" reloadable="true" />


<!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html -->
<!--<Valve className="org.apache.catalina.authenticator.SingleSignOn" />-->

<!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />

</Host>

img