I don’t know what’s wrong, I just changed /etc/httpd/conf/httpd.conf and now I can’t access it from non-loopback address.
After the change:
Listen 2999
<VirtualHost *:*>
DocumentRoot "/var/www/html"
</VirtualHost>
Output of lsof -i:2999
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 23989 root 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
httpd 24001 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
httpd 24002 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
httpd 24003 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
httpd 24004 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
httpd 24005 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
httpd 24006 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
httpd 24007 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
httpd 24008 apache 4u IPv4 27581116 TCP *:remoteware-un (LISTEN)
I can access apache using nc localhost 2999 or w3m http://localhost:2999
But I can’t access 2999 port using my ip or dns. I can access other ports using my ip or DNS.
I don’t have an idea what’s wrong. Iptables isn’t blocking that port.
EDIT: Okay, iptables was actually blocking that port. I tried service stop iptables and I could access it.
If you are using an external router you should forward the new port to the server.
If you are not using an external router then be sure that you don’t have iptables configured to only accept connections from localhost.