配置apache监听80以外的端口

编程入门 行业动态 更新时间:2024-10-09 14:22:55
本文介绍了配置apache监听80以外的端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我使用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:8079,我可以访问该页面.但是从任何其他机器上,我无法通过 80 以外的任何端口访问该站点.在端口 80 上,它可以工作.在端口 8079 上没有.

If I try to access http://localhost:8079 or http://myserver: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/which_service_or_program_is_listening_on_port

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

更多推荐

[db:关键词]

本文发布于:2023-04-20 01:24:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/973887.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:端口   apache

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!