opening port in 11.1

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…

Another try - via Firewall in YAST - I’ve added http and it still does not work.

I’ve tested it using nmap and also tried to enter “localhost” in the browser (no effects).

The PC is not connected to the network.

What I’m doing wrong?

Thanks,
Kamil

Hi,

Don’t be offended but to make it sure: Is there any software like Apache listening to port 80?

Did you try to switch off the firewall?

Greetings

Erik

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

I revised my http server code again and there was a typo…
Thanks for help!

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Good to hear… thank-you for posting back.

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

iD8DBQFJXmoh3s42bA80+9kRAjJKAJ4nTHdkrgjwqbRemAzBohJBpa/VIACeM79U
54odu/YQAczBADDpvxohMeA=
=PSfh
-----END PGP SIGNATURE-----

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”:

  1. the classical one (not coming into play here): creating
    a socket connection having the port in question as its
    destination

  2. 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

  3. 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.

HTH
T.

Thanks for explanation!
Kamil