eclipse 如何从eclipse的tomcat插件更改tomcat的端口

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18615907/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 21:52:46  来源:igfitidea点击:

How to change port of tomcat from eclipse's tomcat plugin

eclipsetomcateclipse-plugin

提问by Daud

I am using Eclipse Keplerand EclipseTotale's tomcat plugin. I am using Oracle XEat port 8080, and want to run Tomcat at port 9090. I have changed server.xmland changed the port at this line :

我正在使用Eclipse KeplerandEclipseTotale的 tomcat 插件。我Oracle XE在 port 上使用8080,并且想在 port 上运行 Tomcat 9090。我已经更改server.xml并更改了这一行的端口:

 <Connector connectionTimeout="20000" port="9090" protocol="HTTP/1.1" 
redirectPort="8443"/>

It still says the address is already in use. Also, I am a little skeptical as to whether changing server.xmlwill have any effect as I have selected Context Decalration Modeto be Context Filesinstead of server.xml

它仍然说地址已被使用。另外,我有点怀疑更改是否server.xml会产生任何影响,因为我选择了Context Decalration Mode作为Context Files而不是server.xml

Any suggestions ?

有什么建议 ?

采纳答案by Daud

It worked after changing server.xmlin tomcat's home directory. The problem was that there were multiple instances of tomcat that were running. I changed the ports of other connectors too.. that may also have had an effect, though I am not sure.

它在更改server.xmltomcat 的主目录后工作。问题是有多个 tomcat 实例正在运行。我也更改了其他连接器的端口……这也可能产生了影响,但我不确定。

回答by Anuj Sharma

Just double click on the server listed in Eclipse. Here It will display Server Configuration. Just change the port Number like from 8080 to 9080. and start your server. Dialog box will appear to save the changes. Click yes and server will start. Hope it'll help you.

只需双击 Eclipse 中列出的服务器。这里将显示服务器配置。只需将端口号从 8080 更改为 9080。然后启动您的服务器。将出现对话框以保存更改。单击是,服务器将启动。希望它会帮助你。

For details refer; link

详情请参考; 关联

回答by Prabhath

Open Eclipse Get Server view form Window -> Show View -> Servers Then double click the tomcat server Configuration window open and you can change the ports there.

打开 Eclipse Get Server 视图窗体 Window -> Show View -> Servers 然后双击打开的 tomcat 服务器配置窗口,您可以在那里更改端口。

回答by Taufik Iqbal Ramdhani

The easy way is, first you change server.xml in Tomcat master folder then you delete the Tomcat folder from Eclipse Project Servers folder then you can recreate Server in Eclipse again.

简单的方法是,首先更改 Tomcat 主文件夹中的 server.xml,然后从 Eclipse Project Servers 文件夹中删除 Tomcat 文件夹,然后您可以再次在 Eclipse 中重新创建服务器。

回答by Khan

open eclipse, now double click on server(that you added in your workspace), open server.xml and using (CTRL+F) search for 8080, now change it here 8080 to 9080, save it, now you can run your application

打开 eclipse,现在双击 server(你在工作区中添加的),打开 server.xml 并使用(CTRL+ F)搜索 8080,现在在这里将其更改为 8080 为 9080,保存它,现在您可以运行您的应用程序