需求:在struts中陪配置https和http两种接口同时存在,互不相干。如a接口时http,b接口时https
问题:1、这两个中接口tomcat需要怎么配置?可以使用同一个端口吗?(因为我看了一些文章上面https使用的是8443端口,难道https和http在tomcat中不能使用一个端口)
2、配置了tomcat后还需要配置struts2吗?如果需要哪应该如何配置,如果区分两个接口?
问题:1、这两个中接口tomcat需要怎么配置?可以使用同一个端口吗?(因为我看了一些文章上面https使用的是8443端口,难道https和http在tomcat中不能使用一个端口)
2、配置了tomcat后还需要配置struts2吗?如果需要哪应该如何配置,如果区分两个接口?
Connector
<Connector port="80" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75" URIEncoding="GBK"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
https
Connector
<Connector port="443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="d:/tomcat.key" keystorePass="LookingGlass"/>对于http默认端口是80,https是443,要注意的是keystoreFile="d:/tomcat.key" keystorePass="LookingGlass"就是https的证书,是使用jdk下keytool生成。
如要区分https与http那就是你工程fliter所干的事情拉。