简体   繁体   English

Apache Tomcat IP映射到域名

[英]Apache Tomcat IP mapping to domain name

I am having apache tomcat server on my windows machine. 我在Windows机器上安装了Apache Tomcat服务器。 Also I can access this server from other machines on the network. 我也可以从网络上的其他计算机访问此服务器。

Now I want to map the IP+Port combination to a name ie currently I have to write http://10.xxx.xx.xx:8080/app_name but I want to access it as http://app_name 现在我想将IP + Port组合映射到一个名称,即当前我必须写http://10.xxx.xx.xx:8080 / app_name,但我想以http:// app_name的方式访问它

How can I go about it? 我该怎么办? Is there any solution which I can achieve by adding some mapping in apache server file? 我可以通过在apache服务器文件中添加一些映射来实现任何解决方案吗? Also DNS server is not in my control, any way to get around this problem? DNS服务器也不在我的控制范围内,可以解决这个问题吗?

Thanks Rohit 谢谢罗希特

By not specifying a port number, you are defaulting to port 80. Your options are to either modify your server to listen on port 80 or define an external load balancer VIP that does a PAT from port 80 to 8080. 如果不指定端口号,则默认为端口80。您可以选择修改服务器以侦听端口80,或者定义一个外部负载平衡器VIP,该VIP在端口80到8080之间执行PAT。

If you take the VIP route, the hostname is defined on the load balancer. 如果采用VIP路由,则在负载均衡器上定义主机名。 If you don't have that option and DNS isn't an option either, you could manually modify your hosts file with an alias. 如果您没有该选项,并且DNS也没有选项,则可以使用别名手动修改主机文件。 However, this would require all remote users to have your hostname - IP mapping in their local hosts files (making DNS the more manageable solution). 但是,这将要求所有远程用户在其本地主机文件中拥有您的主机名-IP映射(使DNS成为更易管理的解决方案)。

When user types the URL in browser, browser will establish TCP connection with web server in the port 80 by default in case of HTTP, 443 by default in case of HTTPS. 当用户在浏览器中键入URL时,如果使用HTTP,浏览器将默认在端口80与Web服务器建立TCP连接,如果使用HTTPS,则默认使用443与Web服务器建立TCP连接。

Yes. 是。 If Web server exposes any port other than default port, port has to be mentioned in the browser URL to connect and get the data. 如果Web服务器公开默认端口以外的任何其他端口,则必须在浏览器URL中提及该端口以连接并获取数据。

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

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