-
修改tomcat的默认端口号是在tomcat的哪个配置文件里面?
2018-12-10 16:04:51Tomcat的默认端口号在server包下的server.xml里面。...打开server.xml后,在里面找到下图的一段代码,里面的port=“8080”就代表Tomcat的默认端口号,修改8080的值就可以成功改Tomcat的默认端口号。 ...Tomcat的默认端口号在server包下的server.xml里面。
打开server.xml后,在里面找到下图的一段代码,里面的port=“8080”就代表Tomcat的默认端口号,修改8080的值就可以成功改Tomcat的默认端口号。
-
Tomcat服务器端口的配置
2020-02-10 09:15:30一、Tomcat服务器端口的配置 Tomcat的所有配置都放在conf文件夹之中,里面的server.xml文件是配置的核心文件。 如果想修改Tomcat服务器的启动端口,则可以在server.xml配置文件中的Connector节点进行的端口修改 ...一、Tomcat服务器端口的配置
Tomcat的所有配置都放在conf文件夹之中,里面的server.xml文件是配置的核心文件。
如果想修改Tomcat服务器的启动端口,则可以在server.xml配置文件中的Connector节点进行的端口修改
例如:将Tomcat服务器的启动端口由默认的8080改成8081端口
conf目录:conf目录是tomcat配置文件的存放目录,比如server.xml是tomcat服务器最重要的一个配置文件,比如修改端口或者配置虚拟主机都会在这个文件中进行配置。Tomcat服务器启动端口默认配置
1 <Connector port=“8080” protocol=“HTTP/1.1”
2 connectionTimeout=“20000”
3 redirectPort=“8443” />将Tomcat服务器启动端口修改成8081端口
1 <Connector port=“8081” protocol=“HTTP/1.1”
2 connectionTimeout=“20000”
3 redirectPort=“8443” />这样就把原来默认Tomcat默认的的8080端口改成了8081端口了,需要注意的是,一旦服务器中的*.xml文件改变了,则Tomcat服务器就必须重新启动,重新启动之后将重新读取新的配置信息。因为已经在server.xml文件中将Tomcat的启动端口修改成了8081,所以Tomcat服务器启动时就以8081端口启动了
访问Tomcat服务器也必须以新的访问端口去访问:http://localhost:8081/资源路径 -
Tomcat的端口配置
2018-08-27 14:42:531.通过配置文件修改Tomcat端口号 首先:Tomcat端口号默认使用的是8080端口,...conf目录下存放的是tomcat的配置文件。 打开会发现有一个server.xml的配置文件,用文本编辑器打开(带有颜色,易于区分注释与代码...1.通过配置文件修改Tomcat端口号
首先:Tomcat端口号默认使用的是8080端口,没有修改的情况下都是8080
我们可以通过server.xml文件修改Tomcat的端口号server.xml文件在哪?
首先找到Tomcat目录:
conf目录下存放的是tomcat的配置文件。
打开会发现有一个server.xml的配置文件,用文本编辑器打开(带有颜色,易于区分注释与代码):
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/server.html --> <Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <!-- Security listener. Documentation at /docs/config/listeners.html <Listener className="org.apache.catalina.security.SecurityListener" /> --> <!--APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/service.html --> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> --> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL/TLS 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" /> --> <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 This connector uses the NIO implementation. The default SSLImplementation will depend on the presence of the APR/native library and the useOpenSSL attribute of the AprLifecycleListener. Either JSSE or OpenSSL style configuration may be used regardless of the SSLImplementation selected. JSSE style configuration is used below. --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true"> <SSLHostConfig> <Certificate certificateKeystoreFile="conf/localhost-rsa.jks" type="RSA" /> </SSLHostConfig> </Connector> --> <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2 This connector uses the APR/native implementation which always uses OpenSSL for TLS. Either JSSE or OpenSSL style configuration may be used. OpenSSL style configuration is used below. --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" SSLEnabled="true" > <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" /> <SSLHostConfig> <Certificate certificateKeyFile="conf/localhost-rsa-key.pem" certificateFile="conf/localhost-rsa-cert.pem" certificateChainFile="conf/localhost-rsa-chain.pem" type="RSA" /> </SSLHostConfig> </Connector> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html --> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack --> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> </Server>
我们只需要修改这里面的8080端口号为指定的端口号就行,其他的都不需要改:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />例如:
<Connector port="6060" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />改完后一定要重启服务器。
-
Tomcat常用配置(一):Tomcat修改端口号
2019-07-24 12:11:47端口号并不是无限大的,修改端口号,首先需要知道端口的取值范围:1~65535,通常1~1024会固定分配给一些服务。 Tomcat的端口号为8080,在Tomcat安装目录下的conf/server.xml文件中进行修改,server.xml文件中有三个...端口号并不是无限大的,修改端口号,首先需要知道端口的取值范围:1~65535,通常1~1024会固定分配给一些服务。
Tomcat的端口号为8080,在Tomcat安装目录下的conf/server.xml文件中进行修改,server.xml文件中有三个端口号,分别是shutdown的端口号8005,http服务端口号8080,ajp协议端口号8009。
8005:负责监听关闭Tomcat请求。
8080:负责建立http请求。
8009:负责和其他的http服务器建立连接,将Tomcat与其他的服务器进行集成的时候会用到。
修改端口号通常我们是修改http服务端口号,即8080,可以将其改为其他的,然后再浏览器进行访问的时候将url中对应的端口号改为指定的端口号即可。如:将porto修改为8088,访问地址对应为http://localhost:8088/xxx/xxx的形式。
-
一、Tomcat服务器端口的配置
2015-08-25 15:59:49如果想修改Tomcat服务器的启动端口,则可以在server.xml配置文件中的Connector节点进行的端口修改 例如:将Tomcat服务器的启动端口由默认的8080改成8081端口 Tomcat服务器启动端口默认配置 1 Connector ... -
tomcat中间件的默认端口号_如何修改Tomcat默认端口号?Tomcat默认端口修改方法
2021-01-14 10:20:01想要修改Tomcat默认端口,就需要找到server文件,具体过程请看下文步骤进行处理。Tomcat默认端口修改方法:1、更改Tomcat端口,需要找到该软件的安装目录(如图)。2、在 apache-tomcat-7.0.62-windows-x64 安装目录..... -
java tomcat 读取配置文件端口_Tomcat配置文件&优化
2021-02-28 10:18:01长话短说,我们以结果和需求为导向,根据需要达成的效果来分析和修改对应的配置文件和代码段。以tomcat8为例,默认线程连接使用的是NIO或NIO2(非阻塞I/O模型)。一、并发优化编辑 server.xml 的 Connector... -
修改Tomcat服务中的端口配置
2018-10-10 13:16:59难过的我,要来贴一下tomcat修改端口的教程,拿小CC记一下== 首先,找到你tomcat的安装位置 找到后,点击进去 有一个 conf文件夹 里面有一个大宝贝 叫做 server.xml 然后拨开他的内衣 看到有三个!!... -
Tomcat修改80端口监听及虚拟主机的配置
2016-08-08 15:45:29Tomcat默认的访问监听端口是8080,但是在网址栏输入IP再加上端口难免有些麻烦,同时如果使用IP进行解析,只能...修改Tomcat默认监听端口的配置文件在Tomcat安装目录下的conf/servel.xml,找到下面这部分: <Connecto -
Tomcat修改端口号
2019-04-25 15:17:45前言 由于之前做的都是独立的项目,没有遇到要跑好几个tomcat的情况。之前的技能也有一些生疏,今天来回顾下之前的技能。...修改server.xml中的配置属性 原文件 修改后 理论上完美解决,无图言~ 很nice!!!! ... -
Tomcat端口号的配置
2017-08-23 00:24:26因为通过端口号可以访问应用程序,一旦这个端口被占用,将无法再启动Tomcat服务,此时只需要对Tomcat服务器的配置文件进行修改,就可以实现端口号的变更。 具体的操作步骤如下, (1)在Tomcat目录结构下找到其子... -
tomcat端口配置
2019-08-11 13:38:56tomcat端口配置 tomcat默认端口是8080(访问端口) http的默认端口是80....配置tomcat端口可以在tomcat文件的conf中server.xml 找到 修改port的值。 win7系统会自带一个软件把80端口占用。 启动tomcat出现java.n... -
Eclipse中tomcat修改端口号
2017-03-20 17:32:05最近在做项目需要更改tomcat的端口号,开发工具用的是Eclipse,更改后在Eclipse中重启发现,端口号依然是8080,原来在配置文件更改了tomcat端口号后,要在Eclipse重新装载一次,重启是不行的,现在给出详细步骤: ... -
java tomcat 读取配置文件端口_配置端口号到xml文件_Tomcat服务器开发教程 - 动力节点...
2021-02-28 10:17:25【端口号可配置】端口号代表了计算机上的某个服务,端口最好是可配置的,就是说将端口号编写到一个配置文件当中,通过修改配置文件做到端口号的可配置,那我们这里就选择功能强大的配置文件 xml,端口号需要在服务器... -
tomcat修改端口,批量实现将项目放在tomcat下,且只有端口不同
2019-02-15 10:55:101. 将tomcat复制多份,修改为不同的名称,修改tomcat端口(目录:config/server.xml,注意如果是在同一台机器上,需要修改文件的多处端口配置) 2. 将项目分别部署到多个tomcat下,分别启动... -
配置Tomcat监听80端口、配置Tomcat的虚拟主机、日志配置
2018-06-27 17:57:38编辑配置文件vim /usr/local/tomcat/bin/startup.sh 搜索关键字:Connector port ,将8080修改为80 更改完后保存退出,并且重启服务/usr/local/tomcat/bin/shutdown.sh/usr/local/tomcat/bin/startup.sh 这是可以... -
tomcat配置文件详解配置网站域名设置端口
2021-01-02 23:51:44tomcat配置通过域名访问项目,是修改conf/server.xml里面的配置信息实现。 具体如下: (1)修改Connector节点的port属性值 <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" ... -
tomcat的文件夹注解 , 修改配置文件(如:端口号)
2017-08-30 17:42:49tomcat 下载链接:http://tomcat.apache.org/ ...config 放的是配置文件 lib 放的是.jar文件 log 放的是日志文件 temp 放的是临时文件夹 webapps app是应用doc 管理 example 实例 host-manager -
【tomcat server.mxl配置文件修改端口】&解决Tomcat报错: Failed to initialize connector [Connector[AJP...
2020-08-26 17:00:451.Tomcat报错: Failed to initialize... 只需要在当前tomcat的 conf文件下的server.xml 文件编辑, 找到对应connector 加上 secretRequired="" <!-- Define an AJP 1.3 Connector on port 8009 --> <Conn. -
关于 tomcat/conf的文件及其用途,还有tomcat监听端口修改
2014-03-03 09:04:38,启动加载级别等等 welcome-file-list index.jsp index2.jsp PS:指定了2个欢迎页面,显示时按顺序从第...server.xml是Tomcat的主要配置文件,这是一个格式良好的XML文档,在这个文件中可以修改Tomcat默认监听的 -
修改tomcat默认端口
2020-04-23 22:43:32今天我在安装完tomcat服务器并且配置好文件后,运行了startup.bat,tomcat成功启动,但是打不开测试的网址,画面是404,检查之后发现默认的8080端口号被别的进程占用 解决办法: 找到conf目录下的server.xml文件 ... -
tomcat端口的修改
2013-11-14 17:57:20在linux系统,改变tomcat的端口为80,可是单纯的改变tomcat的配置文件是没有作用的,发现端口开启,却无法访问网页,想了各种办法,最后找到原因这是因为只有root用户才可访问1024以下的端口。所以解决办法如下 ... -
修改tomcat端口
2018-05-08 18:31:00再启动一个tomcat会发现这些端口已经被占用了,这个时候就需要修改端口号。 下面就来讲解一下如何修改tomcat的默认端口号: 第一步:进入tomcat的安装目录,找到conf文件夹 第二步:找到conf目录中的server.xml... -
Tomcat端口配置
2020-07-06 16:19:41打开对应的Tomcat安装路径 ,比如我的电脑是安装在D盘 ....修改默认端口号,同时加上URI-Encoding、http压缩的设置,修改为如下内容: <Connector URIEncoding="UTF-8" connectionTimeout="20000" port="80" protoc -
java tomcat 多个端口_Linux配置多个Tomcat同时运行以及tomcat 的端口介绍
2021-02-28 10:17:05添加一组环境变量(如果已经有了就不用再添加),和两组CATALINA环境变量(我没有进行此步骤的设置,可能因为我的Tomcat是免安装版的吧)记得修改完要使其生效,用命令:source /etc/profileJAVA_HOME=/usr/java/jdk...