因为默认端口:8080不会自动隐藏,因此为了更显格调需要将其改为:80
进入tomcat的server文件
将其改为80,之后将tomcat重新启动即可文章来源:https://www.toymoban.com/news/detail-675400.html
tomcat启动流程
[root@shang ~]# cd /usr/local/tomcat/apache-tomcat-8.5.92
[root@shang apache-tomcat-8.5.92]# cd bin
[root@shang bin]# ps -ef|grep java
root 9008 1 0 Aug23 ? 00:00:59 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/apache-tomcat-8.5.92/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/apache-tomcat-8.5.92/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-8.5.92/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat/apache-tomcat-8.5.92 -Dcatalina.home=/usr/local/tomcat/apache-tomcat-8.5.92 -Djava.io.tmpdir=/usr/local/tomcat/apache-tomcat-8.5.92/temp org.apache.catalina.startup.Bootstrap start
root 22524 22489 0 10:06 pts/0 00:00:00 grep --color=auto java
[root@shang bin]# kill -9 9008
[root@shang bin]# ps -ef|grep java
root 22527 22489 0 10:07 pts/0 00:00:00 grep --color=auto java
[root@shang bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-8.5.92
Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-8.5.92
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-8.5.92/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat/apache-tomcat-8.5.92/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-8.5.92/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
进入bin目录,ps -ef|grep java查看tomcat是否关闭,kill -9 9008杀死进程,9008这个数可能不一样,根据上面显示的更改,./startup.sh启动tomcat文章来源地址https://www.toymoban.com/news/detail-675400.html
到了这里,关于tomcat更改端口号和隐藏端口号的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!