Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

mod_jk and tomcat virtual hosts not working properly


Hi,


First of all I would like to mention that this is my first post on this list, I hope that this question is posted in the right place. I have tried finding a solution for my problem, but it either doesn't exist, or my limited brain can't manage to figure out how to do it (I strongly hope it is the latter).

My issue is with the mod_jk plugin. I want to redirect my subdomain requests jira.example.com to a tomcat 6 virtual host called jiraapp.

If I call the subdomain jira.example.com Im always getting the default tomcat 6 host called localhost.

I tested every part:
1.) mod_jk: if i change the workers name in either workers.properties or under my enabled-site <VirtualHost> or if i change the mapping to my virtual host (/etc/hosts: 127.0.0.1 localhost jiraapp) apache doesnt start.
2.) if I do a lynx jiraapp:8080 on the machine it works and shows the right webapp.

But if I access jira.example.com I always getting the default root-webapp of tomcat 6. So theres no difference in calling jira.example.com or example.com:8080.

My conclusion is that I sucessfully set up mod_jk, apache2 virtual hosts (for the subdomain) and tomcat virtual hosts, because everything works fine if tested alone. But if I try to use everything together and remotely it doesnt work.

Help would be appreciated.

Versions:
Apache Tomcat/6.0.29
Sun-Java 1.6.0_20-b02
Apache/2.2.9 (Debian) mod_jk/1.2.26 proxy_html/3.0.0 Server
libapache2-mod-jk 1:1.2.26-2+lenny1

== jk.load ==
Code:

LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel info
# JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories -ForwardLocalAddress
JkRequestLogFormat "%w %V %T"

== workers.properties ==
Code:

workers.tomcat_home=/opt/tomcat
workers.java_home=/usr/lib/jvm/java-6-sun
worker.list=jiraworker
worker.jiraworker.port=8009
worker.jiraworker.host=jiraapp
worker.jiraworker.type=ajp13

== /etc/hosts ==
Code:

::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
127.0.0.1 localhost.localdomain localhost jiraapp

== server.xml ===
Code:

<Engine name="Catalina" defaultHost="localhost">
[...]
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
[...]
</Host>
<Host name="jiraapp" appBase="jiraapp" docBase="/opt/tomcat/jiraapp"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false" >

View Original Thread
Comments
0
Be the first to comment

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect
avatar
Tags: host, code, workers, localhost
mod_jk and tomcat virtual hosts not connecting
Jul 27, 2010
Hi, First of all I would like to mention that this is my first post on this list, I hope that this question is sent in the right place. I have tried finding a solution for my problem, but it either doesn't exist, or my limited brain can't…

Re: mod_jk and tomcat virtual hosts not connecting
Jul 28, 2010
Hi Moritz, Try adding: <Alias>jira.example.com</Alias> <Alias>www.jira.example.com</Alias> To the server.xml inside the <Host name="jirapp"> Best Regards, Brett -----Original Message----- From: Moritz…

running under virtual hosts
Aug 21, 2010
Hi All. Objective: The server multiple virtual hosts, Ext 2 and 3 local, how to configure mod_security running on external hosts, and the question of whether to run mod with different rules for different virtual hosts?

basic 2 virtual hosts configuration
Jun 15, 2010
to deploy 2 virtual hosts in Tomcat 5.5.29 (no Apache) what more than the server.xml file below and a context.xml per each host in Catalina do you need to set up? Where do I set path, like for "/"? Alright in the context file (see below)? …

Re: mod_ssl, SNI and dynamic virtual hosts
May 25, 2010
Adam Hasselbalch Hansen wrote: > We have a setup that uses an in-house module which works not entirely > unlike mod_vhost_alias, in that it has a single virtual host configured, > and then determines stuff like domain name, docroot, etc,…

Server configuration port - Virtual hosts
Jun 7, 2010
I need to have a website running in IIS on port 80, and message queue on port 80. Is that possible? They would have different DNS addresses, and can have multiple IPs for the machine. Or at least both of them accessible from a port 80 request. …

DO NOT REPLY New: SSLVerifyClient and SSL virtual hosts don't work quite right
Aug 9, 2010
https://issues.apache.org/bugzilla/show_bug.cgi?id=49731 Summary: SSLVerifyClient and SSL virtual hosts don't work quite right Product: Apache httpd-2 Version: 2.2.6 Platform: PC …

RE: NameVirtualHost Directive - - - - Multiple SSL virtual hosts
Jun 6, 2010
Thanks that's great news. I am still trying to resolve this error message I am getting. Eric said I need to be certain that my NameVirtualHost and VirtualHost directives matched literally. I reread the documentation on http://httpd.apache.org…

NameVirtualHost Directive - - - - Multiple SSL virtual hosts
Jun 4, 2010
I have an Apache 2.2 server sitting on a box with one physical address and multiple virtual addresses. The physical address servers my name-based virtual hosts where as the virtual addresses server ip-based virtual hosts. I read about the…

RE: NameVirtualHost Directive - - - - Multiple SSL virtual hosts
Jun 6, 2010
Manoj, I am using 2.2.11. Hmmmmm. Are you saying if I move to 2.2.12 I can server multiple name-based ssl virtual hosts on the same IP and ports? Even so, I may choose to use a multi-domain SSL certificate. Being able to use this for up to…