Hi
On localhost you shouldn’t need to open the port to test, the fact that
it’s still closed would indicate the service that is binding to port 80
isn’t running…
–
Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 x86 Kernel 2.6.27.7-4-default
up 2 days 17:44, 1 user, load average: 0.00, 0.03, 0.06
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.82
As a note in the future don’t try to see what you have open locally with
nmap… it’s just the wrong way to do it. Instead you can use
‘netstat’ which shows you what is listening according to the OS (which
may or may not then be blocked somehow via the firewall) and it should
be infinitely faster:
netstat -anp | grep 'LISTEN ’
Others like using the ‘l’ switch as well which I believe shows listening
ports.
Good luck.
kamilee wrote:
> I revised my http server code again and there was a typo…
> Thanks for help!
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
kamilee schrieb:
> Hi.
> I’m trying to open port 80 (will be used locally for testing).
> First check if it’s not already opened:
> nmap -v -p 80 localhost
> result - closed.
>
> Second thing:
> iptables -A INPUT -p tcp --dport 80 -j ACCEPT
>
> Then nmap again - and still closed…
…]
> What I’m doing wrong?
You are probably confusing two of the three senses of the
expression “opening a port”:
the classical one (not coming into play here): creating
a socket connection having the port in question as its
destination
the firewall one (addressed by the iptables command):
letting connections to the port in questions pass through
the firewall, as opposed to blocking them; this has of
course no effect if the final destination of the
connection attempt has no service listening on that port
anyway
the server-side one (addressed by the nmap command):
listening for incoming connections on the socket in
question, ie. preparing to accept attempts by a client
to open it in sense 1. Some call this “opening” the port
because it changes the output of nmap and similar port
scanning programs from “closed” to “open” for that port.
The correct term however is “listening” or “offering a
service” on the port.