Sponsored Content
Top Forums Shell Programming and Scripting Get opened port with given PID? Post 302540568 by linuxadmin on Thursday 21st of July 2011 05:09:07 AM
Old 07-21-2011
thanks zaxxon for your fast reply..

But what about this..


Quote:
Originally Posted by linuxadmin

Code:
cat `echo $CATALINA_HOME/logs/catalina.out` | grep -B10 "INFO: Server startup in"

gives the output as
INFO: Deploying web application directory docs
Jul 21, 2011 9:56:27 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Jul 21, 2011 9:56:27 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 21, 2011 9:56:27 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jul 21, 2011 9:56:27 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/25 config=null
Jul 21, 2011 9:56:27 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 18838 ms
--
INFO: Deploying web application directory docs
Jul 21, 2011 12:12:16 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Jul 21, 2011 12:12:16 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 21, 2011 12:12:16 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jul 21, 2011 12:12:16 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
Jul 21, 2011 12:12:16 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 17808 ms
--
INFO: Deploying web application directory docs
Jul 21, 2011 12:38:59 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Jul 21, 2011 12:38:59 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 21, 2011 12:38:59 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jul 21, 2011 12:38:59 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/23 config=null
Jul 21, 2011 12:38:59 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 21409 ms

Code:
grep "`date +"%b %d"`"

will give the date started..

but i don't know how to code exactly this..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

2. HP-UX

To find pid from port number

Hi, I am working on HP-UX Release 11i. I want to find the process id (PID) of the process running on a particular port. lsof command fuser does not work on this system. Please suggest some alternative. Thanks (6 Replies)
Discussion started by: gmat
6 Replies

3. UNIX for Dummies Questions & Answers

pid from port number in AIX

Hello guys, How to shut down a port number in AIX. May be first I need to find out what is the process ID of that process that listens to this particular port.. Is there any command to find a process ID from the port number other than "lsof". thanks (1 Reply)
Discussion started by: solaix14
1 Replies

4. Shell Programming and Scripting

File exists, but cannot be opened.How to check- whether it could be opened to read when it exists

Hi #Testing for file existence if ; then echo 'SCHOOL data is available for processing' else echo 'SCHOOL DATA IS NOT AVAILABLE FOR PROCESSING' : i wrote a script, where it begins by checking if file exists or not. If it exists, it truncates the database... (2 Replies)
Discussion started by: rxg
2 Replies

5. UNIX for Dummies Questions & Answers

Find PID for a port

Hi, I need to find the PID for a given port on the below system. HP-UX mymachine B.11.31 U ia64 3223107173 unlimited-user license How can I ? (4 Replies)
Discussion started by: mohtashims
4 Replies

6. HP-UX

Find port for Pid

Hi, Is this the most appropriate way of finding the listen port number given the pid is "16659" ? lsof -Pan -i tcp -i udp | grep 16659 | grep -i "listen"If so, how can I extract "7001" and assign it to a variable say myport=7001 from the below output which happens to be actual port number? ... (1 Reply)
Discussion started by: mohtashims
1 Replies

7. UNIX for Advanced & Expert Users

Find PID using a Port?

Hi, I do not have root user credentials nor do I have the functional id of the process that uses port 80. How can I find the pid of the process using the port number 80 ? Operating System: Linux (6 Replies)
Discussion started by: mohtashims
6 Replies

8. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies
apache(1M)                                                System Administration Commands                                                apache(1M)

NAME
apache - Apache hypertext transfer protocol server overview DESCRIPTION
apache consists of a main server daemon, loadable server modules, some additional support utilities, configuration files, and documenta- tion. FILES
The apache HTTPD server is integrated with Solaris. The following files specify the installation locations for apache: /etc/apache Contains server configuration files. A newly-installed server must be manually configured before use. Typically this involves copying httpd.conf-example to the httpd.conf file and making local configuration adjustments. /usr/apache/bin Contains the httpd executable as well as other utility programs. /usr/apache/htdocs Contains the Apache manual in HTML format. This documentation is accessible by way of a link on the server test page that gets installed upon fresh installation. /usr/apache/include Contains the Apache header files, which are needed for building various optional server extensions with apxs(8) /usr/apache/jserv Contains documention for the mod_jserv java servlet module. Documention can be read with a web browser using the url: file:/usr/apache/jserv/docs/index.html /usr/apache/libexec Contains loadable modules (DSOs) supplied with the server. Any modules which are added using apxs(8)are also copied into this directory. /usr/apache/man Contains man pages for the server, utility programs, and mod_perl. Add this directory to your MANPATH to read the Apache man pages. See NOTES. /usr/apache/perl5 Contains the modules and library files used by the mod_perl extension to Apache. /var/apache/cgi-bin Default location for the CGI scripts. This can be changed by altering the httpd.conf file and restarting the server. /var/apache/htdocs Default document root. This can be changed by altering the httpd.conf file and restarting the server. /var/apache/icons Icons used by the server. This normally shouldn't need to be changed. /var/apache/logs Contains server log files. The formats, names, and locations of the files in this directory can be altered by various configuration directives in the httpd.conf file. /var/apache/proxy Directory used to cache pages if the caching feature of mod_proxy is enabled in the httpd.conf file. The location of the cache can also be changed by changing the proxy configuration in the httpd.conf file. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWapchr | +-----------------------------+-----------------------------+ | |SUNWapchu | +-----------------------------+-----------------------------+ | |SUNWapchd | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) http://www.apache.org NOTES
In addition to the documentation and man pages included with Solaris, more information is available at http://www.apache.org The Apache man pages are provided with the programming modules. To view the manual pages for the Apache modules with the man command, add /usr/apache/man to the MANPATH environment variable. See man(1) for more information. Running catman(1M) on the Apache manual pages is not supported. SunOS 5.10 8 Aug 2000 apache(1M)
All times are GMT -4. The time now is 12:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy