简体   繁体   English

如何将默认80端口更改为我的域名的tomcat 8080

[英]How to change default 80 port to my tomcat 8080 for my domain name

I am using tomcat on Linux centOs server. 我在Linux centOs服务器上使用tomcat。 I want my java application is working fine on mydomain.com:8080. 我希望我的Java应用程序在mydomain.com:8080上运行正常。 I want that my when some one hit the domain mydomain.com it automatically move to my java application. 我希望当某个人访问域mydomain.com时将其自动移动到我的Java应用程序。

Changin server.xml didm't worked for me. Changin server.xml对我不起作用。 as i am also having apache2 on the server 因为我在服务器上也有apache2

I guess you have an apache server in port 80. I you do not want to remove apache and change directly the tomcat port ( see comments), you will need to redirect all traffic from port 80 to port 8080. 我想您在端口80中有一个apache服务器。我不想删除apache并直接更改tomcat端口(请参阅注释),您需要将所有流量从端口80重定向到端口8080。

This can be done using tomcat connectors . 这可以使用tomcat连接器完成。 They are plugins to connect web servers with Tomcat. 它们是用于将Web服务器与Tomcat连接的插件。 When a HTTP request arrives, the plugin checks is it has to be redirected, connects to tomcat and returns the response to server 当HTTP请求到达时,插件检查是否必须重定向它,连接到tomcat并将响应返回给服务器

In the case of apache is needed to install mod_jk . 在apache的情况下,需要安装mod_jk In the link you can see the configuration 在链接中,您可以看到配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM