配置apache监听80以外的端口 [英] Configure apache to listen on port other than 80

查看:50
本文介绍了配置apache监听80以外的端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用centOS服务器.我想配置 apache 以侦听端口 8079.我在 httpd.conf 中添加了 LISTEN 8079 指令.
我在 iptables 中打开了 8079 端口并重新启动了 iptables.我什至停止了 iptables 服务.

I use centOS server. I want to configure apache to listen on port 8079. I added LISTEN 8079 directive in httpd.conf.
I opened port 8079 in iptables and restarted iptables. I even stopped iptables service.

"netstat -nal | grep 8079" shows "tcp  0 0 :::8079 :::* LISTEN"

如果我尝试从那台机器访问 http://localhost:8079http://myserver.com:8079,我可以访问该页面.但是从任何其他机器上,我无法通过 80 以外的任何端口访问该站点.在端口 80 上,它可以工作.在端口 8079 上没有.

If I try to access http://localhost:8079 or http://myserver.com:8079 from that machine, I can access that page. BUT from any other machine I am not able to access the site on any port other than 80. On port 80, it works. On port 8079 it does not.

我还需要配置什么?

推荐答案

这是一个防火墙问题.有一个硬件防火墙阻止了对几乎所有端口的访问.(关闭软件防火墙/SELinux bla bla没有效果)

It was a firewall issue. There was a hardware firewall that was blocking access to almost all ports. (Turning off software firewall / SELinux bla bla had no effect)

然后我扫描了开放的端口并使用了开放的端口.

Then I scanned the open ports and used the port that was open.

如果您遇到同样的问题,请运行以下命令

If you are facing the same problem, Run the following command

sudo nmap -T Aggressive -A -v 127.0.0.1 -p 1-65000

它将扫描您系统上的所有开放端口.任何开放的端口都可以从外部访问.

It will scan for all the open ports on your system. Any port that is open can be accessed from outside.

参考.:http://www.go2linux.org/which_service_or_program_is_listening_on_port

这篇关于配置apache监听80以外的端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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