For some projects in tomcat that require SSL encryption and some can be directly accessed, it can be achieved by modifying the one under tomcat/conf. For specific configuration, please refer to the following code, and pay attention to the configuration in the <Service name=”Catalina1”> tag.
<?xml version='1.0' encoding='utf-8'?> <Server port="8005" shutdown="SHUTDOWN"> <Listener className="" SSLEngine="on" /> <Listener className="" /> <Listener className="" /> <Listener className="" /> <Listener className="" /> <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="" description="User database that can be updated and saved" factory="" pathname="conf/" /> </GlobalNamingResources> <Service name="Catalina"> <!-- Used heresslConfiguration,NeededhttpsOnly accessible --> <Connector port="8284" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" clientAuth="false" sslProtocol="TLS" SSLEnabled="true" scheme="https" secure="true" keystoreFile="conf/" keystorePass="pico2012server" truststoreFile="conf/" truststorePass="pico2012server" /> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <Engine name="Catalina" defaultHost="localhost"> <Realm className=""> <Realm className="" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Valve className="" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" /> </Host> </Engine> </Service> <!-- 加入一个新的网站服务Configuration,Eachservice都可以单独Configurationproject加载目录、Ports, etc. --> <Service name="Catalina1"> <!-- Here it means that the loaded project still uses the originalhttpAccess --> <Connector port="8484" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" /> <Connector port="18009" protocol="AJP/1.3" redirectPort="18443" /> <Engine name="Catalina1" defaultHost="localhost"> <Realm className=""> <Realm className="" resourceName="UserDatabase"/> </Realm> <!-- ShouldserviceLoaded project placement directory,andwebappsThe same directorywebapps1 --> <Host name="localhost" appBase="webapps1" unpackWARs="true" autoDeploy="true"> <Valve className="" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" /> <!-- The specified load to be displayed herewebapps1NextGS-Webproject --> <Context path="" docBase="GS-Web" debug="0" reloadable="true"/> </Host> </Engine> </Service> </Server>
The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.