LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-14-2007, 01:56 PM   #1
sharathkv
Member
 
Registered: Jul 2003
Distribution: HP-UX
Posts: 35

Rep: Reputation: 15
Find the port on which Apache server is listening


Hi,

I have an Apache server running. I can see a number of httpd processes. I want to know on which port the Apache Server is listening.

I knwo it's not the default port 80.It's configured to some unique value.

I do an netstat -a & I get a lot of ports that are in listen & established.

Now how do I find which port apache is listening on?

Thanks
 
Old 04-14-2007, 01:59 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
netstat -lp
 
Old 04-14-2007, 02:00 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Why not just look at your configuration file? It's listed there. Open httpd.conf (wherever it was installed on your system) and search for "Listen".
 
Old 04-14-2007, 02:02 PM   #4
rocket357
Member
 
Registered: Mar 2007
Location: 127.0.0.1
Distribution: OpenBSD-CURRENT
Posts: 485
Blog Entries: 187

Rep: Reputation: 74
The "Listen" line in /etc/apache2/httpd.conf is where it's stored for apache2 (on Gentoo...don't know about other distros, but that seems like a good place to start looking).
 
Old 04-14-2007, 02:02 PM   #5
sharathkv
Member
 
Registered: Jul 2003
Distribution: HP-UX
Posts: 35

Original Poster
Rep: Reputation: 15
Looks I don't have the 'lp' option

Code:
# ps -ef | grep httpd
  webman  3358     1  0 08:53:32 ?         0:00 /opt/nsms/orabase/app/oracle/9iAS/Apache/Apache/bi
n/httpd -d /o
  webman  3363  3358  0 08:53:32 ?         0:00 /opt/nsms/orabase/app/oracle/9iAS/Apache/Apache/bi
n/httpd -d /o
  webman  3361  3358  0 08:53:32 ?         0:00 /opt/nsms/orabase/app/oracle/9iAS/Apache/Apache/bi
n/httpd -d /o
  webman  3366  3358  0 08:53:32 ?         0:00 /opt/nsms/orabase/app/oracle/9iAS/Apache/Apache/bi
n/httpd -d /o
  webman  3367  3358  0 08:53:32 ?         0:00 /opt/nsms/orabase/app/oracle/9iAS/Apache/Apache/bi
n/httpd -d /o
  webman  3364  3358  0 08:53:32 ?         0:00 /opt/nsms/orabase/app/oracle/9iAS/Apache/Apache/bi
n/httpd -d /o
#
# netstat -lp
netstat: illegal option -- l
Usage:  netstat [-an] [-f address-family] [system core]
        netstat [-Mnrsv] [-f address-family] [-p protocol] [system core]
        netstat [-gin] [-I interface] [interval] [system core]
        -a      show state of all sockets, including passive sockets
        -f      show statistics only for specified address family
        -g      show multicast information for network interfaces
        -i      show statistics for network interfaces
        -I      show statistics only for specified network interface
        -M      show multicast routing tables
        -Ms     show multicast routing statistics
        -n      display network addresses numerically
        -p      show statistics only for specified protocol
        -r      show routing tables
        -rv     show additional information for the routing table
        -s      show statistics for all protocols

        interval        display interface statistics continuously
        system          source of kernel symbols
        core            source of kernel data
#
I am on HPUX
 
Old 04-14-2007, 02:11 PM   #6
sharathkv
Member
 
Registered: Jul 2003
Distribution: HP-UX
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks to all, I got it working.

bye
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto do Secured ssh from port https or port80(standard) to ssh d listening port 22 ? Xeratul Linux - General 4 11-23-2006 06:09 AM
server listening on port 22 and attempted logins from an unauthorized user kevinlyfellow Linux - Networking 2 03-24-2005 10:41 PM
How to change listening port of echo server [RH9]? immer Linux - Networking 5 11-29-2003 04:30 PM
X server crashing - port listening time112852 Linux - Software 9 10-06-2003 12:20 PM
Apache listening on port.. well it isn't Newman_SCO Linux - Newbie 10 08-15-2003 12:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration