tomcat
2019-04-03 本文已影响0人
A_1341
-
jvm参数激活spring profile
新建setenv.bat
- windows
在%tomcat%/bin
下创建setenv.bat
文件 - linux
在%tomcat%/bin
下创建setenv.sh
文件
设置spring profile
setenv.bat加入如下内容
- windows
set "JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=dev"
- linux
JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=dev"
-
设置 cookie 处理器为 LegacyCookieProcessor
conf->context.xml
<CookieProcessor className="org.apache.tomcat.util.http.LegacyCookieProcessor" />

-
设置 tomcat 管理用户权限
conf->tomcat-users.xml
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0">
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tiantianquan" password="pw" roles="manager-gui,admin-gui"/>
</tomcat-users>
-
设置 tomcat 默认网站使用的app, / 路径映射的网站,覆盖root
conf->server.xml
<Context path="" docBase="app-name" debug="0" reloadable="true"></Context>

-
作为服务启动,在此处添加spring boot 参数
