配置Apache上侦听80以外的端口 [英] Configure apache to listen on port other than 80
问题描述
我用CentOS的服务器。我想配置Apache监听端口8079。
我加LISTEN 8079指令在的httpd.conf
。结果
我在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://本地主机:8079
或 http://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.
还有什么我需要配置?
What else do I need to configure?
推荐答案
这是一个防火墙问题。有被阻止几乎所有端口的访问硬件防火墙。 (关闭软件的防火墙/ SELinux的喇嘛喇嘛是没有效果的)
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.
参考:<一href=\"http://www.go2linux.org/which_service_or_program_is_listening_on_port\">http://www.go2linux.org/which_service_or_program_is_listening_on_port
这篇关于配置Apache上侦听80以外的端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!