如何将Linux Centos 6.5服务器上Apache Tomcat上的端口8080更改为默认值? [英] How to change Port 8080 on Apache Tomcat on Linux Centos 6.5 server to the Default?

查看:249
本文介绍了如何将Linux Centos 6.5服务器上Apache Tomcat上的端口8080更改为默认值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Linux服务器CentOS 6.5上Apache Tomcat的端口8080的开关删除到默认值.在我的托管Apache Tomcat服务器"上,其运行在端口80x的vmx15978.hosting24.com.au:8080上.在Apache服务器上安装Geoserver软件后,其网址为 http://vmx15978.hosting24.com.au:8080/geoserver/web/.

I want to remove switch from port 8080 on my Apache Tomcat on Linux server CentOS 6.5 to the default. On My hosted Apache Tomcat server is running on port 8080 on url vmx15978.hosting24.com.au:8080. After I have installed the Geoserver software on the Apache server the url for it is http://vmx15978.hosting24.com.au:8080/geoserver/web/.

我的网站域是links-map.com.目前,我可以通过以下URL访问Geoserver:links-map.com:8080/geoserver/web;但是,我想改用以下URL访问不带8080的Geoserver: http://links-map.com /geoserver/web/

My website domain is links-map.com. Currently I can access Geoserver by this URL: links-map.com:8080/geoserver/web; However, I want to access Geoserver without 8080 using this URL instead: http://links-map.com/geoserver/web/

推荐答案

我遇到了同样的问题.这意味着我需要将端口号从8080更改为80,以便无需附加8080即可访问我的网址(例如www.mydomain.com).但是我找到了解决此问题的另一种方法. 而不是更改server.xml中的端口号.我使用以下脚本将端口号80重定向到8080 .对我来说这很好.

I had the same problem. It means I need to change port number from 8080 to 80 so that I can access my url (e.g www.mydomain.com) without appending 8080. But I found a different way to solve the problem. Instead of changing port number in server.xml. I redirected port number 80 to 8080 using the following script. This works perfectly fine for me.

[root@myroot ~]# iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
[root@myroot ~]# iptables -t nat -A PREROUTING -p udp -m udp --dport 80 -j REDIRECT --to-ports 8080

请在此链接

这篇关于如何将Linux Centos 6.5服务器上Apache Tomcat上的端口8080更改为默认值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆