Getting Apache/Tomcat to work with mod_jk and virtual hostin

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Getting Apache/Tomcat to work with mod_jk and virtual hostin

Postby fightertom37 » 25. March 2008 14:40

I had a Xampp Apache setup working fine with Virtual Hosting. Then I needed to installed the Xampp Tomcat addon to move two Java apps to the same server. But I cannot get the Java apps to work. The other apps on the server are still working fine. First Apache would not forward the requests to Tomcat for the java apps. Then yesterday Tomcat would only serve up the first Java page but if you clicked a link it would only return the source code (ie not parse the Java or HTML) to the screen. And it would only parse the first page in IE, not Firefox or Safari. Today, I have tried more combinations and now the pages will not appear--the browser sits and spins and timesout. I see a 502 error the Apache log. Can any of you help me out please?

I have the following directory structure:

apache directories:
/xampp/apache/conf/extra/httpd-vhosts.conf
/xampp/apache/conf/extra/mod-jk.conf

tomcat directories->
/xampp/tomcat/conf/workers.properties
/xampp/tomcat/conf/server.xml

java application directories->
/xampp/tomcat/webapps/nisl3
/xampp/tomcat/webapps/nisl4

The contents of the mod-jk,httpd-vhosts, workers.properties, and server.xml files are below:

<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 debug

#JkOptions +ForwardDirectories

JKMount /*.jsp ajp13
#JkMount /nisl3/* ajp13
#JkMount /nisl4/* ajp13

</IfModule>


# XAMPP settings
#
<IfModule alias_module>
<IfModule mime_module>
#ScriptAlias /php/ "C:/xampp/php/"
#Action application/x-httpd-php "/php/php-cgi.exe"
LoadModule php5_module "C:/xampp/apache/bin/php5apache2.dll"
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt

<Directory "C:/xampp/htdocs/xampp">
<IfModule php5_module>
<Files "status.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
</Directory>

Alias /security "C:/xampp/security/htdocs/"
<Directory "C:/xampp/security/htdocs">
<IfModule php5_module>
<Files "xamppsecurity.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
<Directory "C:/xampp/phpMyAdmin">
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

Alias /webalizer "C:/xampp/webalizer/"
<Directory "C:/xampp/webalizer">
<IfModule php5_module>
<Files "webalizer.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>

Alias /contrib "C:/xampp/contrib/"
<Directory "C:/xampp/contrib">
<IfModule php5_module>
<Files "webalizer.php">
php_admin_flag safe_mode off
</Files>
</IfModule>

AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
</IfModule>
</IfModule>


# Access restriction via Remote
<IfModule auth_remote_module>
<Directory "C:/xampp/htdocs/fonts">
AllowOverride All
AuthType Basic
AuthName "AUTH REMOTE TEST"
AuthRemoteServer localhost
AuthRemotePort 80
AuthRemoteURL /forbidden/
Require valid-user
#User: user / Password: pass
</Directory>
</IfModule>

# Access restriction via MySQL
<IfModule mysql_auth_module>
<Location /restricted>
AuthMySQLEnable On
AuthName "MySQL Secured Place"
AuthType Basic
require valid-user
AuthMySQLHost localhost
AuthMySQLUser root
# AuthMySQLPassword
AuthMySQLDB webauth
AuthMySQLUserTable user_pwd
AuthMySQLNameField name
AuthMySQLPasswordField pass
AuthMySQLPwEncryption none
</Location>
</IfModule>



<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">

<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<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>

<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">

<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->


<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->

<!--
<Connector executor="tomcatThreadPool" maxThreads='150' minSpareThreads='25' maxSpareThreads='75'
enableLookups='false' redirectPort='8443' acceptCount='100' debug='0' connectionTimeout='20000' disableUploadTimeout='true'/>
-->


<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->

<!-- Define an AJP 1.3 Connector on port 8009
<Connector address="127.0.0.1"
port="8009" protocol="AJP/1.3" redirectPort="8443" debug="0" enableLookups="false"/>-->

<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>


<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">

<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->

<!-- The request dumper valve dumps useful debugging information about
the request and response data received and sent by Tomcat.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->

<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>

<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->

<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
-->

</Host>

<Host name="ww3.nislonline.org" appbase="webapps">
<Alias>ww3.nislonline.org</Alias>
<Context path="/nisl3" docBase="C:\xampp\tomcat\webapps\nisl3"/>
<Logger className="org.apache.catalina.logger.FileLogger" prefix="nisl3." suffix=".txt" timestamp="true"/>
</Host>

<Host name="ww4.nislonline.org" appbase="webapps">
<Context path="/nisl4" docBase="C:\xampp\tomcat\webapps\nisl4"/>
<Alias>ww4.nislonline.org</Alias>
<Logger className="org.apache.catalina.logger.FileLogger" prefix="nisl4." suffix=".txt" timestamp="true"/>
</Host>

</Engine>
</Service>
</Server>



# workers.properties.minimal -
#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# The workers that jk should create and work with
#
worker.list=ajp13


#
# Defining a worker named ajp13w and of type ajp13
# Note that the name and the type do not have to match.
#
workers.tomcat_home=C:/xampp/tomcat/
workers.java_home=C:/Program Files/Java/jdk1.5.0_14
worker.ajp13.type=ajp13
worker.ajp13.host=localhost
worker.ajp13.port=8009
fightertom37
 
Posts: 1
Joined: 25. March 2008 14:29

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 106 guests