springboot项目解决外部tomcat通过ip+端口访问项目

来源:互联网 发布:工口mmd动作数据 编辑:程序博客网 时间:2024/06/05 08:37

主要在springboot项目的主配置文件添加指定项目端口9008  访问路径server.contextpath=/

spring.application.name=spring.application.index=server.port=9008server.contextPath=/
下面是tomcat需要配置的

 <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
 <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" />
                 <Context  path="" docBase="./hsweb" reloadable="true"></Context>
      </Host>

标红处是外部tomcat单独发布项目是需要添加的,此处是以当前相对路径webapps目录下的,hsweb项目

阅读全文
0 0
原创粉丝点击