Thursday, July 14, 2011

Tomcat 7 APR

Tomcat 7 with APR
After a long time (must be 5 years or so) decided to play with Tomcat 7. Have a RHEL6 and so wanted the APR too. Just had to do some more things to get it up and working. Good I have the gcc/make etc already configured on my Linux (for VMware and NVidia native driver).
  1. First downloaded Tomcat 7
  2. Then followed the steps to set JAVA_HOME and JRE_HOME
  3. Startup.sh and it worked. Stopped it
  4. Extract the native from bin gz file.
  5. Tried compiling, didn't work. Said APR not there
  6. Checked a blog, found the APR source, built that one and installed it using 'sudo'
  7. Built tomcat native with the APR above, it worked. Installed it too using 'sudo'
  8. Start Tomcat and it did not pick up the APR
  9. Ah...had forgot to update the LD_LIBRARY_PATH. So updated it and viola it works.
  10. 5 years and still I can do it (well just followed instructions)
Next steps: Need to setup as a daemon.

Here the log where it loaded the things.
1 Jul 12, 2011 8:25:40 PM org.apache.catalina.core.AprLifecycleListener init
2 INFO: Loaded APR based Apache Tomcat Native library 1.1.20.

And the admin web page

"ajp-apr-8009"

Max threads: 200 Current thread count: 0 Current thread busy: 0 Keeped alive sockets count: 0
Max processing time: 0 ms Processing time: 0.0 s Request count: 0 Error count: 0 Bytes received: 0.00 MB Bytes sent: 0.00 MB

StageTimeB SentB RecvClientVHostRequest

P: Parse and prepare request S: Service F: Finishing R: Ready K: Keepalive

"http-apr-8080"

Max threads: 200 Current thread count: 5 Current thread busy: 3 Keeped alive sockets count: 0
Max processing time: 1769 ms Processing time: 1.967 s Request count: 2 Error count: 1 Bytes received: 0.00 MB Bytes sent: 0.01 MB

StageTimeB SentB RecvClientVHostRequest
P??????
S28 ms0 KB0 KB127.0.0.1localhostGET /manager/status HTTP/1.1
P??????

P: Parse and prepare request S: Service F: Finishing R: Ready K: Keepalive