You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tommy Peterson <st...@hotmail.com> on 2008/02/17 05:33:53 UTC

apache forwards all requests to tomcat

I have apache 2.2,8 and tomcat 6 and they are installed on a Windows 2003 server. Originally, I had 2 html/php websites that were served up by apache alone using virtual hosting with no issues. Then I decided to move a Java app to this server and install tomcat, still using virtual hosting. The problem I get is that all requests now are being sent to tomcat. The two html/php apps show the tomcat default page (but when you click on the links they are dead links). The two java apps do what they are expected to do. 

httpd -t shows no problems. the log files show no problems. I am thinking it is the worker statements but they look ok too. 










I point my Apache httpd.conf file a mod_jk.conf file with " Include conf/extra/mod_jk.conf " in the last line. I have the following in mod_jk.conf:
<IfModule !mod_jk.c>

    LoadModule jk_module modules/mod_jk.so

</IfModule>



<IfModule mod_jk.c>

JkWorkersFile "c:/xampp/tomcat/conf/workers.properties"

JkLogFile "c:/xampp/tomcat/logs/mod_jk.log"

JkLogLevel info



JKMount /third/*.jsp ajp13

JKMount /fourth/*.jsp ajp13

</IfModule>  











I point my Apache httpd.conf file to a virtual hosts conf file with "Include conf/extra/httpd-vhosts.conf" stated in the httpd.conf file. The virtual hosts file shows:
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName reg.domain.org
    DocumentRoot C:/program/htdocs/nc   
    ErrorLog C:/program/apache/logs/reg.domain.org-error_log
    CustomLog C:/program/apache/logs/reg.domain.org-access_log common
  <Directory "C:/program/htdocs/nc/">
     DirectoryIndex nc_08_o_reg.php
     AllowOverride None
     Order Allow,Deny
     Allow from All
 </Directory>
</VirtualHost>


<VirtualHost *:80>
    ServerName or.domain.org
    DocumentRoot C:/program/htdocs/ot    
    ErrorLog C:/program/apache/logs/or.domain.org-error_log
    CustomLog C:/program/apache/logs/or.domain.org-access_log common
  <Directory "C:/program/htdocs/ot/">
     #DirectoryIndex index.php
     AllowOverride None
     Order Allow,Deny
     Allow from All
 </Directory>
</VirtualHost>


<VirtualHost *:80>
    ServerName ww3.3domain.org
    ServerAlias ww3.3domain.org
    DocumentRoot C:/program/tomcat/webapps/3domain
    JkMount /*.jsp ajp13
    Alias /nisl3 "C:/program/tomcat/webapps/3domain"

   <Directory "C:/program/tomcat/webapps/3domain/">
       #Options All
        #Order allow,deny
        #Allow from all
         AllowOverride None
     Order Allow,Deny
     Allow from All
   </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName ww4.4domain.org
    ServerAlias ww4.4domain.org
    DocumentRoot C:/program/tomcat/webapps/4domain4
    JkMount /*.jsp ajp13
    Alias /nisl3 "C:/program/tomcat/webapps/4domain4"

   <Directory "C:/program/tomcat/webapps/4domain4/">
       #Options All
        #Order allow,deny
        #Allow from all
        AllowOverride None
     Order Allow,Deny
     Allow from All
   </Directory>
</VirtualHost>











I have the following in my Apache workers.properties:
[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket

[logger]
level=error
#level=debug

[logger.file:0]
info=Where to put the mod_jk2 log.
file=${serverRoot}/logs/jk2.log
level=error
#level=debug

[status:]
info=Status worker, displays runtime informations

[uri:/3domain/*]
info=Map the Tomcat jsp-examples to the Web server uri space

[uri:/4domain/*]
info=Map the Tomcat jsp-examples to the Web server uri space

#[uri:/servlets-examples/*]
#info=Map the Tomcat servlet-examples to the Web server uri space

[uri:/java/*]
info=Map the Java Main

common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar
server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar
tomcat.util.buf.StringCache.byte.enabled=true















I have the following in my Tomcat workers2.properties file:
[logger]
level=DEBUG

[config:]
file=${serverRoot}/conf/workers2.properties
debug=0
debugEnv=0

[uriMap:]
info=Maps the requests. Options: debug
debug=0

# Alternate file logger
#[logger.file:0]
#level=DEBUG
#file=${serverRoot}/logs/jk2.log

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=${serverRoot}/logs/jk2.shm
size=1000000
debug=0
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 ) 
# can be overriden to a file logger, useful 
# when tracing win32 related issues
#logger=logger.file:0

[lb:lb]
info=Default load balancer.
debug=0

[lb:lb_1]
info=A second load balancer.
debug=0

[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009

[channel.socket:localhost:8019]
info=A second tomcat instance. 
debug=0
tomcatId=localhost:8019
lb_factor=1
#group=lb
group:lb:lb
#group=lb_1
group:lb:lb_1
disabled=0

[channel.un:/opt/33/work/jk2.socket]
info=A second channel connecting to localhost:8019 via unix socket
tomcatId=localhost:8019
lb_factor=1
debug=0

[channel.jni:jni]
info=The jni channel, used if tomcat is started inprocess

[status:]
info=Status worker, displays runtime informations

[vm:]
info=Parameters used to load a JVM in the server process
#JVM=C:\jdk\jre\bin\hotspot\jvm.dll
classpath=${TOMCAT_HOME}/bin/tomcat-jni.jar
classpath=${TOMCAT_HOME}/server/lib/commons-logging.jar
OPT=-Dtomcat.home=${TOMCAT_HOME}
OPT=-Dcatalina.home=${TOMCAT_HOME}
OPT=-Xmx128M
#OPT=-Djava.compiler=NONE
disabled=1

[worker.jni:onStartup]
info=Command to be executed by the VM on startup. This one will start tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=start
# For Tomcat 5 use the 'stard' for startup argument
# ARG=stard
disabled=1
stdout=${serverRoot}/logs/stdout.log
stderr=${serverRoot}/logs/stderr.log

[worker.jni:onShutdown]
info=Command to be executed by the VM on shutdown. This one will stop tomcat.
class=org/apache/jk/apr/TomcatStarter
ARG=stop
disabled=1

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:

[uri:127.0.0.1:8003]
info=Example virtual host. Make sure myVirtualHost is in /etc/hosts to test it
alias=myVirtualHost:8003

[uri:127.0.0.1:8003/ex]
info=Example webapp in the virtual host. It'll go to lb_1 ( i.e. localhost:8019 )
context=/ex
group=lb_1

#[uri:/examples]
#info=Example webapp in the default context. 
#context=/examples
#debug=0

[uri:/3domain]
info=Example webapp in the default context. 
context=/3domain
debug=0

[uri:/4domain]
info=Example webapp in the default context. 
context=/4domain
debug=0

#[uri:/examples1/*]
#info=A second webapp, this time going to the second tomcat only.
#group=lb_1
#debug=0

#[uri:/examples/servlet/*]
#info=Prefix mapping

[uri:/3domain/servlet/*]
info=Prefix mapping

[uri:/4domain/servlet/*]
info=Prefix mapping

#[uri:/examples/*.jsp]
#info=Extension mapping

[uri:/3domain/*.jsp]
info=Extension mapping

[uri:/4domain/*.jsp]
info=Extension mapping

#[uri:/examples/*]
#info=Map the whole webapp

[uri:/3domain/*]
info=Map the whole webapp

[uri:/4domain/*]
info=Map the whole webapp

#[uri:/examples/servlet/HelloW]
#info=Example with debug enabled.
#debug=10

[ajp13:localhost:8009]
info=AJP13 worker, connects to tomcat instance using AJP 1.3 protocol
#channel=channel.socket: TC5
channel=channel.socket: localhost:8019



And I have my hostnames set up in my server.xml file.

Finally, I have my Windows hosts file created with all of the 4 domain names listed with the my server's IP address. 



So what am I missing here? Thanks very much for your help. 







 


_________________________________________________________________
Need to know the score, the latest news, or you need your HotmailĀ®-get your "fix".
http://www.msnmobilefix.com/Default.aspx