Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Apache Httpd AND apache Tomcat with mod_jk The requested URL /examples/ was not found on this server

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to configure mod_jk.so on Windows XP. I have done all necessary steps. Both services start properly. But when accessing http://localhost/examples/ it's showing (The requested URL /examples/ was not found on this server)

from_apache_mod_jk :-

[Tue Apr 28 18:10:08 2015][4040:2552] [warn] jk_map.c (410): The attribute 'worker.inprocess.class_path' is deprecated - please check the documentation for the correct replacement.
[Tue Apr 28 18:10:08 2015][4040:2552] [warn] jk_map.c (410): The attribute 'worker.inprocess.cmd_line' is deprecated - please check the documentation for the correct replacement.
[Tue Apr 28 18:10:08 2015][4040:2552] [warn] jk_map.c (410): The attribute 'worker.inprocess.jvm_lib' is deprecated - please check the documentation for the correct replacement.
[Tue Apr 28 18:10:08 2015][4040:2552] [warn] jk_map.c (410): The attribute 'worker.inprocess.stdout' is deprecated - please check the documentation for the correct replacement.
[Tue Apr 28 18:10:08 2015][4040:2552] [warn] jk_map.c (410): The attribute 'worker.inprocess.stderr' is deprecated - please check the documentation for the correct replacement.
[Tue Apr 28 18:10:08 2015][4040:2552] [info] mod_jk.c (3018): mod_jk/1.2.27 initialized

Apache HTTPD log :-

[Tue Apr 28 18:17:29 2015] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/examples

Why Apache request not redirect to http://localhost/examples/
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't say anything much without the httpd conf sections related to mod_jk and workers.properties. From error messages, looks like you've followed an old outdated tutorial.
 
anup sadhu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for reply. Please check httpd.conf (Related mod_jk.so)

LoadModule jk_module "C:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_jk.so"

JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/workers.properties"

JkLogFile "C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/from_apache_mod_jk.log"

JkLogLevel info

JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

#Send servlet for context /examples to worker named ajp13

JkMount /examples ajp13

#Send JSPs for context /examples/* to worker named ajp13

JkMount /examples ajp13

Waiting for reply.
 
anup sadhu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sir,

Do you have any updated tutorial to configure mod_jk on Windows XP ?
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The most current tutorial is always on the Tomcat documentation page. It works fine on Windows.

Can you put up the contents of "C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/workers.properties" here?
 
Saloon Keeper
Posts: 23540
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Karthik Shiraly wrote:The most current tutorial is always on the Tomcat documentation page. It works fine on Windows.

Can you put up the contents of "C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/workers.properties" here?



And could you use the "Code" button to wrap code tags around it so we can read it more easily?
 
anup sadhu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sir,

Sorry for late reply.

As per your reply please check my workers.properties :-


# 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.

# workers.properties -
#
# This file provides jk derived plugins with the needed information to
# connect to the different tomcat workers. Note that the distributed
# version of this file requires modification before it is usable by a
# plugin.
#
# 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 ajp12 worker that connects to localhost:8007
# - An ajp13 worker that connects to localhost:8009
# - A jni inprocess worker.
# - A load balancer worker
#
# However by default the plugins will only use the ajp12 worker. To have
# the plugins use other workers you should modify the worker.list property.
#
#

# 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/tomcat3

#
# workers.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
workers.java_home=/opt/IBMJava2-13

#
# You should configure your environment slash... ps=\ on NT and / on UNIX
# and maybe something different elsewhere.
#
ps=/

#
#------ ADVANCED MODE ------------------------------------------------
#---------------------------------------------------------------------
#

#
#------ DEFAULT worker list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
# Add 'inprocess' if you want JNI connector
worker.list=ajp12, ajp13
# , inprocess


#
#------ DEFAULT ajp12 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp12 and of type ajp12
# Note that the name and the type do not have to match.
#
worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp12
#
# 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.ajp12.lbfactor=1

#
#------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.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.lbfactor=1

#
# Specify the size of the open connection pool.
#worker.ajp13.connection_pool_size

#
#------ 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=ajp12, ajp13


#
#------ DEFAULT JNI WORKER DEFINITION---------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named inprocess and of type jni
# Note that the name and the type do not have to match.
#
worker.inprocess.type=jni

#
#------ CLASSPATH DEFINITION -----------------------------------------
#---------------------------------------------------------------------
#

#
# Additional class path components.
#
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar

#
# Setting the command line for tomcat.
# Note: The cmd_line string may not contain spaces.
#
worker.inprocess.cmd_line=start

# Not needed, but can be customized.
#worker.inprocess.cmd_line=-config
#worker.inprocess.cmd_line=$(workers.tomcat_home)$(ps)conf$(ps)server.xml
#worker.inprocess.cmd_line=-home
#worker.inprocess.cmd_line=$(workers.tomcat_home)

#
# The JVM that we are about to use
#
# This is for Java2
#
# Windows
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
# IBM JDK1.3
#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)libjvm.so
# Unix - Sun VM or blackdown
#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)lib$(ps)i386$(ps)classic$(ps)libjvm.so

#
# And this is for jdk1.1.X
#
#worker.inprocess.jvm_lib=$(workers.java_home)$(ps)bin$(ps)javai.dll


#
# Setting the place for the stdout and stderr of tomcat
#
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

#
# Setting the tomcat.home Java property
#
#worker.inprocess.sysprops=tomcat.home=$(workers.tomcat_home)

#
# Java system properties
#
# worker.inprocess.sysprops=java.compiler=NONE
# worker.inprocess.sysprops=myprop=mypropvalue

#
# Additional path components.
#
# worker.inprocess.ld_path=d:$(ps)SQLLIB$(ps)bin
#

LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties


Waiting for reply.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please edit your post, insert a [code] just before your listing starts and a [/code ] just after it ends. It makes reading your post much easier.

1) This "workers.properties" seems like it's copy pasted from somewhere, and has a number of outdated, unnecessary and wrong entries.
In your case, you have just 1 httpd and 1 tomcat.
All you need in your workers.properties are these 4 lines:


2) Verify that "C:/Program Files/Apache Software Foundation/Tomcat 6.0/conf/server.xml" has this line and that it's not commented out:


3) From a cmd prompt, run "netstat -an" and verify that there's an entry like "<IP-address>:8009 LISTENING". This shows that tomcat is listening for mod_jk requests.

4) Verify that tomcat is serving /examples/ correctly by opening "http://localhost:8080/examples/"

5) Verify that both these entries are in your httpd.conf (from your listing, I think you've missed out the second entry):


6) Now restart httpd and open "http://localhost/examples/". If it still doesn't work, change JkLogLevel to debug and put up the mod_jk log file here.
 
anup sadhu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,

Thank you very very much everything working fine. You saved me..Thanks again

 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to know it's working!

I didn't bring it up to avoid confusion earlier, but it's more conventional and readable to name the tomcat workers "worker1", "worker2", etc or name them after their function (like "loginserver", "reportserver", etc) rather than naming it after the protocol.
So a readable workers.properties would be:

and correspondingly replace "ajp13" with "worker1" in httpd.conf.

Also for future reference, insert any code or file listings in this forum inbetween [code][/code] tags. Look at the listing above where I've used them and look how much more readable it looks.
 
anup sadhu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,

Ok sir..Thanks again.

May I ask you another question?
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, of course . No formalities required here, and to be honest, I'm rather uncomfortable with formalities.
If your question is on a different topic than tomcat and mod_jk, ask it as a new topic.
 
anup sadhu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,

Thanks reply.

I want to Start & Stop Tomcat service using browser. Some hosting companies providing Start & Stop facilities through browser.

I want to configure same thing in my network on Windows or Linux. Is it possible ?
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think it's possible, but with some coding effort involved.
As far as I know, the managing software those hosting companies use (such as "cPanel") simply calls some appropriate shell scripts to start/stop any kind of server software.

For starting or stopping tomcat, you can write a web application using PHP and host it on apache.
That application executes a OS specific command like "sc start/stop" or "service start/stop" or "/etc/init.d/tomcat start" or similar.

If all you want to do is start/stop/redeploy individual WARs on tomcat - instead of starting/shutting down entire tomcat - then tomcat comes with a "tomcat-manager" webapp that lets you do all that.


 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There may also be existing open source control software to do things like this. Just google for "cPanel open source alternatives".
 
anup sadhu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,

Thanks for your valuable reply. I have PHP developer in my company. I will give you update on Wednesday.

 
anup sadhu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,

I have successfully configure Tomcat service start & stop through browser using PHP script (win32_set_service_status).

Many Many thanks for your help.
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool! Well done.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic