You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by trm asn <tr...@gmail.com> on 2011/09/09 23:52:48 UTC

Apache+Tomcat+mod_jk

Hi List,

Please help me on the below scenario .

I have one war eample.war & which is also having a images folder (
/usr/local/tomcat/webapps/example/images). I will type
http://192.168.65.100and it'll load the "example" apps. What will be
my httpd.conf file syntax
that it ll load the image from apache's "/var/www/images"  folder not from
tomcat.


Httpd.conf
--------------
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat     "%w %V %T"
JkMount / loadbalancer
JkMount /* loadbalancer

Workers.properties
--------------------------
worker.list=loadbalancer
worker.tomcat1.port=8009
worker.tomcat1.host=192.168.65.102
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1

worker.tomcat2.port=8009
worker.tomcat2.host=192.168.65.103
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.sticky_session=1
worker.loadbalancer.balanced_workers=tomcat1, tomcat2
worker.loadbalancer.method=Busyness
worker.loadbalancer.lbfactor=1
worker.loadbalancer.sticky_session=1
worker.loadbalancer.stickysessions=true




/\
tRm

Re: Apache+Tomcat+mod_jk

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Konstantin,

On 9/12/2011 9:06 AM, Konstantin Kolinko wrote:
> 2011/9/12 trm asn <tr...@gmail.com>:
>>> 
>> Below is my httpd.conf
>> 
>> Alias /images "/var/www/sc/images" JkWorkersFile
>> conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log 
>> JkLogLevel debug JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " 
>> JkOptions     +ForwardKeySize +ForwardURICompat
>> -ForwardDirectories JkRequestLogFormat     "%w %V %T" JkUnMount
>> /*.jpg loadbalancer
> 
> Wouldn't that be JkUnMount /images/*.jpg  ?

+1

>> JkMount / loadbalancer JkMount /* loadbalancer <VirtualHost
>> *:80>
> 
> JkMountCopy needed ?

That depends upon other configurations.

It seems that mod_jk is being invoked, so that's probably not the problem.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5usbwACgkQ9CaO5/Lv0PBXWQCdGq3wGFu8qKoR12Bcp3U851eB
qDQAoIo4p0V0ETeRDAo+kEkmEDMDmITA
=r7Ch
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Apache+Tomcat+mod_jk

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/9/12 trm asn <tr...@gmail.com>:
>>
> Below is my httpd.conf
>
> Alias /images "/var/www/sc/images"
> JkWorkersFile conf/workers.properties
> JkLogFile /var/log/httpd/mod_jk.log
> JkLogLevel debug
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
> JkRequestLogFormat     "%w %V %T"
> JkUnMount  /*.jpg loadbalancer

Wouldn't that be
JkUnMount /images/*.jpg  ?

> JkMount / loadbalancer
> JkMount /* loadbalancer
> <VirtualHost *:80>

JkMountCopy needed ?

> ServerName eaas-nm-haproxy
> DocumentRoot "/var/www/sc"
> <Directory "/var/www/sc">
>  # Options Indexes FollowSymLinks MultiViews
>  Options None
>  AllowOverride None
>  Order allow,deny
>  allow from all
> </Directory>
> ErrorLog logs/app1-error.log
> CustomLog logs/app1-access.log combined
> RewriteEngine On
> RewriteRule ^/(images/.+);jsessionid=\w+$ /$1
> </VirtualHost>
>
>
> Still it's trying to fetch from tomcat.
>

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Apache+Tomcat+mod_jk

Posted by André Warnier <aw...@ice-sa.com>.
trm asn wrote:
> On Mon, Sep 12, 2011 at 3:59 PM, Casper Wandahl Schmidt <
> kalle.privat@gmail.com> wrote:
> 
>>
>> Den 12-09-2011 11:24, trm asn skrev:
>>
>>  On Sun, Sep 11, 2011 at 8:40 PM, Christopher Schultz<
>>> chris@christopherschultz.net>  wrote:
>>>
>>>  -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> tRm,
>>>>
>>>> On 9/9/2011 5:52 PM, trm asn wrote:
>>>>
>>>>> I have one war eample.war&  which is also having a images folder (
>>>>> /usr/local/tomcat/webapps/**example/images). I will type
>>>>> http://192.168.65.100and it'll load the "example" apps.
>>>>>
>>>> If you want http://192.168.65.100/ to load your "examples.war" webapp,
>>>> you should re-name examples.war to ROOT.war (note the capitals are
>>>> important).
>>>>
>>>>  What will be my httpd.conf file syntax that it ll load the image
>>>>> from apache's "/var/www/images" folder not from tomcat.
>>>>>
>>>> You can do this with an "Alias".
>>>>
>>>> - -chris
>>>> -
>>>>
>>>>  I have done that, but still images are coming from tomcat.
>>> Alias /images "/var/www/sc/images"
>>>
>> Sorry for interrupting. Perhaps you should have a look at JkUnMount in the
>> mod_jk spec.
>>
>>> /\
>>> tRm
>>>
>>>
> Below is my httpd.conf
> 
> Alias /images "/var/www/sc/images"
> JkWorkersFile conf/workers.properties
> JkLogFile /var/log/httpd/mod_jk.log
> JkLogLevel debug
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
> JkRequestLogFormat     "%w %V %T"
> JkUnMount  /*.jpg loadbalancer
> JkMount / loadbalancer
> JkMount /* loadbalancer
> <VirtualHost *:80>
> ServerName eaas-nm-haproxy
> DocumentRoot "/var/www/sc"
> <Directory "/var/www/sc">
>   # Options Indexes FollowSymLinks MultiViews
>   Options None
>   AllowOverride None
>   Order allow,deny
>   allow from all
> </Directory>
> ErrorLog logs/app1-error.log
> CustomLog logs/app1-access.log combined
> RewriteEngine On
> RewriteRule ^/(images/.+);jsessionid=\w+$ /$1
> </VirtualHost>
> 
> 
> Still it's trying to fetch from tomcat.
> 
And what does the logfile "/var/log/httpd/mod_jk.log" say when you fetch an image ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Apache+Tomcat+mod_jk

Posted by trm asn <tr...@gmail.com>.
On Mon, Sep 12, 2011 at 3:59 PM, Casper Wandahl Schmidt <
kalle.privat@gmail.com> wrote:

>
>
> Den 12-09-2011 11:24, trm asn skrev:
>
>  On Sun, Sep 11, 2011 at 8:40 PM, Christopher Schultz<
>> chris@christopherschultz.net>  wrote:
>>
>>  -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> tRm,
>>>
>>> On 9/9/2011 5:52 PM, trm asn wrote:
>>>
>>>> I have one war eample.war&  which is also having a images folder (
>>>> /usr/local/tomcat/webapps/**example/images). I will type
>>>> http://192.168.65.100and it'll load the "example" apps.
>>>>
>>> If you want http://192.168.65.100/ to load your "examples.war" webapp,
>>> you should re-name examples.war to ROOT.war (note the capitals are
>>> important).
>>>
>>>  What will be my httpd.conf file syntax that it ll load the image
>>>> from apache's "/var/www/images" folder not from tomcat.
>>>>
>>> You can do this with an "Alias".
>>>
>>> - -chris
>>> -
>>>
>>>  I have done that, but still images are coming from tomcat.
>>
>> Alias /images "/var/www/sc/images"
>>
> Sorry for interrupting. Perhaps you should have a look at JkUnMount in the
> mod_jk spec.
>
>>
>> /\
>> tRm
>>
>>
>
Below is my httpd.conf

Alias /images "/var/www/sc/images"
JkWorkersFile conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat     "%w %V %T"
JkUnMount  /*.jpg loadbalancer
JkMount / loadbalancer
JkMount /* loadbalancer
<VirtualHost *:80>
ServerName eaas-nm-haproxy
DocumentRoot "/var/www/sc"
<Directory "/var/www/sc">
  # Options Indexes FollowSymLinks MultiViews
  Options None
  AllowOverride None
  Order allow,deny
  allow from all
</Directory>
ErrorLog logs/app1-error.log
CustomLog logs/app1-access.log combined
RewriteEngine On
RewriteRule ^/(images/.+);jsessionid=\w+$ /$1
</VirtualHost>


Still it's trying to fetch from tomcat.


------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<us...@tomcat.apache.org>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Apache+Tomcat+mod_jk

Posted by Casper Wandahl Schmidt <ka...@gmail.com>.

Den 12-09-2011 11:24, trm asn skrev:
> On Sun, Sep 11, 2011 at 8:40 PM, Christopher Schultz<
> chris@christopherschultz.net>  wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> tRm,
>>
>> On 9/9/2011 5:52 PM, trm asn wrote:
>>> I have one war eample.war&  which is also having a images folder (
>>> /usr/local/tomcat/webapps/example/images). I will type
>>> http://192.168.65.100and it'll load the "example" apps.
>> If you want http://192.168.65.100/ to load your "examples.war" webapp,
>> you should re-name examples.war to ROOT.war (note the capitals are
>> important).
>>
>>> What will be my httpd.conf file syntax that it ll load the image
>>> from apache's "/var/www/images" folder not from tomcat.
>> You can do this with an "Alias".
>>
>> - -chris
>> -
>>
> I have done that, but still images are coming from tomcat.
>
> Alias /images "/var/www/sc/images"
Sorry for interrupting. Perhaps you should have a look at JkUnMount in 
the mod_jk spec.
>
> /\
> tRm
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Apache+Tomcat+mod_jk

Posted by trm asn <tr...@gmail.com>.
On Sun, Sep 11, 2011 at 8:40 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> tRm,
>
> On 9/9/2011 5:52 PM, trm asn wrote:
> > I have one war eample.war & which is also having a images folder (
> > /usr/local/tomcat/webapps/example/images). I will type
> > http://192.168.65.100and it'll load the "example" apps.
>
> If you want http://192.168.65.100/ to load your "examples.war" webapp,
> you should re-name examples.war to ROOT.war (note the capitals are
> important).
>
> > What will be my httpd.conf file syntax that it ll load the image
> > from apache's "/var/www/images" folder not from tomcat.
>
> You can do this with an "Alias".
>
> - -chris
> -
>

I have done that, but still images are coming from tomcat.

Alias /images "/var/www/sc/images"

/\
tRm

Re: Apache+Tomcat+mod_jk

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

tRm,

On 9/9/2011 5:52 PM, trm asn wrote:
> I have one war eample.war & which is also having a images folder ( 
> /usr/local/tomcat/webapps/example/images). I will type 
> http://192.168.65.100and it'll load the "example" apps.

If you want http://192.168.65.100/ to load your "examples.war" webapp,
you should re-name examples.war to ROOT.war (note the capitals are
important).

> What will be my httpd.conf file syntax that it ll load the image
> from apache's "/var/www/images" folder not from tomcat.

You can do this with an "Alias".

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5sz2sACgkQ9CaO5/Lv0PBroQCgnkIR7WXD+cqGPpyzWiUJdOlj
7wQAnRa51uW1tws8mQ0z1xQg3zjSm8/G
=iMOf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org