tomcat更改端口号和隐藏端口号

因为默认端口:8080不会自动隐藏,因此为了更显格调需要将其改为:80

tomcat更改端口号和隐藏端口号_第1张图片

进入tomcat的server文件 

tomcat更改端口号和隐藏端口号_第2张图片

 将其改为80,之后将tomcat重新启动即可

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

你可能感兴趣的:(linux,tomcat,服务器,java)