Tomcat修改端口号

简介: 了解Tomcat修改端口号。

找到安装的更目录例:C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\conf  ;在conf目录下有“server.xml”文件


修改以下红色的“8080”改为自己所需的端口号

<!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->



找到安装的更目录例:C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\conf  ;在conf目录下有“server.xml”文件

修改以下红色的“8080”改为自己所需的端口号

<!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->




找到安装的更目录例:C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\conf  ;在conf目录下有“server.xml”文件


修改以下红色的“8080”改为自己所需的端口号

<!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->



找到安装的更目录例:C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\conf  ;在conf目录下有“server.xml”文件


修改以下红色的“8080”改为自己所需的端口号

<!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->



找到安装的更目录例:C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\conf  ;在conf目录下有“server.xml”文件

修改以下红色的“8080”改为自己所需的端口号

<!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->


找到安装的更目录例:C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\conf  ;在conf目录下有“server.xml”文件


修改以下红色的“8080”改为自己所需的端口号

<!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->


目录
相关文章
|
关系型数据库 MySQL 应用服务中间件
【JavaWeb学习】—如何修改Tomcat的端口号(十)
【JavaWeb学习】—如何修改Tomcat的端口号(十)
|
5月前
|
Java 应用服务中间件
多项目分接口:在同一Tomcat下使用不同的端口号访问不同的项目。
总而言之,要在同一Tomcat服务器下使用不同端口访问不同项目,关键是通过对server.xml文件的配置创建多个 `<Service>`实例和相应的虚拟主机。这种方法既实现了项目隔离,也有助于优化资源利用率。通过遵循本文的详细说明,很容易地就能满足需求实现多项目分接口。
162 38
|
5月前
|
关系型数据库 MySQL Java
安装和配置JDK、Tomcat、MySQL环境,以及如何在Linux下更改后端端口。
遵循这些步骤,你可以顺利完成JDK、Tomcat、MySQL环境的安装和配置,并在Linux下更改后端端口。祝你顺利!
358 11
|
7月前
|
应用服务中间件 Linux 开发者
用的到linux-tomcat端口占用排查-Day5
通过本文的介绍,详细讲解了在CentOS 8系统上排查和解决Tomcat端口占用问题的方法。从使用 `netstat`、`lsof`和 `ss`命令检查端口占用情况,到使用 `ps`和 `top`命令查找和停止占用端口的进程,再到修改Tomcat端口配置,最后介绍了自动化脚本的方法。希望本文能帮助系统管理员和开发者有效地解决端口占用问题,确保Tomcat服务器的正常运行。
200 11
|
12月前
|
Java 应用服务中间件 Linux
tomcat学习二:tomcat部署多个项目:不修改端口和修改端口 两种方式详解
这篇文章详细介绍了在Tomcat服务器上部署多个项目的方法,包括不修改端口和修改端口两种方式。
730 0
|
网络协议 安全 应用服务中间件
在Linux中,Tomcat8005、8009、8080三个端口的含义?
在Linux中,Tomcat8005、8009、8080三个端口的含义?
|
网络协议 应用服务中间件 Linux
LInux之在同一Tomcat下使用不同的端口号访问不同的项目
LInux之在同一Tomcat下使用不同的端口号访问不同的项目
240 0
|
前端开发 Java 应用服务中间件
linux本地检测如何tomcat是否启动成功tomcat端口检测
linux本地检测如何tomcat是否启动成功tomcat端口检测
153 0
|
Java 关系型数据库 MySQL
【Linux】jdk、tomcat、MySQL环境搭建的配置安装,Linux更改后端端口
【Linux】jdk、tomcat、MySQL环境搭建的配置安装,Linux更改后端端口
260 0