Hi André and Juha,

I edit my tomcat server.xml as describe. my tomcat and apache listed that
the connector is started as in the log.
But when i access (http://192.168.1.68/examples/index.html) with IE, "The
webpage cannot be found" error is displayed.
When i access "http://192.168.1.68:8080/examples/index.html";, the page can
be display.
This tally with the error apache display in the log "error.log". But in the
same log it says that mod_jk configured and resuming normal operation.
There is a "Jk running ID=0 time=0/18  config=null" message when tomcat
start. I don't really understand what it is.
Hope to hear from you soon.
Log and config as below.

Thanks and Best Regard
Jie Sheng

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*apache2: error.log*

[Sun May 02 23:02:33 2010] [notice] Apache/2.2.14 (Ubuntu) mod_jk/1.2.28
configured -- resuming normal operations
[Sun May 02 23:04:27 2010] [error] [client 192.168.1.66] File does not
exist: /var/www/examples

*apache2: access.log*

192.168.1.66 - - [02/May/2010:23:04:27 +0800] "GET /examples/index.html
HTTP/1.1" 404 510 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Tri$

*apache2: mod_jk.log*

[Sun May 02 23:02:33 2010] [1593:4161124160] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized
[Sun May 02 23:02:33 2010] [1594:4161124160] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized

*tomcat6: catalina.out*

May 2, 2010 11:02:19 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: $
May 2, 2010 11:02:19 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 2, 2010 11:02:19 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 605 ms
May 2, 2010 11:02:20 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 2, 2010 11:02:20 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor manager.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor examples.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
May 2, 2010 11:02:20 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
May 2, 2010 11:02:20 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
*May 2, 2010 11:02:20 PM org.apache.jk.server.JkMain start*
*INFO: Jk running ID=0 time=0/18  config=null*
May 2, 2010 11:02:20 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 571 ms

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

*apache2: workers.properties*

# Define 1 real worker using ajp13
worker.list=tomcat1

# Set properties for worker1 (ajp13)
worker.tomcat1.type=ajp13
worker.tomcat1.host=localhost
worker.tomcat1.port=8009

*apache2: httpd.conf*

# Load mod_jk module
# Update this path to match your modules location
LoadModule    jk_module  /usr/lib/apache2/modules/mod_jk.so

# Declare the module for <IfModule directive> (remove this line on Apache
2.x)
# AddModule     mod_jk.c

# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties

# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile     /var/log/apache2/mod_jk.shm

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile     /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel    info

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* tomcat1
JkMount  /examples tomcat1

*tomcat6: server.xml*

<?xml version='1.0' encoding='utf-8'?>

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

  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <GlobalNamingResources>

    <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="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               URIEncoding="UTF-8"
               redirectPort="8443" />

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
      </Host>
    </Engine>
  </Service>
</Server>

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

On Sun, May 2, 2010 at 6:14 PM, André Warnier <a...@ice-sa.com> wrote:

> Jie Sheng Chua wrote:
>
>> Hi,
>>
>> I operating Ubuntu 10.04 with Tomcat 6.0.24 on OpenJDK 6b18-1.8.
>> I trying to configure tomcat connector to allow (for now) all request to
>> be
>> pass from Apache 2.2 to Tomcat 6.
>> I downloaded mod_jk-1.2.28-httpd-2.2.X.so<
>> http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/x86_64/mod_jk-1.2.28-httpd-2.2.X.so
>> >
>>
>> .
>> With the help of the quick start
>> guide<http://tomcat.apache.org/connectors-doc/generic_howto/quick.html>,
>> i manage to configure my workers.properties, httpd.conf and tomcat
>> server.xml as follows.
>>
>> After the below configuration, the connector didn't work. There are no
>> error
>> display on the logs too.
>>
>
> Can you define "didn't work" ?
>
>
>  Example context from tomcat is the tomcat supplied examples.
>>
>> Does anyone know how to make this work out?
>>
>> Thanks and Best Regards
>> Jie Sheng
>>
>> *workers.properties*
>> *
>> *
>> *
>> # Define 1 real worker using ajp13
>> worker.list=tomcat1
>>
>> # Set properties for worker1 (ajp13)
>> worker.tomcat1.type=ajp13
>> worker.tomcat1.host=localhost
>> worker.tomcat1.port=8009
>> *
>>
>>
> Looks fine.
>
>
>  *httpd.conf*
>>
>>
>> # Load mod_jk module
>> # Update this path to match your modules location
>> LoadModule    jk_module  /usr/lib/apache2/modules/mod_jk.so
>>
>>
> Looks fine, if the module is there.  But otherwise I guess Apache would not
> start.
>
>
>
>  # Declare the module for <IfModule directive> (remove this line on Apache
>> 2.x)
>> # AddModule     mod_jk.c
>>
>> # Where to find workers.properties
>> # Update this path to match your conf directory location (put
>> workers.properties next to httpd.conf)
>> JkWorkersFile /etc/apache2/workers.properties
>>
>> # Where to put jk shared memory
>> # Update this path to match your local state directory or logs directory
>> JkShmFile     /var/log/apache2/mod_jk.shm
>>
>> # Where to put jk logs
>> # Update this path to match your logs directory location (put mod_jk.log
>> next to access_log)
>> JkLogFile     /var/log/apache2/mod_jk.log
>>
>> # Set the jk log level [debug/error/info]
>> JkLogLevel    info
>>
>> # Select the timestamp log format
>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>
>> # Send everything for context /examples to worker named worker1 (ajp13)
>> JkMount  /examples/* tomcat1
>>
>>
> Note that the above will ONLY forward to the connector and Tomcat, requests
> for URLs which match the above pattern, like
> /examples/something.html
> It will not forward the URL
> /examples
> For that, you would need a second JkMount
> JkMount  /examples  tomcat1
>
> Also see note (1) below.
>
>  *tomcat server.xml*
>>
>> *
>> *
>> *
>> <?xml version='1.0' encoding='utf-8'?>
>> <Server port="8005" shutdown="SHUTDOWN">
>>  <Listener className="org.apache.catalina.core.AprLifecycleListener"
>> SSLEngine="on" />
>>  <Listener className="org.apache.catalina.core.JasperListener" />
>>  <Listener
>> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
>>  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
>> />
>>  <Listener
>> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>>
>
> I believe your problem is here :
>
>
>   <Listener className="org.apache.jk.config.ApacheConfig"
>> modJk="/usr/lib/apache2/modules/mod_jk.so" />
>>
>>
> Remove the above and try again.
>
> I believe that you tried to mix two different techniques :
> - trying to use the "Tomcat auto-configure" feature of mod_jk
> and
> - configuring mod_jk yourself
>
> I think that the two do not play well together.
> And anyway :
> - I am not sure that the auto-configure feature still works
> - the documentation also says that it is specific to Tomcat 5.x
>
>
>
>   <GlobalNamingResources>
>>    <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">
>>    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
>>        maxThreads="150" minSpareThreads="4"/>
>>    <Connector port="8080" protocol="HTTP/1.1"
>>               connectionTimeout="20000"
>>               URIEncoding="UTF-8"
>>               redirectPort="8443" />
>>
>
>
>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>>
>
> The above is OK, leave it.
>
>
>     <Engine name="Catalina" defaultHost="localhost">
>>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>             resourceName="UserDatabase"/>
>>      <Host name="localhost"  appBase="webapps"
>>            unpackWARs="true" autoDeploy="true"
>>            xmlValidation="false" xmlNamespaceAware="false">
>>      </Host>
>>    </Engine>
>>  </Service>
>> </Server>
>>
>> *
>>
>>
>
> Note (1) :
> As an alternative to the JkMount/JkUnMount directives, there also exists
> the following (in the Apache httpd.conf) :
>
> <Location /examples>
>  SetHandler jakarta-servlet
>  ...
>
> </Location>
>
> (You can also use <LocationMatch> instead of <Location>)
>
> This is described here :
> http://tomcat.apache.org/connectors-doc/reference/apache.html
> , at the very end of the page, in the section "Using SetHandler and
> Environment Variables".
> Using this or the JkMount/JkUnMount syntax is a question of personal
> preference. I prefer this second form, because I find that it matches the
> general Apache configuration style better.  It also makes it easier to add
> additional Apache directives to be applied to the URLs which you forward to
> Tomcat.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Jie Sheng, Chua
(+65) 97520245
chuajiesh...@gmail.com

The contents of this email are confidential to the intended recipient and
may not be disclosed. Although it is believed that this email and any
attachments are virus free, it is the responsibility of the recipient to
confirm this.

Reply via email to