Save current configuration (including virtual hosts) to server.xml and per web application context.xml files
结果就报错了:
1
2
FAIL - Failed to persist configuration
Please enable StoreConfig to use this feature.
摸索了一会找到问题所在:少了一个监听(Listener)。
打开server.xml:
1
$ vim conf/server.xml
定位到GlobalNamingResources之前,在最后加上一个监听:
1
2
3
4
5
6
7
8
9
10
11
12
<ListenerclassName="org.apache.catalina.startup.VersionLoggerListener"/><!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
--><!--APR library loader. Documentation at /docs/apr.html --><ListenerclassName="org.apache.catalina.core.AprLifecycleListener"SSLEngine="on"/><!-- Prevent memory leaks due to use of particular java/javax APIs--><ListenerclassName="org.apache.catalina.core.JreMemoryLeakPreventionListener"/><ListenerclassName="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/><ListenerclassName="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/><!-- add StoreConfig --><ListenerclassName="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
重新启动Tomcat后打开Host Manager页面,重试Add VH然后保存配置文件:
1
2
OK - Host [test.tomcat.org] added
OK - Configuration persisted