You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ian Caswell <sw...@yahoo.com> on 2006/07/26 21:03:36 UTC

apache not talking to tomcat w/ mod_jk

I'm an OS guy, so applications are new to me.
Any help is appreciated.

I'm trying to integrate apache and tomcat w/ mod_jk.
Regular html pages show up fine, but jsp pages do not.
I don't think apache is talking to tomcat like it
should.
I'm not sure where the problem lies; netstat -an shows
tomcat listening on 8009, but apache isn't connected.
Can anyone help me find my issue?  Firewall is
disabled, and /etc/hosts.allow and .deny are 
empty.  My hunch is an incorrect config file.

Note:  my real hostname/domain has been replaced by
myhost.mydomain to provide security and not confuse
where i have localhost.localdomain in the configs.

I've looked at following logs, but not found anything
suspicious.
/opt/tomcat/logs/*
/etc/httpd/logs/*
/home/tomcat/myhost.mydomain/broomfield/logs/*

(irrelevant ports removed)
Proto Recv-Q Send-Q Local Address  Foreign Address 
State
tcp   0  0  ::ffff:127.0.0.1:8005     :::*    LISTEN
tcp   0  0  :::8009                   :::*    LISTEN
tcp   0  0  :::80                     :::*    LISTEN

Setup:
RHAS 4
apache 2.0.52-22 (redhat rpm)
ibm-java2-i386-sdk-5.0-2.0 (ibm rpm)
tomcat 5.5.17 (built from src)
mod_jk 1.2.15 (built from src)

[root@myhost conf]# cat /opt/tomcat/conf/server.xml
<Server port="8005"
shutdown="5a7cf4f5bbd68235250d76adf2b836f7">

 <GlobalNamingResources>
   <!-- Used by Manager webapp -->
   <Resource name="UserDatabase" auth="Container"
             type="org.apache.catalina.UserDatabase"
      description="User database that can be updated
and saved"
         
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
         pathname="conf/tomcat-users.xml" />
 </GlobalNamingResources>

 <Service name="Catalina">
   <Connector port="8009"
       enableLookups="false"
       redirectPort="8443"
       protocol="AJP/1.3" />

   <Engine name="Catalina" defaultHost="localhost">
     <Realm
className="org.apache.catalina.realm.UserDatabaseRealm"
            resourceName="UserDatabase" />
     <Host name="localhost"
appBase="/home/tomcat/webapps" />
   </Engine>

 </Service>
</Server>



[root@overkill conf]# cat
/etc/httpd/conf.d/mod_jk.conf
JkWorkersFile "/etc/httpd/conf/workers.properties"
JkLogFile "/etc/httpd/logs/mod_jk.log"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"


[root@overkill conf]# cat
/etc/httpd/conf/workers.properties
# workers.properties - ajp13
workers.tomcat_home=/opt/tomcat
workers.java_home=/opt/ibm/java2-i386-50
ps=/
#
# List workers
worker.list=wrkr
#
# Define wrkr
worker.wrkr.port=8009
worker.wrkr.host=127.0.0.1
worker.wrkr.type=ajp13
worker.wrkr.cachesize=10
worker.wrkr.cache_timeout=600
worker.wrkr.socket_timeout=300

[root@myhost conf]# cat /etc/hosts
127.0.0.1               localhost.localdomain
localhost
192.168.1.10            myhost.mydomain  myhost

##Relevant entries from /etc/httpd/conf/httpd.conf
LoadModule jk_module modules/mod_jk.so
Include conf.d/*.conf
NameVirtualHost 192.168.1.10:80

<VirtualHost 192.168.1.10:80>
       ServerAdmin webmaster@myhost.mydomain
       ServerName myhost.mydomain
       DocumentRoot
/home/tomcat/webapps/myhost.mydomain/broomfield
       ErrorLog
/home/tomcat/webapps/myhost.mydomain/logs/error_log
       CustomLog
/home/tomcat/webapps/myhost.mydomain/logs/access_log
common
       JkMount /*.jsp wrkr
       JkMount /servlet/* wrkr
       # Deny direct access to WEB-INF
       <LocationMatch ".*WEB-INF.*">
               AllowOverride None
               deny from all
       </LocationMatch>
</VirtualHost>



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apache not talking to tomcat w/ mod_jk

Posted by Hassan Schroeder <ha...@gmail.com>.
On 7/26/06, Ian Caswell <sw...@yahoo.com> wrote:

> ...................................., but i don't know how to
> verify it's loaded.  Is there a way for apache
> to show loaded modules?

$APACHE_HOME/bin/apachectl -M

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apache not talking to tomcat w/ mod_jk

Posted by Kim Albee <mt...@gmail.com>.
have you looked in the mod_jk.log?  is it getting created, and is it saying
anything?  you can set the debug level to 4 in the workers.properties file
and then see what it's saying about connecting to tomcat.

Kim :-)

On 7/26/06, Ian Caswell <sw...@yahoo.com> wrote:
>
> It's in httpd.conf, and i don't see any errors in
> the httpd logs about it, but i don't know how to
> verify it's loaded.  Is there a way for apache
> to show loaded modules?
>
> --- Kim Albee <mt...@gmail.com> wrote:
>
> > probably something you've made sure to do, but are
> > you loading mod_jk.so in
> > the httpd.conf?
> >
> > Kim :-)
> >
> > On 7/26/06, Ian Caswell <sw...@yahoo.com> wrote:
> > >
> > > ##Relevant entries from /etc/httpd/conf/httpd.conf
> > > LoadModule jk_module modules/mod_jk.so
> > > Include conf.d/*.conf
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: apache not talking to tomcat w/ mod_jk

Posted by David Smith <dn...@cornell.edu>.
I got the impression (and I could be wrong here) early on in this thread 
you may have dropped your jsp in the apache httpd docroot and tried it 
there.  This isn't mod_perl or one of those other modules that allow 
files to sit directly in the apache docroot or one of it's folders.

If this is the case, move your jsp to a location in webapps/ROOT of 
tomcat and try it again.

--David

Ian Caswell wrote:

>I set mod_jk to log level debug, and saw it was 
>telling apache "2No.Host.matches.server.name".
>Did some googling, and some sites say it's a
>permissions issue, but my startup script chowns
>everything to "tomcat"
>One page i found said it may be there's no default
>context in server.xml.
>(http://www.palbrattberg.com/?p=69#comments)
>I added a <Context> under my <Host> section,
>and now I see apache and tomcat talking in
>netstat -an.  YAY!
>
>However, still having issues, now instead of a blank
>page, I get tomcat's 404 page when i try to load the
>test HelloWorld.jsp.  I think I'm getting close, I
>will turn on debug for tomcat and look for issues.
>
>If anyone has suggestions, pls let me know.
>
>--- John Kojo Ampia - Addison <jo...@jojoaddison.net>
>wrote:
>
>  
>
>>have you added an Include line to the auto folder of
>>the tomcat conf 
>>directory?
>>If so then check your tomcat logs for error
>>messages...
>>If there aren't any introduce some intentional
>>errors and see if 
>>server.xml and httpd.conf are being loaded at all.
>>Then check with all the available logs...
>>    
>>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apache not talking to tomcat w/ mod_jk

Posted by Nikola Milutinovic <al...@yahoo.com>.
> I set mod_jk to log level debug, and saw it was 
> telling apache "2No.Host.matches.server.name".

This simply means that Apache is accepting a request for one Virtual Host an that host is not configured in TC. This issue can be as trivial as not defining the actual hostname as a <Host> element in your TC server.xml

Read TC docs, pay attention to the <Host> tag. It is used to define as many virtual hosts as you like. The thing is, the virtual host in Apache, *which is going to forward requests to TC*, MUST exist in TC, as well.

It is as simple as that.

Nix.




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apache not talking to tomcat w/ mod_jk

Posted by Ian Caswell <sw...@yahoo.com>.
I set mod_jk to log level debug, and saw it was 
telling apache "2No.Host.matches.server.name".
Did some googling, and some sites say it's a
permissions issue, but my startup script chowns
everything to "tomcat"
One page i found said it may be there's no default
context in server.xml.
(http://www.palbrattberg.com/?p=69#comments)
I added a <Context> under my <Host> section,
and now I see apache and tomcat talking in
netstat -an.  YAY!

However, still having issues, now instead of a blank
page, I get tomcat's 404 page when i try to load the
test HelloWorld.jsp.  I think I'm getting close, I
will turn on debug for tomcat and look for issues.

If anyone has suggestions, pls let me know.

--- John Kojo Ampia - Addison <jo...@jojoaddison.net>
wrote:

> 
> have you added an Include line to the auto folder of
> the tomcat conf 
> directory?
> If so then check your tomcat logs for error
> messages...
> If there aren't any introduce some intentional
> errors and see if 
> server.xml and httpd.conf are being loaded at all.
> Then check with all the available logs...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apache not talking to tomcat w/ mod_jk

Posted by John Kojo Ampia - Addison <jo...@jojoaddison.net>.
have you added an Include line to the auto folder of the tomcat conf 
directory?
If so then check your tomcat logs for error messages...
If there aren't any introduce some intentional errors and see if 
server.xml and httpd.conf are being loaded at all.
Then check with all the available logs...
> It's in httpd.conf, and i don't see any errors in
> the httpd logs about it, but i don't know how to
> verify it's loaded.  Is there a way for apache
> to show loaded modules?
>
> --- Kim Albee <mt...@gmail.com> wrote:
>
>   
>> probably something you've made sure to do, but are
>> you loading mod_jk.so in
>> the httpd.conf?
>>
>> Kim :-)
>>
>> On 7/26/06, Ian Caswell <sw...@yahoo.com> wrote:
>>     
>>> ##Relevant entries from /etc/httpd/conf/httpd.conf
>>> LoadModule jk_module modules/mod_jk.so
>>> Include conf.d/*.conf
>>>       
>
>   



-- 


Re: apache not talking to tomcat w/ mod_jk

Posted by Ian Caswell <sw...@yahoo.com>.
It's in httpd.conf, and i don't see any errors in
the httpd logs about it, but i don't know how to
verify it's loaded.  Is there a way for apache
to show loaded modules?

--- Kim Albee <mt...@gmail.com> wrote:

> probably something you've made sure to do, but are
> you loading mod_jk.so in
> the httpd.conf?
> 
> Kim :-)
> 
> On 7/26/06, Ian Caswell <sw...@yahoo.com> wrote:
> >
> > ##Relevant entries from /etc/httpd/conf/httpd.conf
> > LoadModule jk_module modules/mod_jk.so
> > Include conf.d/*.conf



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: apache not talking to tomcat w/ mod_jk

Posted by Kim Albee <mt...@gmail.com>.
probably something you've made sure to do, but are you loading mod_jk.so in
the httpd.conf?

Kim :-)

On 7/26/06, Ian Caswell <sw...@yahoo.com> wrote:
>
> I'm an OS guy, so applications are new to me.
> Any help is appreciated.
>
> I'm trying to integrate apache and tomcat w/ mod_jk.
> Regular html pages show up fine, but jsp pages do not.
> I don't think apache is talking to tomcat like it
> should.
> I'm not sure where the problem lies; netstat -an shows
> tomcat listening on 8009, but apache isn't connected.
> Can anyone help me find my issue?  Firewall is
> disabled, and /etc/hosts.allow and .deny are
> empty.  My hunch is an incorrect config file.
>
> Note:  my real hostname/domain has been replaced by
> myhost.mydomain to provide security and not confuse
> where i have localhost.localdomain in the configs.
>
> I've looked at following logs, but not found anything
> suspicious.
> /opt/tomcat/logs/*
> /etc/httpd/logs/*
> /home/tomcat/myhost.mydomain/broomfield/logs/*
>
> (irrelevant ports removed)
> Proto Recv-Q Send-Q Local Address  Foreign Address
> State
> tcp   0  0  ::ffff:127.0.0.1:8005     :::*    LISTEN
> tcp   0  0  :::8009                   :::*    LISTEN
> tcp   0  0  :::80                     :::*    LISTEN
>
> Setup:
> RHAS 4
> apache 2.0.52-22 (redhat rpm)
> ibm-java2-i386-sdk-5.0-2.0 (ibm rpm)
> tomcat 5.5.17 (built from src)
> mod_jk 1.2.15 (built from src)
>
> [root@myhost conf]# cat /opt/tomcat/conf/server.xml
> <Server port="8005"
> shutdown="5a7cf4f5bbd68235250d76adf2b836f7">
>
> <GlobalNamingResources>
>    <!-- Used by Manager webapp -->
>    <Resource name="UserDatabase" auth="Container"
>              type="org.apache.catalina.UserDatabase"
>       description="User database that can be updated
> and saved"
>
> factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>          pathname="conf/tomcat-users.xml" />
> </GlobalNamingResources>
>
> <Service name="Catalina">
>    <Connector port="8009"
>        enableLookups="false"
>        redirectPort="8443"
>        protocol="AJP/1.3" />
>
>    <Engine name="Catalina" defaultHost="localhost">
>      <Realm
> className="org.apache.catalina.realm.UserDatabaseRealm"
>             resourceName="UserDatabase" />
>      <Host name="localhost"
> appBase="/home/tomcat/webapps" />
>    </Engine>
>
> </Service>
> </Server>
>
>
>
> [root@overkill conf]# cat
> /etc/httpd/conf.d/mod_jk.conf
> JkWorkersFile "/etc/httpd/conf/workers.properties"
> JkLogFile "/etc/httpd/logs/mod_jk.log"
> JkLogLevel info
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
>
>
> [root@overkill conf]# cat
> /etc/httpd/conf/workers.properties
> # workers.properties - ajp13
> workers.tomcat_home=/opt/tomcat
> workers.java_home=/opt/ibm/java2-i386-50
> ps=/
> #
> # List workers
> worker.list=wrkr
> #
> # Define wrkr
> worker.wrkr.port=8009
> worker.wrkr.host=127.0.0.1
> worker.wrkr.type=ajp13
> worker.wrkr.cachesize=10
> worker.wrkr.cache_timeout=600
> worker.wrkr.socket_timeout=300
>
> [root@myhost conf]# cat /etc/hosts
> 127.0.0.1               localhost.localdomain
> localhost
> 192.168.1.10            myhost.mydomain  myhost
>
> ##Relevant entries from /etc/httpd/conf/httpd.conf
> LoadModule jk_module modules/mod_jk.so
> Include conf.d/*.conf
> NameVirtualHost 192.168.1.10:80
>
> <VirtualHost 192.168.1.10:80>
>        ServerAdmin webmaster@myhost.mydomain
>        ServerName myhost.mydomain
>        DocumentRoot
> /home/tomcat/webapps/myhost.mydomain/broomfield
>        ErrorLog
> /home/tomcat/webapps/myhost.mydomain/logs/error_log
>        CustomLog
> /home/tomcat/webapps/myhost.mydomain/logs/access_log
> common
>        JkMount /*.jsp wrkr
>        JkMount /servlet/* wrkr
>        # Deny direct access to WEB-INF
>        <LocationMatch ".*WEB-INF.*">
>                AllowOverride None
>                deny from all
>        </LocationMatch>
> </VirtualHost>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>