tomcat简介

tomcat参数、跨域访问、tomcat-user、tomcat服务开机后台启动、tomcat_permgen_space错误

设置tomcat参数

-Xmx1024M -Xms512M -XX:MaxPermSize=256m

tomcat跨域访问

http://blog.csdn.net/liumm0000/article/details/8443550
若允许Tomcat所有域访问,将clientaccesspolicy.xml和crossdomain.xml加入%TOMCAT_HOME%webappsROOT 目录下即可
clientaccesspolicy.xml示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>

设置tomcat开机后台启动

http://jingyan.baidu.com/article/a65957f4b12b8724e77f9b5a.html

tomcat_permgen_space错误

rem permgen space
rem —– Execute The Requested Command —————————————
set JAVA_OPTS=%JAVA_OPTS% -server -XX:PermSize=128m -XX:MaxPermSize=512m

tomcat-user

tomcat7

1
2
3
4
5
6
7
8
9
xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user password="tomcat" roles="tomcat" username="tomcat"/>
<user password="tomcat" roles="tomcat,role1" username="both"/>
<user password="tomcat" roles="role1" username="role1"/>
</tomcat-users>

tomcat8

1
2
3
4
5
6
7
8
xml version="1.0" encoding="UTF-8"?>
<tomcat-users version="1.0" 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">
<role rolename="manager"/> 
<role rolename="manager-gui"/> 
<role rolename="admin"/> 
<role rolename="admin-gui"/> 
<user username="tomcat" password="tomcat" roles="admin-gui,admin,manager-gui,manager"/>
</tomcat-users>