80和443端口是默认的http及https端口,如果配置成这两个端口,在访问服务器时可以不写端口号:
打开tomcat安装目录里面的conf/server.xml文件,做如下修改即可:
把8443全改成443,把8080全改成80即可:
<Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="443"/>
<Connector SSLEnabled="true" clientAuth="false"
keystoreFile="conf/tomcat.keystore" keystorePass="123456"
maxThreads="150" port="443"
protocol="org.apache.coyote.http11.Http11Protocol"
scheme="https" secure="true" sslProtocol="TLS"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="443"/>
如下图所示: