Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Sep 1997 09:36:38 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Keith Spencer <bsd@smmc.qld.edu.au>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Port 80 being used?How can I tell
Message-ID:  <19970928093638.37943@lemis.com>
In-Reply-To: <199709252104.HAA27269@smmcroute.smmc.qld.edu.au>; from Keith Spencer on Fri, Sep 26, 1997 at 08:19:13AM %2B1000
References:  <199709252104.HAA27269@smmcroute.smmc.qld.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 26, 1997 at 08:19:13AM +1000, Keith Spencer wrote:
> Hi ,
> Is there a way I can find out what ports are being used?
> Apache reports at boot that it can't bind to port 80.
> Apache docs say maybe it is being used   or  maybe the user is set
> wrong or something...
> Any ideas?

If you look in /etc/services, you'll find 

http		 80/tcp	   www www-http		#World Wide Web HTTP
http		 80/udp	   www www-http		#World Wide Web HTTP

In other words, port 80 is known as http.  Next, enter

  $ netstat -a | grep http
  tcp        0      0  *.http                 *.*                    LISTEN

If you see the output I've shown, then something is listening on the
port http.  But that's basically what your Apache error message is
telling you.  The two most likely possibilities are:

1.  You're already running httpd.  You can check this with:

    $ ps aux | grep http
    grog    2533  3.1  0.7   252  628  p3  S+    9:32AM   0:00.02 grep http
    root     119  0.0  0.1   492  132  ??  Ss    5:34PM   0:14.02 /usr/local/www/server/httpd
    nobody   120  0.0  0.2   536  180  ??  I     5:34PM   0:00.12 /usr/local/www/server/httpd
    nobody   121  0.0  0.2   528  188  ??  I     5:34PM   0:00.08 /usr/local/www/server/httpd
    nobody   122  0.0  0.1   492   88  ??  I     5:34PM   0:00.00 /usr/local/www/server/httpd
    nobody   123  0.0  0.1   492   88  ??  I     5:34PM   0:00.00 /usr/local/www/server/httpd
    nobody   124  0.0  0.1   492   88  ??  I     5:34PM   0:00.00 /usr/local/www/server/httpd
    nobody  2009  0.0  0.2   536  188  ??  I     4:28AM   0:00.02 /usr/local/www/server/httpd
    nobody   541  0.0  0.1   492   80  ??  I     6:04PM   0:00.00 /usr/local/www/server/httpd
    
    This display shows 8 httpds (the usual number).

2.  If you don't see anything above, check /etc/inetd.conf.  If you
    find a line beginning with http, then inetd is listening on http.
    If that's not what you want, comment out the line (put a # in
    front of it), and update inetd:

    # ps aux | grep inetd
    root     117  0.0  0.1   196   96  ??  Is    5:34PM   0:00.64 inetd
    # kill -1 117

    The 117 is the second field in the ps output

Greg



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970928093638.37943>