Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I work under Ubuntu I installed apache2, and want to link it with tomcat, through mod_jk apache2 is based on port 80 Tomcat is based on port 8080 Tomcat should be linked under www.mysite.com/TestTomcat apache2 works fine (www.mysite.com says, no problem) tomcat works fine (www.mysite.com:8080 says, no problem) but when I launch www.mysite.com/TestTomcat, I got an 500 Internal Server error. Exact error message is not really explicit :

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

I checked error.log of apache, it is empty. I have no idea, how to solve it. Thanks for your help

workers.properties :

    # workers.properties -

> #
> # This file is a simplified version of the workers.properties supplied
> # with the upstream sources. The jni inprocess worker (not build in the
> # debian package) section and the ajp12 (deprecated) section are removed.
> #
> # As a general note, the characters $( and ) are used internally to define
> # macros. Do not use them in your own configuration!!!
> #
> # Whenever you see a set of lines such as:
> # x=value
> # y=$(x)\something
> #
> # the final value for y will be value\something
> #
> # Normaly all you will need to do is un-comment and modify the first three
> # properties, i.e. workers.tomcat_home, workers.java_home and ps.
> # Most of the configuration is derived from these.
> #
> # When you are done updating workers.tomcat_home, workers.java_home and ps
> # you should have 3 workers configured:
> #
> # - An ajp13 worker that connects to localhost:8009
> # - A load balancer worker
> #
> #
> 
> # OPTIONS ( very important for jni mode ) 
> 
> #
> # workers.tomcat_home should point to the location where you
> # installed tomcat. This is where you have your conf, webapps and lib
> # directories.
> # workers.tomcat_home=/var/lib/tomcat_test
> 
> #
> # workers.java_home should point to your Java installation. Normally
> # you should have a bin and lib directories beneath it.
> # workers.java_home=/usr/lib/jvm/default-java
> 
> #
> # You should configure your environment slash... ps=\ on NT and / on UNIX
> # and maybe something different elsewhere.
> # ps=/
> 
> #
> #------ ADVANCED MODE ------------------------------------------------
> #---------------------------------------------------------------------
> #
> 
> #
> #------ worker list ------------------------------------------
> #---------------------------------------------------------------------
> #
> #
> # The workers that your plugins should create and work with
> #  worker.list=ajp13_worker
> 
> #
> #------ ajp13_worker WORKER DEFINITION ------------------------------
> #---------------------------------------------------------------------
> #
> 
> #
> # Defining a worker named ajp13_worker and of type ajp13
> # Note that the name and the type do not have to match.
> # worker.ajp13_worker.port=8009 worker.ajp13_worker.host=localhost worker.ajp13_worker.type=ajp13
> #
> # Specifies the load balance factor when used with
> # a load balancing worker.
> # Note:
> #  ----> lbfactor must be > 0
> #  ----> Low lbfactor means less work done by the worker. worker.ajp13_worker.lbfactor=1
> 
> #
> # Specify the size of the open connection cache.
> #worker.ajp13_worker.cachesize
> 
> #
> #------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
> #---------------------------------------------------------------------
> #
> 
> #
> # The loadbalancer (type lb) workers perform wighted round-robin
> # load balancing with sticky sessions.
> # Note:
> #  ----> If a worker dies, the load balancer will check its state
> #        once in a while. Until then all work is redirected to peer
> #        workers. worker.loadbalancer.type=lb 
> worker.loadbalancer.balance_workers=ajp13_worker

jk.conf :

> # Licensed to the Apache Software Foundation (ASF) under one or more
> # contributor license agreements.  See the NOTICE file distributed with
> # this work for additional information regarding copyright ownership.
> # The ASF licenses this file to You under the Apache License, Version 2.0
> # (the "License"); you may not use this file except in compliance with
> # the License.  You may obtain a copy of the License at
> #
> #     http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
> 
> # Configuration Example for mod_jk
> # used in combination with Apache 2.2.x
> 
> <IfModule jk_module>
> 
>     # We need a workers file exactly once
>     # and in the global server
>     JkWorkersFile /etc/libapache2-mod-jk/workers.properties
> 
>     # Our JK error log
>     # You can (and should) use rotatelogs here
>     JkLogFile /var/log/apache2/mod_jk.log
> 
>     # Our JK log level (trace,debug,info,warn,error)
>     JkLogLevel info
> 
>     # Our JK shared memory file
>     JkShmFile /var/log/apache2/jk-runtime-status
> 
>     # Define a new log format you can use in any CustomLog in order
>     # to add mod_jk specific information to your access log.
>     # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\" \"%{Set-Cookie}o\" %{pid}P %{tid}P
> %{JK_LB_FIRST_NAME}n %{JK_LB_LAST_NAME}n ACC %{JK_LB_LAST_ACCESSED}n
> ERR %{JK_LB_LAST_ERRORS}n BSY %{JK_LB_LAST_BUSY}n %{JK_LB_LAST_STATE}n
> %D" extended_jk
> 
>     # This option will reject all requests, which contain an
>     # encoded percent sign (%25) or backslash (%5C) in the URL
>     # If you are sure, that your webapp doesn't use such
>     # URLs, enable the option to prevent double encoding attacks.
>     # Since: 1.2.24
>     # JkOptions +RejectUnsafeURI
> 
>     # After setting JkStripSession to "On", mod_jk will
>     # strip all ";jsessionid=..." from request URLs it
>     # does *not* forward to a backend.
>     # This is useful, if all links in a webapp use
>     # URLencoded session IDs and parts of the static
>     # content should be delivered directly by Apache.
>     # Of course you can also do it with mod_rewrite.
>     # Since: 1.2.21
>     # JkStripSession On
> 
>     # Start a separate thread for internal tasks like
>     # idle connection probing, connection pool resizing
>     # and load value decay.
>     # Run these tasks every JkWatchdogInterval seconds.
>     # Since: 1.2.27
>     JkWatchdogInterval 60
> 
>     # Configure access to jk-status and jk-manager
>     # If you want to make this available in a virtual host,
>     # either move this block into the virtual host
>     # or copy it logically there by including "JkMountCopy On"
>     # in the virtual host.
>     # Add an appropriate authentication method here!
>     <Location /jk-status>
>         # Inside Location we can omit the URL in JkMount
>         JkMount jk-status
>         Order deny,allow
>         Deny from all
>         Allow from 127.0.0.1
>     </Location>
>     <Location /jk-manager>
>         # Inside Location we can omit the URL in JkMount
>         JkMount jk-manager
>         Order deny,allow
>         Deny from all
>         Allow from 127.0.0.1
>     </Location>
> 
>     # If you want to put all mounts into an external file
>     # that gets reloaded automatically after changes
>     # (with a default latency of 1 minute),
>     # you can define the name of the file here.
>     # JkMountFile conf/extra/uriworkermap.properties
> 
>     # Example for Mounting a context to the worker "balancer"
>     # The URL syntax "a|b" instantiates two mounts at once,
>     # the first one is "a", the second one is "ab".
>     # JkMount /myapp|/* balancer
> 
>     # Example for UnMounting requests for all workers
>     # using a simple URL pattern
>     # Since: 1.2.26
>     # JkUnMount /myapp/static/* *
> 
>     # Example for UnMounting requests for a named worker
>     # JkUnMount /myapp/images/* balancer
> 
>     # Example for UnMounting requests using regexps
>     # SetEnvIf REQUEST_URI "\.(htm|html|css|gif|jpg|js)$" no-jk
> 
>     # Example for setting a reply timeout depending on the request URL
>     # Since: 1.2.27
>     # SetEnvIf Request_URI "/transactions/" JK_REPLY_TIMEOUT=600000
> 
>     # Example for disabling reply timeouts for certain request URLs
>     # Since: 1.2.27
>     # SetEnvIf Request_URI "/reports/" JK_REPLY_TIMEOUT=0
> 
>     # IMPORTANT: Mounts and virtual hosts
>     # If you are using VirtualHost elements, you
>     # - can put mounts only used in some virtual host into its VirtualHost element 
>     # - can copy all global mounts to it using "JkMountCopy On" inside the VirtualHost
>     # - can copy all global mounts to all virtual hosts by putting
>     #   "JkMountCopy All" into the global server
>     # Since: 1.2.26
> 
> </IfModule>

I reinstalled everything, and this time, I have a log in module_jk :

[Fri Jul 04 09:36:20.509 2014] [25262:140008951789440] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing.

[Fri Jul 04 09:36:20.5092014] [25262:140008951789440] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing.

I checked, and found that this could be a problem of hidden chars in my file workers.properties. But I read it in notepad++, with "show all characters" activated, and found nothing suspicious.

Shoud I delete/comment lines about jk_status and jk_manager in jk.conf? Thanks

share|improve this question
1  
And your mod_jk configuration is ... ? –  Mark Thomas Jul 3 at 19:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.