Re: Configuring mod_jk for Apache and Tomcat

2008-02-19 Thread tequnix
Am Tue, 19 Feb 2008 14:33:35 +1000
schrieb Da Rock <[EMAIL PROTECTED]>:


> OK. Tomcat is working- I managed to find out how to get direct access to
> it (had to uncomment a line in server.xml, web.xml). Still  no Apache /
> Tomcat connector though. If I navigate to /webapps it says 404 -
> although this says the error comes from Apache Tomcat6. Is it the
> connector config I need to play with or the Tomcat? In either case, what
> do I need to change?
> 
> I found through a search that older versions of Tomcat need to have a
> listener line in the server.xml. Is this true for Tomcat6?

There are two separate things to do:
 * configure the connector in tomcats server.xml
 * make apache aware of tomcats contexts (how this needs to be done
depends on which connector you use)

here is the relevant snippet from my server.xml (works with tomcat6
and tomcat5.*):
[..]
  
  





  somename
  

   


  
[..]


for the httpd.conf and with mod_jk you need something like that:
[..]
JkMount /a_wepapp/* ajp13
[..]

(if you have mappings in your web.xml. if you want to use the
"invoker" servlet and skip mappings in your web.xml, you may remove the
comments around that part in the tomcat/config/web.xml and use
JkMount /a_wepapp/servlet/* ajp13
instead)

some time ago i switched from mod_jk to apaches proxy_ajp modul (as i
find it easier to maintain), the part for the httpd.conf would look like:

[..]
LoadModule proxy_ajp_module   libexec/apache22/mod_proxy_ajp.so

ProxyPass /a_wepapp   ajp://127.0.0.1:8009/a_wepapp
[..]


HTH,
reinhard
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Configuring mod_jk for Apache and Tomcat

2008-02-18 Thread Da Rock

On Mon, 2008-02-18 at 19:28 -0700, James wrote:
> On Tue, 2008-02-19 at 11:54 +1000, Da Rock wrote:
> > On Mon, 2008-02-18 at 18:07 -0700, James wrote:
> > > On Tue, 2008-02-19 at 10:54 +1000, Da Rock wrote:
> > > > I'm trying to setup a tomcat server using Apache as the frontend. As
> > > > usual, I'm having trouble (which is why I haven't bothered before, and
> > > > given Tomcat apps a wide berth). Can someone let me know where I'm going
> > > > wrong? I have setup inclusions in the httpd.conf file to use similar
> > > > settings to other modules, etc. Therefore my worker.properties and
> > > > mod_jk.conf is under /extras.
> > > > 
> > > > I know something works because they are reflected when I navigate
> > > > to /webapps on the Apache server.
> > > > 
> > > > mod_jk.conf:
> > > > # Replace jsp-hostname with the hostname of your JSP server, as
> > > > # specified in workers.properties.
> > > > #
> > > > 
> > > > JkWorkersFile etc/apache22/extra/workers.properties
> 
> Is this line right? Shouldn't it be /etc/apache22 etc, or am I just
> misthinking?
> 
> 
> 
> > > > JkLogFile  /var/log/jk.log
> > > > JkShmFile  /var/log/jk-runtime-status
> > > > JkLogLevel error
> > > > 
> > > > # Sample JkMounts.  Replace these with the paths you would
> > > > # like to mount from your JSP server.
> > > > JkMount /*.jsp localhost
> > > > JkMount /servlet/* localhost
> > > > JkMount /examples/* localhost
> > > > 
> > > > 
> > > > # Map encoded urls
> > > > 
> > > > SetHandler jakarta-servlet
> > > > 
> > > > 
> > > > # Map subdirectory
> > > > 
> > > > SetHandler jakarta-servlet
> > > > 
> > > > 
> > > > 
> > > > 
> > > > workers.properties:
> > > > # Incredibly simple workers.properties file, intended for connecting
> > > > # to one host, via AJP13.  See the tomcat documentation for
> > > > # information on more exotic configuration options.
> > > > #
> > > > # Change jsp-hostname to the hostname of your JSP server.
> > > > #
> > > > worker.list=localhost
> > > > workers.tomcat_home=/usr/local/apache-tomcat6.0
> > > > workers.java_home=/usr/local/diablo-jdk1.5.0
> > > > worker.localhost.port=8009
> > > > worker.localhost.host=localhost
> > > > worker.localhost.type=ajp13
> > > > worker.localhost.lbfactor=1
> > > > 
> > > > 
> > > > I figured I didn't need to worry about the setenv variable as I'm only
> > > > testing currently and only need one connector atm.
> > > > 
> > > > Any ideas why I shouldn't be seeing the index.jsp found in the Tomcat
> > > > directories?
> > > > 
> > > > I also tried navigating directly using port 8009 with no result either
> > > > (And yes, Tomcat has been started- I checked the port using nmap).
> > > > 
> > > 
> > > 
> > > The two things I always screw up: permissions and DNS. If
> > > your /etc/hosts isn't set up properly, and/or hosts.conf's URL entries
> > > aren't correct, weird weird errors can happen. If something is set to
> > > 444 instead of 755 (as appropriate), other weirdnesses occur.
> > > 
> > > Are you using a www user? Make sure they're added as appropriate for the
> > > file. 
> > > 
> > > I know *none* of this may be helpful, but I always check those and I've
> > > usually screwed one up. Otherwise, is there anything
> > > in /var/log/httpd-error?
> > 
> > You could be right with that, but I think its in my setup somewhere.
> > What shows up if I navigate to /webapps is it recognises Apache-Tomcat
> > but gives me a 404. I can't navigate directly to Tomcat, but I'm not
> > sure I've got it right. 8009 seems to be just for the connector, and
> > 8443 does nothing.
> > 
> > It appears to me that I haven't got a directory on Tomcat setup but I
> > haven't a clue where to set it. Web.xml seems right, but then I'm not
> > sure...
> > 
> 
> 

OK. Tomcat is working- I managed to find out how to get direct access to
it (had to uncomment a line in server.xml, web.xml). Still  no Apache /
Tomcat connector though. If I navigate to /webapps it says 404 -
although this says the error comes from Apache Tomcat6. Is it the
connector config I need to play with or the Tomcat? In either case, what
do I need to change?

I found through a search that older versions of Tomcat need to have a
listener line in the server.xml. Is this true for Tomcat6?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Configuring mod_jk for Apache and Tomcat

2008-02-18 Thread Da Rock
On Mon, 2008-02-18 at 18:07 -0700, James wrote:
> On Tue, 2008-02-19 at 10:54 +1000, Da Rock wrote:
> > I'm trying to setup a tomcat server using Apache as the frontend. As
> > usual, I'm having trouble (which is why I haven't bothered before, and
> > given Tomcat apps a wide berth). Can someone let me know where I'm going
> > wrong? I have setup inclusions in the httpd.conf file to use similar
> > settings to other modules, etc. Therefore my worker.properties and
> > mod_jk.conf is under /extras.
> > 
> > I know something works because they are reflected when I navigate
> > to /webapps on the Apache server.
> > 
> > mod_jk.conf:
> > # Replace jsp-hostname with the hostname of your JSP server, as
> > # specified in workers.properties.
> > #
> > 
> > JkWorkersFile etc/apache22/extra/workers.properties
> > JkLogFile  /var/log/jk.log
> > JkShmFile  /var/log/jk-runtime-status
> > JkLogLevel error
> > 
> > # Sample JkMounts.  Replace these with the paths you would
> > # like to mount from your JSP server.
> > JkMount /*.jsp localhost
> > JkMount /servlet/* localhost
> > JkMount /examples/* localhost
> > 
> > 
> > # Map encoded urls
> > 
> > SetHandler jakarta-servlet
> > 
> > 
> > # Map subdirectory
> > 
> > SetHandler jakarta-servlet
> > 
> > 
> > 
> > 
> > workers.properties:
> > # Incredibly simple workers.properties file, intended for connecting
> > # to one host, via AJP13.  See the tomcat documentation for
> > # information on more exotic configuration options.
> > #
> > # Change jsp-hostname to the hostname of your JSP server.
> > #
> > worker.list=localhost
> > workers.tomcat_home=/usr/local/apache-tomcat6.0
> > workers.java_home=/usr/local/diablo-jdk1.5.0
> > worker.localhost.port=8009
> > worker.localhost.host=localhost
> > worker.localhost.type=ajp13
> > worker.localhost.lbfactor=1
> > 
> > 
> > I figured I didn't need to worry about the setenv variable as I'm only
> > testing currently and only need one connector atm.
> > 
> > Any ideas why I shouldn't be seeing the index.jsp found in the Tomcat
> > directories?
> > 
> > I also tried navigating directly using port 8009 with no result either
> > (And yes, Tomcat has been started- I checked the port using nmap).
> > 
> 
> 
> The two things I always screw up: permissions and DNS. If
> your /etc/hosts isn't set up properly, and/or hosts.conf's URL entries
> aren't correct, weird weird errors can happen. If something is set to
> 444 instead of 755 (as appropriate), other weirdnesses occur.
> 
> Are you using a www user? Make sure they're added as appropriate for the
> file. 
> 
> I know *none* of this may be helpful, but I always check those and I've
> usually screwed one up. Otherwise, is there anything
> in /var/log/httpd-error?

You could be right with that, but I think its in my setup somewhere.
What shows up if I navigate to /webapps is it recognises Apache-Tomcat
but gives me a 404. I can't navigate directly to Tomcat, but I'm not
sure I've got it right. 8009 seems to be just for the connector, and
8443 does nothing.

It appears to me that I haven't got a directory on Tomcat setup but I
haven't a clue where to set it. Web.xml seems right, but then I'm not
sure...

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Configuring mod_jk for Apache and Tomcat

2008-02-18 Thread James

On Tue, 2008-02-19 at 10:54 +1000, Da Rock wrote:
> I'm trying to setup a tomcat server using Apache as the frontend. As
> usual, I'm having trouble (which is why I haven't bothered before, and
> given Tomcat apps a wide berth). Can someone let me know where I'm going
> wrong? I have setup inclusions in the httpd.conf file to use similar
> settings to other modules, etc. Therefore my worker.properties and
> mod_jk.conf is under /extras.
> 
> I know something works because they are reflected when I navigate
> to /webapps on the Apache server.
> 
> mod_jk.conf:
> # Replace jsp-hostname with the hostname of your JSP server, as
> # specified in workers.properties.
> #
> 
> JkWorkersFile etc/apache22/extra/workers.properties
> JkLogFile  /var/log/jk.log
> JkShmFile  /var/log/jk-runtime-status
> JkLogLevel error
> 
> # Sample JkMounts.  Replace these with the paths you would
> # like to mount from your JSP server.
> JkMount /*.jsp localhost
> JkMount /servlet/* localhost
> JkMount /examples/* localhost
> 
> 
> # Map encoded urls
> 
> SetHandler jakarta-servlet
> 
> 
> # Map subdirectory
> 
> SetHandler jakarta-servlet
> 
> 
> 
> 
> workers.properties:
> # Incredibly simple workers.properties file, intended for connecting
> # to one host, via AJP13.  See the tomcat documentation for
> # information on more exotic configuration options.
> #
> # Change jsp-hostname to the hostname of your JSP server.
> #
> worker.list=localhost
> workers.tomcat_home=/usr/local/apache-tomcat6.0
> workers.java_home=/usr/local/diablo-jdk1.5.0
> worker.localhost.port=8009
> worker.localhost.host=localhost
> worker.localhost.type=ajp13
> worker.localhost.lbfactor=1
> 
> 
> I figured I didn't need to worry about the setenv variable as I'm only
> testing currently and only need one connector atm.
> 
> Any ideas why I shouldn't be seeing the index.jsp found in the Tomcat
> directories?
> 
> I also tried navigating directly using port 8009 with no result either
> (And yes, Tomcat has been started- I checked the port using nmap).
> 


The two things I always screw up: permissions and DNS. If
your /etc/hosts isn't set up properly, and/or hosts.conf's URL entries
aren't correct, weird weird errors can happen. If something is set to
444 instead of 755 (as appropriate), other weirdnesses occur.

Are you using a www user? Make sure they're added as appropriate for the
file. 

I know *none* of this may be helpful, but I always check those and I've
usually screwed one up. Otherwise, is there anything
in /var/log/httpd-error?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Configuring mod_jk for Apache and Tomcat

2008-02-18 Thread Da Rock
I'm trying to setup a tomcat server using Apache as the frontend. As
usual, I'm having trouble (which is why I haven't bothered before, and
given Tomcat apps a wide berth). Can someone let me know where I'm going
wrong? I have setup inclusions in the httpd.conf file to use similar
settings to other modules, etc. Therefore my worker.properties and
mod_jk.conf is under /extras.

I know something works because they are reflected when I navigate
to /webapps on the Apache server.

mod_jk.conf:
# Replace jsp-hostname with the hostname of your JSP server, as
# specified in workers.properties.
#

JkWorkersFile etc/apache22/extra/workers.properties
JkLogFile  /var/log/jk.log
JkShmFile  /var/log/jk-runtime-status
JkLogLevel error

# Sample JkMounts.  Replace these with the paths you would
# like to mount from your JSP server.
JkMount /*.jsp localhost
JkMount /servlet/* localhost
JkMount /examples/* localhost


# Map encoded urls

SetHandler jakarta-servlet


# Map subdirectory

SetHandler jakarta-servlet




workers.properties:
# Incredibly simple workers.properties file, intended for connecting
# to one host, via AJP13.  See the tomcat documentation for
# information on more exotic configuration options.
#
# Change jsp-hostname to the hostname of your JSP server.
#
worker.list=localhost
workers.tomcat_home=/usr/local/apache-tomcat6.0
workers.java_home=/usr/local/diablo-jdk1.5.0
worker.localhost.port=8009
worker.localhost.host=localhost
worker.localhost.type=ajp13
worker.localhost.lbfactor=1


I figured I didn't need to worry about the setenv variable as I'm only
testing currently and only need one connector atm.

Any ideas why I shouldn't be seeing the index.jsp found in the Tomcat
directories?

I also tried navigating directly using port 8009 with no result either
(And yes, Tomcat has been started- I checked the port using nmap).

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"