Solved

how to make sure that apache and tomcat servers talkin to each other

Posted on 2011-09-30
53
1,786 Views
Last Modified: 2012-05-12
Hi all Please help,

I have two server ..on one i have apache installed and on 2nd i have tomcat but seems like its not working ..please help me how to check whether they are talking to each other or not?
0
Comment
Question by:coolcap
  • 26
  • 24
  • 2
  • +1
53 Comments
 
LVL 11

Expert Comment

by:MacAnthony
Comment Utility
What do you mean by 'Talking to each other'? Are they setup as tomcat workers through apache? Or do you just want to know if it can access the other server?

If it's access you want, you should be able to telnet from the apache server to the host and port that you have tomcat listening on to see if the one server can access the other.

telnet tomcat.domain.com 8080

Open in new window


If it's setup as a worker, when you restart apache, you should see some sort of error in either the error_log or the worker_log for apache.
0
 

Author Comment

by:coolcap
Comment Utility
Here is the details..have 3 servers

A - Apache Server Httpd - having redhat 5.6
B - Tomcat Server having redhat 5.6
C Database server having Mysql on it

I want to check whether server A is able to connect to server B or not..

User = abc
Port = 8009

so what i need to do now ..
some more logs from server B

-->from /usr/local/tomcat/logs/catalina.date.log
 org.apache.jk.commom.ChannelSocket processConnection
SEVERE : BAD Packet signature 18245
SEVERE:Error ,Processing Connection
Plss advice

0
 
LVL 11

Expert Comment

by:MacAnthony
Comment Utility
I still don't really understand what apache's role is in this setup. Is it some sort of proxy or something?

I would restart tomcat. Does it show any errors in the catalina.out when starting?
0
 
LVL 7

Expert Comment

by:jackiechen858
Comment Utility
I guess you are using mod_jk to configure apache and tomcat?

You probably should post your apache configuration/ mod_jk's worker.properties file.

for work.proerties configuration, normally it has a host and a port like this:

worker.tomcat4.type=ajp13
worker.tomcat4.host=hostname
worker.tomcat4.port=8009

I am not sure why you have a "user =abc" here.

You can try "telnet tomcathost 8009" from the apache server , see if you have a network problem first.





0
 

Author Comment

by:coolcap
Comment Utility
Hi Jack , you are right m using mod_jk to configure

ok i have tried it and it shows
Trying 192.x.x.x
Connected to hostname

from both Tomcat server and apache server (note i have seperate server for Apache n tomcat n hardware too)

My application first connect to Apache server than apache server sent request with port 8009 to tomcat server...

just want to know what else i can verify to check all is working?
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
You have to add JkMount to your httpd.conf and to check the connection is working
for example you add
JkMount /test loadbalancer0  [ loadbalancer0 will be in worker.properties]

go to your browser and hit http://apacheserver/test
and you should see an error from tomcat server
this should be the same if you do http://tomcatserver:8080/test

0
 

Author Comment

by:coolcap
Comment Utility
Here are  the new error logs in /etc/httpd/logs/mod_jk.log

[Fri Sep 30 17:30:02.760 2011] [15354:3086817888] ajp_connection_tcp_get_message::jk_ajp_common.c (1245): wrong message format 0x4854 from 192.168.84.23:8009 [Fri Sep 30 17:30:02.761 2011] [15354:3086817888] ajp_get_reply::jk_ajp_common.c (2058): (ajp13w) Tomcat is down or refused connection. No response has been sent to the client (yet) [Fri Sep 30 17:30:02.761 2011] [15354:3086817888] [info] ajp_service::jk_ajp_common.c (2543): (ajp13w) sending request to tomcat failed (recoverable), because of protocol error (attempt=1) [Fri Sep 30 17:30:02.862 2011] [15354:3086817888] ajp_connection_tcp_get_message::jk_ajp_common.c (1245): wrong message format 0x4854 from 192.168.84.23:8009 [Fri Sep 30 17:30:02.862 2011] [15354:3086817888] ajp_get_reply::jk_ajp_common.c (2058): (ajp13w) Tomcat is down or refused connection. No response has been sent to the client (yet) [Fri Sep 30 17:30:02.862 2011] [15354:3086817888] [info] ajp_service::jk_ajp_common.c (2543): (ajp13w) sending request to tomcat failed (recoverable), because of protocol error (attempt=2) [Fri Sep 30 17:30:02.862 2011] [15354:3086817888] ajp_service::jk_ajp_common.c (2562): (ajp13w) connecting to tomcat failed.
[Fri Sep 30 17:30:02.862 2011] [15354:3086817888] [info] jk_handler::mod_jk.c (2627): Service error=-11 for worker=ajp13w [Fri Sep 30 17:30:02.982 2011] [15384:3086817888] ajp_connection_tcp_get_message::jk_ajp_common.c (1245): wrong message format 0x4854 from 192.168.84.23:8009 [Fri Sep 30 17:30:02.982 2011] [15384:3086817888] ajp_get_reply::jk_ajp_common.c (2058): (ajp13w) Tomcat is down or refused connection. No response has been sent to the client (yet) [Fri Sep 30 17:30:02.982 2011] [15384:3086817888] [info] ajp_service::jk_ajp_common.c (2543): (ajp13w) sending request to tomcat failed (recoverable), because of protocol error (attempt=1) [Fri Sep 30 17:30:03.084 2011] [15384:3086817888] ajp_connection_tcp_get_message::jk_ajp_common.c (1245): wrong message format 0x4854 from 192.168.84.23:8009 [Fri Sep 30 17:30:03.084 2011] [15384:3086817888] ajp_get_reply::jk_ajp_common.c (2058): (ajp13w) Tomcat is down or refused connection. No response has been sent to the client (yet) [Fri Sep 30 17:30:03.084 2011] [15384:3086817888] [info] ajp_service::jk_ajp_common.c (2543): (ajp13w) sending request to tomcat failed (recoverable), because of protocol error (attempt=2) [Fri Sep 30 17:30:03.084 2011] [15384:3086817888] ajp_service::jk_ajp_common.c (2562): (ajp13w) connecting to tomcat failed.
[Fri Sep 30 17:30:03.084 2011] [15384:3086817888] [info] jk_handler::mod_jk.c (2627): Service error=-11 for worker=ajp13w [Fri Sep 30 17:35:32.409 2011] [28166:3086662240] [info] init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized [Fri Sep 30 17:35:32.480 2011] [28167:3086662240] [info] init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized


0
 

Author Comment

by:coolcap
Comment Utility
above logs are coming when i am trying to telnet with 8009 port...plss help
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Can you paste here
Apache: htttp.conf workers.properties
tomcat server.xml
0
 

Author Comment

by:coolcap
Comment Utility
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
add jvmRoute to server.xml
<Engine name="Catalina" defaultHost="localhost">

Open in new window

as
<Engine name="Catalina" defaultHost="localhost" jvmRoute="ajp13w" >

Open in new window


in mod-jk.conf
change
JkWorkerProperty worker.ajp13w.host=hostname

Open in new window


to
JkWorkerProperty worker.ajp13w.host=ipaddress of tomcat server

Open in new window



if you want to use worker.properties you need to add this to you httpd.conf

JkWorkersFile "conf/workers.properties"

Open in new window


I am not sure if all that can be in mod-jk.conf but you can give it a try.




0
 

Author Comment

by:coolcap
Comment Utility
thank u so much ..i have changed and its better but not sucessfully running ...

1. the application which m running it shows
-->DTS,290911 13:57:03,    SERVER poll,1,0, Connecting over primary server.
DTS,290911 13:57:03,    Send FAILED,1,404, HTTP error encountered on DTS handshake.
DTS,290911 13:57:03,       MBX POLL,0,0, Polling mailbox DTS.
DTS,290911 13:57:03,         UPLOAD,0,0, Uploading to mailbox.

2./usr/local/tomcat/logs/catalina.out shows when i tried to telnet

Aug 30, 2011 4:19:01 PM org.apache.catalina.startup.Catalina load
WARNING: Can't load server.xml from /usr/local/tomcat/conf/server.xml Aug 30, 2011 4:19:01 PM org.apache.catalina.startup.Catalina load
WARNING: Can't load server.xml from /usr/local/tomcat/conf/server.xml Aug 30, 2011 4:19:01 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 0 ms
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: java.lang.NullPointerException
        at org.apache.catalina.startup.Catalina.await(Catalina.java:616)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
        ... 6 more
Aug 30, 2011 4:36:00 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 585 ms

3. On Apapche server
telnet tomcatserverhostname 8009
Trying 192.168.x.x...
Connected to tomcatserverhostname.
Escape character is '^]'.
Connection closed by foreign host.

Logs for /etc/httpd/logs/mod_jk-conf.log

[Fri Sep 30 18:15:48.442 2011] [3235:3086596704] [info] init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized [Fri Sep 30 18:15:48.542 2011] [3236:3086596704] [info] init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized [Fri Sep 30 19:57:01.355 2011] [4691:3086830176] [info] init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized [Fri Sep 30 19:57:01.462 2011] [4692:3086830176] [info] init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized

Please advice our suggest...m tottaly fed up with this :(
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
How are you trying to start tomcat ?
startup.sh

is the JAVA_HOME variable set to correct location in that file?
0
 

Author Comment

by:coolcap
Comment Utility
i dnt know much abt tomcat ....i ma using service tomcat restart and JAVA_HOME variable where to confirm the file and location?
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Look at  /etc/init.d/tomcat and you will find the location or the file which has that in there
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
/usr/local/tomcat/bin could also be a good location to look at
0
 

Author Comment

by:coolcap
Comment Utility
i found it  and run it but still same logs ....could you please guide me how to cross check that servers communicationg with each other
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
try also to put the following in context.xml in tomcat/conf instead on server.xml

<Resource name="jdbc/dtsrwDataSource" username="dtsappuser" password="newpass" url="jdbc:mysql://mysql:3306/dts" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" driverClassName="com.mysql.jdbc.Driver" maxIdle="2" maxActive="4" maxWait="11000" validationQuery="SELECT 2" testWhileIdle="true" timeBetweenEvictionRunsMillis="10000" testOnBorrow="false" minEvictableIdleTimeMillis="60000"/>
<!--
Datasource for read-only (dts-customer-mon) database
-->
<!-- Test the connection every 10 seconds -->
<Resource name="jdbc/dtsroDataSource" username="rouser" password="R3b3l" url="jdbc:mysql://mysql:3306/dts" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" driverClassName="com.mysql.jdbc.Driver" maxIdle="2" maxActive="4" maxWait="11000" validationQuery="SELECT 3" testWhileIdle="true" timeBetweenEvictionRunsMillis="10000" testOnBorrow="false" minEvictableIdleTimeMillis="60000"/>

Open in new window

0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Server communication setup test is easy

put
JkMount /jkstatus* jkstatus in httpd.conf that ang go to http://httpserver/jkstatus to see some info

also you can try
JkMount /test* ajp13w

and if you go to http://httpserver/test  you should see the same page as
http://tomcatserver:8080/test

If you see the same then the communication with apache and tomcat is working fine.

Before you do that you have to see if tomcat has started without any errors by itself.
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Also looks like the HTTP container for tomcat is missing to do the above test add the following to tomcat after <Service name="Catilina">

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Open in new window

0
 

Author Comment

by:coolcap
Comment Utility
you mean to say remove server.xml and put context?
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
No add context.xml along with server.xml and move the Dataresources to context.xml.

but before that did you try the communication ?
0
 

Author Comment

by:coolcap
Comment Utility
i have tried to test but both test failed ..no welcome page open on both server..

on web server when i m running curl http://tomcatservername:8009
it shows curl: (52) Empty reply from server

and same on tomcat server

when i put ur connector for http it shows parse fatal error during service restart ...open quote expected for attribute "redirectPort" associated with element type "Connector"
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
on webserver try curl http://apache:apacheport/test   [example http://192.168.1.100/test]

port 8009 speaks AJP not HTTP

I am assuming you want to setup User <--> Apache <--> Tomcat<-->mysql

so you as a user hit apache not tomcat directly.
0
 

Author Comment

by:coolcap
Comment Utility
I tried but that is not working showing /test not found ..and when m running http://hostnamewebserver it shows welcome page .../test is the partiton on my mysql backen server which is mounted on tomcat server with nfs  

you r right i want to contact it tomcat server through a web servers..

my application first go to webserver than webserver connect to tomcat and tomcat connect to mysql server for database n all...and /test or /dts is the partition which is on mysql server mounted on tomcat server as /dts
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Can you give me the output of the curl

change test to any text rename it as tomcatUthere does not matter what you should get is something similar to the following. If you get this then your communication from apache to tomcat is working fine.

<html><head><title>Apache Tomcat/6.0.14 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /tomcatUthere</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/tomcatUthere</u></p><p><b>description</b> <u>The requested resource (/tomcatUthere) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.14</h3></body></html>

Open in new window

0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
The test is to get the not found response from tomcat. If you get it from apache then the communication is not working but if you get the not found from tomcat then tomcat and apache are talking to each other
0
 

Author Comment

by:coolcap
Comment Utility
m sorry ..where n which file u want me to edit for test ..can i create new txt file on web server?plss explain
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
in mod_jk.conf of apache conf.d folder add JkMount /test* ajp13w at the end of the file
restart apache

curl http://apache/test

give me the output here .
0
 

Author Comment

by:coolcap
Comment Utility
I have tried with webserver ip and hostname both this is the reply

curl http://192.168.x.x/test
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /test was not found on this server.</p> <hr> <address>Apache Server at 192.168.x.x Port 80</address> </body></html>
0
 

Author Comment

by:coolcap
Comment Utility
these are the strange logs coming in /var/log/debug

Oct  1 11:58:01 webserverhostname crond[32202]: pam_tally(crond:account): option deny=3  allowed in auth phase only Oct  1 11:58:01webserverhostname crond[32202]: pam_tally(crond:account): unknown option: no_magic_root Oct  1 11:58:01 webserverhostname crond[32202]: pam_tally(crond:account): unknown option: reset Oct  1 11:58:01 webserverhostname crond[32202]: pam_unix(crond:session): session opened for user root by (uid=0) Oct  1 11:58:01 webserverhostname crond[32203]: (root) CMD (/usr/operations/bin/check_http_logs -pd) Oct  1 11:58:01 webserverhostname crond[32202]: pam_unix(crond:session): session closed for user root Oct  1 11:58:02 webserverhostnamesnmpd[2874]: Connection from UDP: [127.0.0.1]:52857 Oct  1 11:58:02 webserverhostnamesnmpd[2874]: Received SNMP packet(s) from UDP: [127.0.0.1]:52857 Oct  1 11:58:02 webserverhostname snmpd[2874]: Connection from UDP: [127.0.0.1]:42897
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
the curl test shows that the apache to tomcat connection for ajp is not working

can you paste here the new conf files

httpd.conf modjk server.xml

also clear catalina.out after shutting down tomcat and start it attach that log here

also the output of the following commands on tomcat server

netstat -an | grep 8009
0
 

Author Comment

by:coolcap
Comment Utility
netstat output
---------------

netstat -an | grep 8009
tcp        0      0 :::8009                     :::*                        LISTEN


server.xml
------------

<Server port="8005" shutdown="SHUTDOWN">

    <!-- Define the data sources - one for the dts master db, and one for the re                                                                             ad-only one -->
    <GlobalNamingResources>

      <!-- Datasource for master (mysql) database -->
      <!--   Test the connection every 10 seconds -->
      <Resource
        name="jdbc/dtsrwDataSource"
        username="user"
        password="password"
        url="jdbc:mysql://mysql:3306/dts"
        type="javax.sql.DataSource"
        factory="org.apache.commons.dbcp.BasicDataSourceFactory"
        driverClassName="com.mysql.jdbc.Driver"
        maxIdle="2"
        maxActive="4"
        maxWait="11000"
        validationQuery="SELECT 2"
        testWhileIdle="true"
        timeBetweenEvictionRunsMillis="10000"
        testOnBorrow="false"
        minEvictableIdleTimeMillis="60000"
      />


      <!-- Datasource for read-only (mon) database -->
      <!--   Test the connection every 10 seconds -->
      <Resource
        name="jdbc/dtsroDataSource"
        username="user"
        password="password"
        url="jdbc:mysql://mon:3306/dts"
        type="javax.sql.DataSource"
        factory="org.apache.commons.dbcp.BasicDataSourceFactory"
        driverClassName="com.mysql.jdbc.Driver"
        maxIdle="2"
        maxActive="4"
        maxWait="11000"
        validationQuery="SELECT 3"
        testWhileIdle="true"
        timeBetweenEvictionRunsMillis="10000"
        testOnBorrow="false"
        minEvictableIdleTimeMillis="60000"
      />

    </GlobalNamingResources>


  <Service name="Catalina">

    <!-- This is the way requests come in (from Apache) -->
    <!-- Timeout connections after 600000ms (10m) to match apache worker -->
    <Connector port="8009" protocol="AJP/1.3" maxThreads="260" connectionTimeout                                                                             ="600000" />

    <Engine name="Catalina" defaultHost="localhost" jvmRoute="ajp13w">
      <!-- Characteristics for the webapps dir -->
      <Host name="localhost" appBase="webapps" unpackWARs="true" deployOnStartup                                                                             ="true" autoDeploy="false" />
    </Engine>


  </Service>

</Server>


Mod-jk file
------------


<IfModule !mod_jk.c>
  # LoadModule jk_module "/etc/httpd/modules/mod_jk.so"
  LoadModule jk_module modules/mod_jk.so
</IfModule>


# Define the module log file and the level of detail
# (trace, debug, info, warn or error)
JkLogFile     logs/mod_jk.log
# JkLogLevel    debug
# JkLogLevel    trace
JkLogLevel    info


# Define some workers
# Define the ajp13w worker as passed to Tomcat on port 8009 using ajp13
JkWorkerProperty worker.list=ajp13w
JkWorkerProperty worker.ajp13w.type=ajp13
# JkWorkerProperty worker.ajp13w.host=localhost
JkWorkerProperty worker.ajp13w.host=tomcatserverhostname
JkWorkerProperty worker.ajp13w.port=8009

# Apache documentation (connectors-doc) suggests the following
# in harmony with a tomcat connectionTimeout of 600000 (mS)
# Note: recycle_timeout documented, but replaced by connection_pool_timeout!!!!
# JkWorkerProperty worker.ajp13w.socket_keepalive=1
# JkWorkerProperty worker.ajp13w.recycle_timeout=600
JkWorkerProperty worker.ajp13w.connection_pool_timeout=600

### Temporarily, disable connection pooling, to test 'bad' solution to the issue
### with FE -> App connections being canned
# JkOptions +DisableReuse

# Un-map the favicon URI
# Note this works in mod_jk v1.2.7 (we curr have v1.2.6)
JkUnMount /favicon ajp13w


httpd.conf
-------------

ServerTokens Prod
ServerSignature Off

ServerRoot "/etc/httpd"

PidFile run/httpd.pid

Timeout 120

KeepAlive Off

MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

Listen 80

### Added for Apache 2.2 config
LoadModule authz_host_module modules/mod_authz_host.so
### End
LoadModule log_config_module modules/mod_log_config.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule cgi_module modules/mod_cgi.so

#Entries For JkShmFile
#LoadModule jk_module modules/mod_jk.so
#JkWorkersFile /etc/httpd/conf/workers.properties
#JkLogFile logs/mod_jk.log
#JkLogLevel error
##JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
#JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
#JkRequestLogFormat "%w %V %T"
#JkShmFile logs/jk.shm
#JkMount /dts/* ajp13w

Include conf.d/*.conf

User apache
Group apache

UseCanonicalName Off

DocumentRoot "/var/www/html"

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/html">
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

<IfModule mod_userdir.c>
    UserDir disable
</IfModule>

DirectoryIndex index.html index.html.var

TypesConfig /etc/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>

HostnameLookups Off

ErrorLog logs/error_log

LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog logs/access_log combined

ServerSignature On

Alias /crdocs/ "/var/www/crdocs/"

<Directory "/var/www/crdocs">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<IfModule mod_dav_fs.c>
    DAVLockDB /var/lib/dav/lockdb
</IfModule>


ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

AddDefaultCharset UTF-8

AddHandler type-map var

Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>


</IfModule>
</IfModule>

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully


Catalina.out logs - clear after stop and created after start
------------------------------------------

cat catalina.out
Oct 1, 2011 1:22:59 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 271 ms
Oct 1, 2011 1:22:59 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 1, 2011 1:22:59 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
Oct 1, 2011 1:22:59 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Oct 1, 2011 1:22:59 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive dts.war
Oct 1, 2011 1:23:00 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Oct 1, 2011 1:23:00 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/51  config=null
Oct 1, 2011 1:23:00 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1264 ms
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
at the end of mod-jk file add

JkMount /coolcap* ajp13w

Open in new window


service httpd restart

please paste after restarting apache
curl http://apahceserver/coolcap

and give me the output here
0
 

Author Comment

by:coolcap
Comment Utility
it shows nothing no error no message jst return back to the shell..just show
#curl http://apacheserver/coolcap
#

0
 

Author Comment

by:coolcap
Comment Utility
but when i am running
curl http://apacheserver/coolcap/

than it shows following
<html><head><title>Apache Tomcat/5.5.23 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /dts/</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/dts/</u></p><p><b>description</b> <u>The requested resource (/dts/) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/

0
 

Author Comment

by:coolcap
Comment Utility
sorry above logs are coming using dts not coolcap

i.e. dts/ and dts

for coolcap and coolcap/ it shows blank
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Ok this shows that your AJP setup is correct just add the corresponding JkMount for your application in the mod-jk file

for example if you application is deployed in to tomcat with webapp folder expanding the war file as
tomcat/webapps/dtsapplication

then to publish that from apache you need to add

JkMount /dtsapplication* ajp13w

Open in new window


in your mod-jk file at the end and

service httpd restart
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Looks like in your case just put at the end of mod-jk file and restart

JkMount /dts/* ajp13w

Open in new window


0
 

Author Comment

by:coolcap
Comment Utility
done as u said but same message


curl http://apacheserver/dtsapplication/

than it shows following
<html><head><title>Apache Tomcat/5.5.23 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /dts/</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/dts/</u></p><p><b>description</b> <u>The requested resource (/dts/) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/

0
 

Author Comment

by:coolcap
Comment Utility
i think my webserver unable to reach or find that /dtsapplication folder on tomcat server ? if yes than what i can do in this?
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
coolcap are you using mod_jk / tomcat / apache for the first time ?

We have established that AJP setup is correct.

Now what do you want to do ?

how do you get to your application ?

is it a webservice etc? what is your test case what makes you think that your application is not working?

what you are getting is tomcat saying that that particular URL you are looking for is not served by the application.

Ask you application guys to test their app or you can test it if you know how.

also just to confirm
can you give the output of

ls webapps  from tomcat server (webapps is in tomcat installation folder)


0
 

Author Comment

by:coolcap
Comment Utility
we have a application that send n receive msgs and this application connect to webserver first than link to application/tomcat server and this server having a mount point called /dts which is actually located on our backend server having mysql.

when my application guys testing their code it shows this :
> DTS,280911 16:38:38,    SERVER poll,1,0, Connecting over primary server.
DTS,280911 16:38:39,    Send FAILED,1,404, HTTP error encountered on DTS handshake.
DTS,280911 16:38:39,       MBX POLL,0,0, Polling mailbox DTS.
DTS,280911 16:38:39,         UPLOAD,0,0, Uploading to mailbox.

ls webapps output:
dts dts.war
in #tomcat~ ls -lrt
>755 dtsuser:dtsgroup webapps
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Can you try and ask them if they can get more logs from their app for
Send FAILED,1,404, HTTP error encountered on DTS handshake.

like what server they are hitting/ any more details on 404 error their requesting URI etc...

also just to confirm there is no typo
you have tried

curl http://apacheserver/dts/  above
NOT
curl http://apacheserer/dtsapplication which was an example right?
0
 
LVL 2

Accepted Solution

by:
scaryskullz earned 500 total points
Comment Utility
Just to confirm that tomcat / apache is setup right download the mytomcat-helloworld-war.zip app from

http://www.michael-thomas.com/tech/apache/tomcat/tutorial_firststeps_tomcat/index.htm

unzip mytomcat-helloworld-war.zip and put it in webapps

go to your mod-jk file and add

JkMount /mytomcat-helloworld* ajp13w

restart apache

then see what you get with the following command

curl http://apacheserver/mytomcat-helloworld/

you should get something like

<html>
<head>
<title>App Index for: mytomcat-helloworld</title>
</head>
<body>
<h1 align="center">App Index for: mytomcat-helloworld</h1>
<ul>
  <li>
    <a href="pages/myhelloworld_jstl.jsp">pages/myhelloworld_jstl.jsp</a> - JSTL Hello World Example
  </li>
  <li>

    <a href="pages/myhelloworld_bean.jsp">pages/myhelloworld_bean.jsp</a> - JSP & Java Bean Hello World Example
  </li>
  
  <li>
    <a href="servlet/MyHelloWorldServlet">servlet/MyHelloWorldServlet</a> - Servlet Hello World Example
  </li>

  <a href="servlet/HelloWorldExample">
</ul>

</body>
</html>

Open in new window


If you get this then there is something wrong with DTS configuration that needs to be checked.
0
 

Author Comment

by:coolcap
Comment Utility
these are the ssl logs for DTS application
------------------------------------------------------

If I can give a guess, it can be something related to servelets being deployed or present on the server.
 
 
DEBUG Logs:
---------------------------------------------------------------------------------
DEBUG: Code completed the signal check and now it is moving ahead
DEBUG: Starting with mailbox setting
DEBUG: Finished with mailbox setting
DEBUG: Set the required mailbox
DEBUG: Inside DTS_TestServer
DEBUG: Socket Descriptor setup returned 96
DEBUG: Socket set to non blocking.
DEBUG: Not using Proxy cfg looking up server IP's
DEBUG: Starting Hostlookup for primary
DEBUG: IP address webserverIP
DEBUG: sa unpacked 0
DEBUG: connecting using primary URL
DEBUG: connect command returns -1
DEBUG: Select on socket returns 1
DEBUG: Timeout set to 10
DEBUG: Setting Only Primary to True
DEBUG: Done iwth the server checking
DEBUG: Use Primary is true in DTS_Client.cpp, Checking DTS_TestSess
DEBUG: Inside DTS_TestSess - SSL client/server handshake successful c:\dtsv4\log
\
DEBUG: Inside DTS_TestSess - SSL client/server handshake successful
DEBUG: Inside DTS_TestSess - SSL client/server handshake successful c:\dtsv4\log
\
DEBUG: Entering into BldHeader functionDEBUG: Entering into BldmimePart function
DEBUG: Entering into BldmimePart-Anthentication part functionDEBUG: Before 0 mem
ory partDEBUG: Entering into memory partDEBUG: Entering into version partDEBUG:
came to pid partDEBUG: came to poll periodDEBUG: Inside DTS_TestSess - about to
call DTS_DataToSvr: 14
DEBUG: Inside DTS_TestSess - return status from DTS_DataToSvr: 0
DEBUG: Inside DTS_TestSess - about to call DTS_DataToSvr: 0
DEBUG: Inside DTS_TestSess - return status from DTS_DataToSvr: 0
DEBUG: Inside DTS_TestSess - Calling ReceiveData
DEBUG: Inside DTS_TestSess - Calling ReceiveData: 0
DEBUG: Inside DTS_TestSess - SSL client/server handshake successful c:\dtsv4\log
\
DEBUG: Inside DTS_TestSess - SSL client/server handshake successful
DEBUG: Inside DTS_TestSess - SSL client/server handshake successful c:\dtsv4\log
\
DEBUG: Entering into BldHeader functionDEBUG: Entering into BldmimePart function
DEBUG: Entering into BldmimePart-Anthentication part functionDEBUG: Before 0 mem
ory partDEBUG: Entering into memory partDEBUG: Entering into version partDEBUG:
came to pid partDEBUG: came to poll periodDEBUG: Inside DTS_TestSess - about to
call DTS_DataToSvr: 14
DEBUG: Inside DTS_TestSess - return status from DTS_DataToSvr: 0
DEBUG: Inside DTS_TestSess - about to call DTS_DataToSvr: 24187424
DEBUG: Inside DTS_TestSess - return status from DTS_DataToSvr: 0
DEBUG: Inside DTS_TestSess - Calling ReceiveData
DEBUG: Inside DTS_TestSess - Calling ReceiveData: 0
DEBUG: Entering into BldHeader functionDEBUG: Entering into BldmimePart function
DEBUG: Entering into BldmimePart-Anthentication part functionDEBUG: Before 0 mem
ory partDEBUG: Entering into memory partDEBUG: Entering into version partDEBUG:
came to pid partDEBUG: came to poll periodDEBUG: Finished polling mailboxes

and These are the Application complete logs
------------------------------------------------------------

,280911 16:38:38,        STARTUP,0,0, DTS Client WIN32 started
,280911 16:38:38,Config Settings,0,0, DTS Client configuration details follow:
,280911 16:38:38,               ,0,0,    Client Mode: Multi-mailbox
,280911 16:38:38,               ,0,0,        LogPath: c:\dtsv4\log\
,280911 16:38:38,               ,0,0,       CertPath: c:\dtsv4\certs\Certificate.cer
,280911 16:38:38,               ,0,0,     SignalPath: c:\dtsv4\sig\dtsclient.sig
,280911 16:38:38,               ,0,0,     PrimaryURL: WebserverIP
,280911 16:38:38,               ,0,0,   SecondaryURL: *****
,280911 16:38:38,               ,0,0,  MaxMessagesUp: 100
,280911 16:38:38,               ,0,0, MaxMessagesDown: 100
,280911 16:38:38,               ,0,0,       WorkPath: c:\dtsv4\working\
,280911 16:38:38,               ,0,0,      ProxyPath:
,280911 16:38:38,               ,0,0,     PollPeriod: 30 (Minutes)
,280911 16:38:38,               ,0,0,    ServerRetry: 25
,280911 16:38:38,               ,0,0,   Log Rollover: Each day
,280911 16:38:38,               ,0,0,    Log Purging: 20 (days)
,280911 16:38:38,               ,0,0, Log File (SSL/xml): c:\dtsv4\log\dts_ssl.log
,280911 16:38:38,               ,0,0, Log File (Client): c:\dtsv4\log\dtsclient.log
,280911 16:38:38,               ,0,0,    Mailbox No:: 1
,280911 16:38:38,               ,0,0, ClientIdentity: DTS
,280911 16:38:38,               ,0,0, ClientAuthentication: *******
,280911 16:38:38,               ,0,0,  InterfaceRoot: c:\dtsv4\
,280911 16:38:38,               ,0,0,  CollectReport: Y
,280911 16:38:38,               ,0,0,    DelayReport: N
,280911 16:38:38,               ,0,0, TransferReport: Y
,280911 16:38:38,               ,0,0,     PollReport: N
,280911 16:38:38,               ,0,0,       SaveSent: N
,280911 16:38:38,               ,0,0, ClientLogLevel: 1
,280911 16:38:38,               ,0,0,        Enabled: Y
DTS,280911 16:38:38,    SERVER poll,1,0, Connecting over primary server.
DTS,280911 16:38:39,    Send FAILED,1,404, HTTP error encountered on DTS handshake.
DTS,280911 16:38:39,       MBX POLL,0,0, Polling mailbox DTS.
DTS,280911 16:38:39,         UPLOAD,0,0, Uploading to mailbox.
DTS,280911 16:38:39,      FILE poll,0,0, Checking for messages to send.
DTS,280911 16:38:39,         Report,0,0, Report file c:\dtsv4\IN\DTSC00000001.ctl created. Event: COLLECT,
DTS,280911 16:38:39,    Send FAILED,1,404, HTTP error encountered on DTS handshake.
DTS,280911 16:38:39,         Report,0,0, Report file c:\dtsv4\IN\DTSC00000002.ctl created. Event: RECEIVE,Receive Poll Error
DTS,280911 16:38:39,DELAYED TRANSFER,0,2, Retry this message later: c:\dtsv4\TEMP\conf1_1_0.ctl, c:\dtsv4\TEMP\conf1_1_0.dat
DTS,280911 16:38:39,      FILE poll,0,0, File poll complete
DTS,280911 16:38:39,       DOWNLOAD,0,0, Downloading from mailbox.
DTS,280911 16:38:39,    SERVER poll,0,0, Polling server for messages.
DTS,280911 16:38:39,      RCV error,404,1, HTTP error encountered with status given.
DTS,280911 16:38:39,    SERVER poll,1,1, Server poll complete
DTS,280911 16:38:39,         Report,0,0, Report file c:\dtsv4\IN\DTSC00000003.ctl created. Event: RECEIVE,Receive Poll Error
DTS,280911 16:38:39,   END MBX POLL,1,1, Mailbox Message Summary: Collected:1, Sent:0, Received:0, Failed:0, Retry:1


-------------------------------------------

yes i m using the correct http link...not example one

One more thing is there any possibilty due to certificate issue this error can be come?
because the current certificate in /usr/share/ssl are not correct?
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
I think JAVA needs the certificate installed in the app/ trusted in the app I guess. Not sure but had one of our apps with this issue and they created their own SSL trusted module in the app
0
 

Author Comment

by:coolcap
Comment Utility
just want to make sure ..do i need to create new one on web server and tomcat server ..or application guy need to do that ..plss explain a bit ..my application guy will come on monday ..so will let u know more about this on monday ..thank you so much ....for ur great help ...if any thing u want to me do in servers i can do ..but for application related need to wait till monday
0
 

Author Comment

by:coolcap
Comment Utility
please let me know how u created that cerificate or what u did for ur apps..many thanks
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
Its all upto App guys now. I am not sure what our apps people have done exactly. And I am not a JAVA expert so cannot help much in that as far as server is concerned you should be good to go. They need to debug their app to make it work.

Good luck
0
 

Author Comment

by:coolcap
Comment Utility
Thank u ...one query..can i check that /dts folder is available from/or on  tomcat server ...so that we can surre of that there is no folder access issue ..?
0
 

Author Closing Comment

by:coolcap
Comment Utility
Thank you so much Its working some how...Really appreciated.

Cheers
0
 
LVL 2

Expert Comment

by:scaryskullz
Comment Utility
you can check /dts is working from tomcat if tomcat has the HTTP container. Look at the docs/ man as somebody has removed HTTP part from your tomcat dont know the reason.

Alternatively
if the /dts is visible from apache that is good enough as that is being served by tomcat.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now