Re: MVC or Model2 with Tomcat

2011-12-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pid,

On 12/9/11 8:23 AM, Pid wrote:
> If you want Tomcat to find & serve index.jsp for a '/' request,
> then you need:
> 
>  index.jsp 
> 

... which is the default , I might add. (Actually, the default is to
look for index.html, index.htm, and index.jsp in that order).

> If you have index.html and Servlets, either Tomcat can serve the
> HTML, or HTTPD.  In the latter case you'll need to ensure that
> requests for / and /index.html are not forwarded to Tomcat.

+1

This is why Andre said that you'll have a more complex configuration.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7mVKoACgkQ9CaO5/Lv0PBn8wCgn8yAJZSsk0szbCcfaAp4sDCG
QTAAoIA7aKm8VfgJNXEPTf8JApKNzZui
=wJCD
-END PGP SIGNATURE-

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



Re: MVC or Model2 with Tomcat

2011-12-09 Thread Pid
On 08/12/2011 10:51, Blaxton wrote:

>> 
>>
>> On 6 Dec 2011, at 15:52, Blaxton  wrote:
>>>
>>> I have added the host directive to
>> server.xml and moved appexmp1 contents to ROOT directory
>>> and now I can access www.mydomain.com/index.jsp with no problem,
>>> however now the servlets are not working.
>>> I can access jsp files, but no servlets, I get "The requested resource is 
>>> not available" message.
>>>
>>> as with following direction:
>>> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html#context.xml_-_approach__1
>>>
>>> I have created /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>>
>> Ok, please remove the comments from your server.xml and post it inline, here.
>>
>>
>>> I have placed a HelloWorld.class file in 
>>> /Catalina_BASE/appname/ROOT/WEB-INF/classes/com/mydomain
>>> but can't access the class through mydomain.com/app1/HelloWorld
>>
>> How have you defined the Servlet in
>> ROOT/WEB-INF/web.xml?
>>
>>
>>> tried following context file variations but didn't work:
>>>
>>> >> crossContext="true">
>>> 
>>
>> Never do the above.
>>
>>
>>> >> crossContext="true">
>>> 
>>
>> Or that.
>>
>> The 'path' attribute is not applicable here - in any case it's wrong.
>>
>> Remove the path and docBase attributes from the ROOT.xml file.
>>
>>
>> p
>>
>>> it seems to me , context file is not being read after adding the host 
>>> directive to server.xml
>>> either when it is in /Catalina_BASE/conf/Catalina/local host or now that it 
>>> is in
>>> /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>>>
>>> thanks for help
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>> OK, my mistake, I had JkMount /*.jsp and /app1/* rather than JkMount /* in 
>> httpd-vhost.com
>> changed it as you mentioned to JkMount /* and servlets works now.
>>
>> Also removed path and docbase from context.xml
>> so we can't have default application in ROOT and path in context file ?
>>
>> haven't tried it , but I think we could achieve the same thing with 
>> JkAutoAlias
>> which one is recommended ? JkAutoAlias or adding host directive in 
>> server.xml ?
>>
>> Thank you very much for help
>> I achieved what i was looking for.
>>
>>
>>
>> 
>>
>> Sorry but there is one more problem.
>>
>> now that I have JkMount /* in vhost1_httpd.conf
>> every thing will be forwarded to tomcat other than *.html because there is
>> a JkUnMount /*.html line in vhost1_httpd.conf but still when I browse
>> mydomain.com/ I get the tomcat error
>> "The requested resource() is not available".
>> why is that ?
> 
> Some mod_jk config voodoo is bubbling up into my memory.
> 
> I can't see it in the docs, but try:
> 
> JKMount /|* worker
> 
> Which version of mod_jk are you using?
> 
> 
>> I have added welcome directive to web.xml as follow:
>> 
>> index.html
>> 
> 
> This tells Tomcat to look for index.html in its own resource location.
> Is it there or are you expecting HTTPD to do that for you?
> 
> I think you probably want to put index.jsp instead.
> 
> 
>> and following is DirectoryIndex in vhost1_httpd.conf file:
>> DirectoryIndex index.jsp index.html index.php
> 
> 
> 
>> I can access mydomain.com/index.html
>> but getting error when accessing mydomain.com/
> 
> Check the access logs to see which server is sending the file.
> 
> 
> p
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> Ok, thanks
> 
> I have added 
> JkUnMount /  appexmp1worker

Eh?

> and with following directive:
> DirectoryIndex  index.html 
> 
> I can access mydomain.com/ and the default index.html will be displayed.

Yes, I'd expect that.


> however, with 
> DirectoryIndex  index.jsp
> 
> because of JkMount  /* 
> 
> all requests , including .jsp files would be forwarded to tomcat and
> I should place index.jsp file where we defined the appbase.

Is that a question?


NB  Do not put any files straight in appBase.  Only put files inside a
appBase/ROOT or whatever applications directories are there.


If you want Tomcat to find & serve index.jsp for a '/' request, then you
need:

 
   index.jsp
 

If you have index.html and Servlets, either Tomcat can serve the HTML,
or HTTPD.  In the latter case you'll need to ensure that requests for /
and /index.html are not forwarded to Tomcat.


Can we revisit what you are trying to achieve here?


p



-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: MVC or Model2 with Tomcat

2011-12-08 Thread Blaxton





 From: Pid * 
To: Tomcat Users List  
Sent: Thursday, December 8, 2011 12:25:35 PM
Subject: Re: MVC or Model2 with Tomcat
 
On 8 Dec 2011, at 06:08, Blaxton  wrote:

>
>
>
>
> 
> From: Blaxton 
> To: Tomcat Users List 
> Sent: Tuesday, December 6, 2011 9:19:00 PM
> Subject: Re: MVC or Model2 with Tomcat
>
>
>
>
>
>
> 
> From: Pid * 
> To: Tomcat Users List 
> Sent: Tuesday, December 6, 2011 8:12:40 PM
> Subject: Re: MVC or Model2 with Tomcat
>
> 
>
> On 6 Dec 2011, at 15:52, Blaxton  wrote:
>>
>> I have added the host directive to
> server.xml and moved appexmp1 contents to ROOT directory
>> and now I can access www.mydomain.com/index.jsp with no problem,
>> however now the servlets are not working.
>> I can access jsp files, but no servlets, I get "The requested resource is 
>> not available" message.
>>
>> as with following direction:
>> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html#context.xml_-_approach__1
>>
>> I have created /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>
> Ok, please remove the comments from your server.xml and post it inline, here.
>
>
>> I have placed a HelloWorld.class file in 
>> /Catalina_BASE/appname/ROOT/WEB-INF/classes/com/mydomain
>> but can't access the class through mydomain.com/app1/HelloWorld
>
> How have you defined the Servlet in
> ROOT/WEB-INF/web.xml?
>
>
>> tried following context file variations but didn't work:
>>
>> > crossContext="true">
>> 
>
> Never do the above.
>
>
>> > crossContext="true">
>> 
>
> Or that.
>
> The 'path' attribute is not applicable here - in any case it's wrong.
>
> Remove the path and docBase attributes from the ROOT.xml file.
>
>
> p
>
>> it seems to me , context file is not being read after adding the host 
>> directive to server.xml
>> either when it is in /Catalina_BASE/conf/Catalina/local host or now that it 
>> is in
>> /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>>
>> thanks for help
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
> OK, my mistake, I had JkMount /*.jsp and /app1/* rather than JkMount /* in 
> httpd-vhost.com
> changed it as you mentioned to JkMount /* and servlets works now.
>
> Also removed path and docbase from context.xml
> so we can't have default application in ROOT and path in context file ?
>
> haven't tried it , but I think we could achieve the same thing with 
> JkAutoAlias
> which one is recommended ? JkAutoAlias or adding host directive in server.xml 
> ?
>
> Thank you very much for help
> I achieved what i was looking for.
>
>
>
> 
>
> Sorry but there is one more problem.
>
> now that I have JkMount /* in vhost1_httpd.conf
> every thing will be forwarded to tomcat other than *.html because there is
> a JkUnMount /*.html line in vhost1_httpd.conf but still when I browse
> mydomain.com/ I get the tomcat error
> "The requested resource() is not available".
> why is that ?

Some mod_jk config voodoo is bubbling up into my memory.

I can't see it in the docs, but try:

JKMount /|* worker

Which version of mod_jk are you using?


> I have added welcome directive to web.xml as follow:
> 
> index.html
> 

This tells Tomcat to look for index.html in its own resource location.
Is it there or are you expecting HTTPD to do that for you?

I think you probably want to put index.jsp instead.


> and following is DirectoryIndex in vhost1_httpd.conf file:
> DirectoryIndex index.jsp index.html index.php



> I can access mydomain.com/index.html
> but getting error when accessing mydomain.com/

Check the access logs to see which server is sending the file.


p

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


Ok, thanks

I have added 
JkUnMount /  appexmp1worker

and with following directive:
DirectoryIndex  index.html 

I can access mydomain.com/ and the default index.html will be displayed.

however, with 
DirectoryIndex  index.jsp

because of JkMount  /* 

all requests , including .jsp files would be forwarded to tomcat and
I should place index.jsp file where we defined the appbase.

Thanks again

Re: MVC or Model2 with Tomcat

2011-12-08 Thread Pid *
On 8 Dec 2011, at 06:08, Blaxton  wrote:

>
>
>
>
> 
> From: Blaxton 
> To: Tomcat Users List 
> Sent: Tuesday, December 6, 2011 9:19:00 PM
> Subject: Re: MVC or Model2 with Tomcat
>
>
>
>
>
>
> 
> From: Pid * 
> To: Tomcat Users List 
> Sent: Tuesday, December 6, 2011 8:12:40 PM
> Subject: Re: MVC or Model2 with Tomcat
>
> 
>
> On 6 Dec 2011, at 15:52, Blaxton  wrote:
>>
>> I have added the host directive to
> server.xml and moved appexmp1 contents to ROOT directory
>> and now I can access www.mydomain.com/index.jsp with no problem,
>> however now the servlets are not working.
>> I can access jsp files, but no servlets, I get "The requested resource is 
>> not available" message.
>>
>> as with following direction:
>> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html#context.xml_-_approach__1
>>
>> I have created /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>
> Ok, please remove the comments from your server.xml and post it inline, here.
>
>
>> I have placed a HelloWorld.class file in 
>> /Catalina_BASE/appname/ROOT/WEB-INF/classes/com/mydomain
>> but can't access the class through mydomain.com/app1/HelloWorld
>
> How have you defined the Servlet in
> ROOT/WEB-INF/web.xml?
>
>
>> tried following context file variations but didn't work:
>>
>> > crossContext="true">
>> 
>
> Never do the above.
>
>
>> > crossContext="true">
>> 
>
> Or that.
>
> The 'path' attribute is not applicable here - in any case it's wrong.
>
> Remove the path and docBase attributes from the ROOT.xml file.
>
>
> p
>
>> it seems to me , context file is not being read after adding the host 
>> directive to server.xml
>> either when it is in /Catalina_BASE/conf/Catalina/local host or now that it 
>> is in
>> /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>>
>> thanks for help
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
> OK, my mistake, I had JkMount /*.jsp and /app1/* rather than JkMount /* in 
> httpd-vhost.com
> changed it as you mentioned to JkMount /* and servlets works now.
>
> Also removed path and docbase from context.xml
> so we can't have default application in ROOT and path in context file ?
>
> haven't tried it , but I think we could achieve the same thing with 
> JkAutoAlias
> which one is recommended ? JkAutoAlias or adding host directive in server.xml 
> ?
>
> Thank you very much for help
> I achieved what i was looking for.
>
>
>
> 
>
> Sorry but there is one more problem.
>
> now that I have JkMount /* in vhost1_httpd.conf
> every thing will be forwarded to tomcat other than *.html because there is
> a JkUnMount /*.html line in vhost1_httpd.conf but still when I browse
> mydomain.com/ I get the tomcat error
> "The requested resource() is not available".
> why is that ?

Some mod_jk config voodoo is bubbling up into my memory.

I can't see it in the docs, but try:

 JKMount /|* worker

Which version of mod_jk are you using?


> I have added welcome directive to web.xml as follow:
> 
> index.html
> 

This tells Tomcat to look for index.html in its own resource location.
Is it there or are you expecting HTTPD to do that for you?

I think you probably want to put index.jsp instead.


> and following is DirectoryIndex in vhost1_httpd.conf file:
> DirectoryIndex index.jsp index.html index.php



> I can access mydomain.com/index.html
> but getting error when accessing mydomain.com/

Check the access logs to see which server is sending the file.


p

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



Re: MVC or Model2 with Tomcat

2011-12-07 Thread Blaxton





 From: Blaxton 
To: Tomcat Users List  
Sent: Tuesday, December 6, 2011 9:19:00 PM
Subject: Re: MVC or Model2 with Tomcat
 






 From: Pid * 
To: Tomcat Users List  
Sent: Tuesday, December 6, 2011 8:12:40 PM
Subject: Re: MVC or Model2 with Tomcat
 


On 6 Dec 2011, at 15:52, Blaxton  wrote:
>
> I have added the host directive to
 server.xml and moved appexmp1 contents to ROOT directory
> and now I can access www.mydomain.com/index.jsp with no problem,
> however now the servlets are not working.
> I can access jsp files, but no servlets, I get "The requested resource is not 
> available" message.
>
> as with following direction:
> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html#context.xml_-_approach__1
>
> I have created /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml

Ok, please remove the comments from your server.xml and post it inline, here.


> I have placed a HelloWorld.class file in 
> /Catalina_BASE/appname/ROOT/WEB-INF/classes/com/mydomain
> but can't access the class through mydomain.com/app1/HelloWorld

How have you defined the Servlet in
 ROOT/WEB-INF/web.xml?


> tried following context file variations but didn't work:
>
>  crossContext="true">
> 

Never do the above.


>  crossContext="true">
> 

Or that.

The 'path' attribute is not applicable here - in any case it's wrong.

Remove the path and docBase attributes from the ROOT.xml file.


p

> it seems to me , context file is not being read after adding the host 
> directive to server.xml
> either when it is in /Catalina_BASE/conf/Catalina/local host or now that it 
> is in
> /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>
> thanks for help

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


OK, my mistake, I had JkMount /*.jsp and /app1/* rather than JkMount /* in 
httpd-vhost.com
changed it as you mentioned to JkMount /* and servlets works now.

Also removed path and docbase from context.xml
so we can't have default application in ROOT and path in context file ?

haven't tried it , but I think we could achieve the same thing with JkAutoAlias
which one is recommended ? JkAutoAlias or adding host directive in server.xml ?

Thank you very much for help
I achieved what i was looking for.





Sorry but there is one more problem.

now that I have JkMount /* in vhost1_httpd.conf 
every thing will be forwarded to tomcat other than *.html because there is 
a JkUnMount /*.html line in vhost1_httpd.conf but still when I browse
mydomain.com/ I get the tomcat error 
"The requested resource() is not available".
why is that ? 

I have added welcome directive to web.xml as follow:

index.html


and following is DirectoryIndex in vhost1_httpd.conf file:
DirectoryIndex index.jsp index.html index.php

I can access mydomain.com/index.html 
but getting error when accessing mydomain.com/

Thanks

Re: MVC or Model2 with Tomcat

2011-12-06 Thread Pid
On 06/12/2011 17:49, Blaxton wrote:
> 
> 
> 
> 
> 
>  From: Pid * 
> To: Tomcat Users List  
> Sent: Tuesday, December 6, 2011 8:12:40 PM
> Subject: Re: MVC or Model2 with Tomcat
>  
> 
> 
> On 6 Dec 2011, at 15:52, Blaxton  wrote:
>>
>> I have added the host directive to server.xml and moved appexmp1 contents to 
>> ROOT directory
>> and now I can access www.mydomain.com/index.jsp with no problem,
>> however now the servlets are not working.
>> I can access jsp files, but no servlets, I get "The requested resource is 
>> not available" message.
>>
>> as with following direction:
>> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html#context.xml_-_approach__1
>>
>> I have created /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
> 
> Ok, please remove the comments from your server.xml and post it inline, here.
> 
> 
>> I have placed a HelloWorld.class file in 
>> /Catalina_BASE/appname/ROOT/WEB-INF/classes/com/mydomain
>> but can't access the class through mydomain.com/app1/HelloWorld
> 
> How have you defined the Servlet in ROOT/WEB-INF/web.xml?
> 
> 
>> tried following context file variations but didn't work:
>>
>> > crossContext="true">
>> 
> 
> Never do the above.
> 
> 
>> > crossContext="true">
>> 
> 
> Or that.
> 
> The 'path' attribute is not applicable here - in any case it's wrong.
> 
> Remove the path and docBase attributes from the ROOT.xml file.
> 
> 
> p
> 
>> it seems to me , context file is not being read after adding the host 
>> directive to server.xml
>> either when it is in /Catalina_BASE/conf/Catalina/local host or now that it 
>> is in
>> /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>>
>> thanks for help
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> OK, my mistake, I had JkMount /*.jsp and /app1/* rather than JkMount /* in 
> httpd-vhost.com
> changed it as you mentioned to JkMount /* and servlets works now.
> 
> Also removed path and docbase from context.xml
> so we can't have default application in ROOT and path in context file ?

The path attribute isn't valid, except if the Context is defined inline
in server.xml which is *strongly discouraged*.

Using the special name 'ROOT' is required, because normally the .war
file name, the context file in conf/Catalina/hostname/.xml or
exploded directory name is used to provide the path exposed in the HTTP URL.

The default application would therefore have an empty filename, which
isn't such a good thing - so 'ROOT' is used instead.


> haven't tried it , but I think we could achieve the same thing with 
> JkAutoAlias
> which one is recommended ? JkAutoAlias or adding host directive in server.xml 
> ?

I don't think that they're comparable.


p


> Thank you very much for help
> I achieved what i was looking for.


-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: MVC or Model2 with Tomcat

2011-12-06 Thread Blaxton





 From: Pid * 
To: Tomcat Users List  
Sent: Tuesday, December 6, 2011 8:12:40 PM
Subject: Re: MVC or Model2 with Tomcat
 


On 6 Dec 2011, at 15:52, Blaxton  wrote:
>
> I have added the host directive to server.xml and moved appexmp1 contents to 
> ROOT directory
> and now I can access www.mydomain.com/index.jsp with no problem,
> however now the servlets are not working.
> I can access jsp files, but no servlets, I get "The requested resource is not 
> available" message.
>
> as with following direction:
> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html#context.xml_-_approach__1
>
> I have created /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml

Ok, please remove the comments from your server.xml and post it inline, here.


> I have placed a HelloWorld.class file in 
> /Catalina_BASE/appname/ROOT/WEB-INF/classes/com/mydomain
> but can't access the class through mydomain.com/app1/HelloWorld

How have you defined the Servlet in ROOT/WEB-INF/web.xml?


> tried following context file variations but didn't work:
>
>  crossContext="true">
> 

Never do the above.


>  crossContext="true">
> 

Or that.

The 'path' attribute is not applicable here - in any case it's wrong.

Remove the path and docBase attributes from the ROOT.xml file.


p

> it seems to me , context file is not being read after adding the host 
> directive to server.xml
> either when it is in /Catalina_BASE/conf/Catalina/local host or now that it 
> is in
> /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>
> thanks for help

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


OK, my mistake, I had JkMount /*.jsp and /app1/* rather than JkMount /* in 
httpd-vhost.com
changed it as you mentioned to JkMount /* and servlets works now.

Also removed path and docbase from context.xml
so we can't have default application in ROOT and path in context file ?

haven't tried it , but I think we could achieve the same thing with JkAutoAlias
which one is recommended ? JkAutoAlias or adding host directive in server.xml ?

Thank you very much for help
I achieved what i was looking for.

Re: MVC or Model2 with Tomcat

2011-12-06 Thread Pid *


On 6 Dec 2011, at 15:52, Blaxton  wrote:
>
> I have added the host directive to server.xml and moved appexmp1 contents to 
> ROOT directory
> and now I can access www.mydomain.com/index.jsp with no problem,
> however now the servlets are not working.
> I can access jsp files, but no servlets, I get "The requested resource is not 
> available" message.
>
> as with following direction:
> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html#context.xml_-_approach__1
>
> I have created /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml

Ok, please remove the comments from your server.xml and post it inline, here.


> I have placed a HelloWorld.class file in 
> /Catalina_BASE/appname/ROOT/WEB-INF/classes/com/mydomain
> but can't access the class through mydomain.com/app1/HelloWorld

How have you defined the Servlet in ROOT/WEB-INF/web.xml?


> tried following context file variations but didn't work:
>
>  crossContext="true">
> 

Never do the above.


>  crossContext="true">
> 

Or that.

The 'path' attribute is not applicable here - in any case it's wrong.

Remove the path and docBase attributes from the ROOT.xml file.


p

> it seems to me , context file is not being read after adding the host 
> directive to server.xml
> either when it is in /Catalina_BASE/conf/Catalina/local host or now that it 
> is in
> /Catalina_BASE/appexmp1/ROOT/META-INF/context.xml
>
> thanks for help

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



Re: MVC or Model2 with Tomcat

2011-12-06 Thread Blaxton





 From: André Warnier 
To: Tomcat Users List  
Sent: Monday, December 5, 2011 4:13:33 AM
Subject: Re: MVC or Model2 with Tomcat
 
Blaxton wrote:
> 
> 
> 
> 
>  From: André Warnier 
> To: Tomcat Users List  
> Sent: Monday, December 5, 2011 2:00:09 AM
> Subject: Re: MVC or Model2 with Tomcat
>  
> Blaxton wrote:
>>
>>
>> 
>>   From: Pid * 
>> To: Tomcat Users List  
>> Sent: Sunday, December 4, 2011 11:10:08 PM
>> Subject: Re: MVC or Model2 with Tomcat
>>  
>> On 4 Dec 2011, at 16:17, Blaxton  wrote:
>>
>>>
>>>
>>> ____
>>> From: André Warnier 
>>> To: Tomcat Users List 
>>> Sent: Sunday, December 4, 2011 6:51:58 PM
>>> Subject: Re: MVC or Model2 with Tomcat
>>>
>>> Blaxton wrote:
>>>> I have created ROOT directory and placed index.jsp in ROOT directory
>>>> the same as your example:
>>>> /path/to/appbase/ROOT/index.jsp    -> myhost.com/index.jsp
>>>>
>>>> but that didn't work.
>>>>
>>>> I followed following instructions but those didn't work either.
>>>>
>>>> http://www.jguru.com/faq/view.jsp?EID=91006
>>>>
>>>> http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F
>>>>
>>>> is there any thing else I should do to work this out?
>>>>
>>> I wrote that second faq, but I don't see what it has to do with your 
>>> problem.
>>>
>>> You haven't answered Pid's question :
>>>
>>>> Why do you need to do that to implement MVC?
>>> Nor his second question :
>>>
>>>> Without more information about your config, e.g. workers.properties it's
>>>> impossible to tell why this didn't work.
>>> And please, do not top-post.  It is very hard to follow a discussion when 
>>> you have to jump up and down in the mesage to understand what each phrase 
>>> relates to.
>>>
>>> Also, thank you for providing the versions of Apache httpd and Tomcat 
>>> up-front.
>>> But "mod_jk version 2", that does not exist.
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>> My bad, the subject should have been "serving .jsp files from apache 
>>> document root"
>>> I just want to access my website as follow:
>>> www.mydomain.com/index.jsp
>>>
>>> the same as the solustion you wrote, but that solustion didn't work for me.
>>> maybe because in that solution you were talking about
>>> CATALINA_BASE/webapps/ROOT directory
>>> and I created CATALINA_BASE/webapps/myapplication/ROOT directory.
>>>
>>> can we have ROOT directory for each application ?
>>> like:
>>>
>>> CATALINA_BASE/webapps/ROOT
>>> CATALINA_BASE/webapps/firstapp/ROOT
>>> CATALINA_BASE/webapps/secondapp/ROOT
>> No, you can't. None of the docs day you can.
>>
>> ROOT is the special name for the default application, which serves
>> resources from / and handles all requests which are not handled by
>> other applications.
>>
>> Putting ROOT inside other apps just results in publishing that whole
>> dir as /appname/ROOT.
>>
>> If you don't provide other details of your config, no-one here will be
>> able to help, without a really, really lucky guess.
>>
>>
>> p
>>
>>
>>> anyway, here is the out put of the package query on my FreeBSD box:
>>> ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using 
>>> AJP1X
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>>
>> Its a virtual host with following lines have been added to main httpd.conf:
>> LoadModule jk_module          libexec/apache22/mod_jk.so
>> JkWorkersFile /usr/local/etc/apache22/workers.properties
>> JkShmFile     /var/log/mod_jk.shm
>> JkLogFile     /var/log/mod_jk.log
>> JkLogLevel   debug 
>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>
>> 

Re: MVC or Model2 with Tomcat

2011-12-05 Thread Pid

>> anyway, here is the out put of the package query on my FreeBSD box:
>> ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using 
>> AJP1X
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 
> Its a virtual host with following lines have been added to main httpd.conf:
> LoadModule jk_module  libexec/apache22/mod_jk.so
> JkWorkersFile /usr/local/etc/apache22/workers.properties
> JkShmFile /var/log/mod_jk.shm
> JkLogFile /var/log/mod_jk.log
> JkLogLevel   debug 
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> 
> and following JkMount directives for each virtual host:
> JkMount  /appexmp1/* appexmp1
> JkMount  /appexmp1/*.jsp appexmp1
> 
> and following is the worker file for two of the sites:
> worker.list=appexmp2,appexmp1
> worker.appexmp2.type=ajp13
> worker.appexmp2.host=localhost
> worker.appexmp2.port=8009
> worker.appexmp1.type=ajp13
> worker.appexmp1.host=localhost
> worker.appexmp1.port=8109
> 
> 
> Created separate directories in CATALINA_BASE/webapps/
> for each application so , it contain following directories:
> CATALINA_BASE/webapps/ROOT
> CATALINA_BASE/webapps/appexmp1
> CATALINA_BASE/webapps/appexmp2
> 
> context file for each application resides in 
> CATALINA_BASE/conf/Catalina/localhost for example:
> CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml
> CATALINA_BASE/conf/Catalina/localhost/appexmp2.xml
> 
> cat  CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml
>  crossContext="true">
> 

path & docBase are surplus to requirements here.  debug is no longer
functional.



> and web.xml file as follow:
> cat CATALINA_BASE/webapps/appexmp1/WEB-INF/web.xml
> http://java.sun.com/xml/ns/javaee"; version="2.5">
> 
> App1
> com.appexmp1.App1
>   
> 
>   
> App1
> /APP1
>   
> 
>   
> index.jsp
>   
> 
> 


> I already can access mydomain.com/App1/index.jsp and every thing works fine
> but want to be able to serve .jsp files as follow:
> mydomain.com/index.jsp
> for each of my virtual hosts.

If the ROOT application is just a default one, you can remove it.
You will need a separate appBase for each virtual host.

In server.xml, define multiple hosts, with _separate_ appBase's:

 
 

 
 

copy appexmp1 and appexmp2 into the appBase & rename them 'ROOT'.
Your app is now the default app in each host, so in each HTTPD virtual
host, add:

 JkMount  /* appexmp1



p




-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: MVC or Model2 with Tomcat

2011-12-04 Thread Blaxton





 From: André Warnier 
To: Tomcat Users List  
Sent: Monday, December 5, 2011 4:13:33 AM
Subject: Re: MVC or Model2 with Tomcat
 
Blaxton wrote:
> 
> 
> 
> 
>  From: André Warnier 
> To: Tomcat Users List  
> Sent: Monday, December 5, 2011 2:00:09 AM
> Subject: Re: MVC or Model2 with Tomcat
>  
> Blaxton wrote:
>>
>>
>> 
>>   From: Pid * 
>> To: Tomcat Users List  
>> Sent: Sunday, December 4, 2011 11:10:08 PM
>> Subject: Re: MVC or Model2 with Tomcat
>>  
>> On 4 Dec 2011, at 16:17, Blaxton  wrote:
>>
>>>
>>>
>>> ____
>>> From: André Warnier 
>>> To: Tomcat Users List 
>>> Sent: Sunday, December 4, 2011 6:51:58 PM
>>> Subject: Re: MVC or Model2 with Tomcat
>>>
>>> Blaxton wrote:
>>>> I have created ROOT directory and placed index.jsp in ROOT directory
>>>> the same as your example:
>>>> /path/to/appbase/ROOT/index.jsp    -> myhost.com/index.jsp
>>>>
>>>> but that didn't work.
>>>>
>>>> I followed following instructions but those didn't work either.
>>>>
>>>> http://www.jguru.com/faq/view.jsp?EID=91006
>>>>
>>>> http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F
>>>>
>>>> is there any thing else I should do to work this out?
>>>>
>>> I wrote that second faq, but I don't see what it has to do with your 
>>> problem.
>>>
>>> You haven't answered Pid's question :
>>>
>>>> Why do you need to do that to implement MVC?
>>> Nor his second question :
>>>
>>>> Without more information about your config, e.g. workers.properties it's
>>>> impossible to tell why this didn't work.
>>> And please, do not top-post.  It is very hard to follow a discussion when 
>>> you have to jump up and down in the mesage to understand what each phrase 
>>> relates to.
>>>
>>> Also, thank you for providing the versions of Apache httpd and Tomcat 
>>> up-front.
>>> But "mod_jk version 2", that does not exist.
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>> My bad, the subject should have been "serving .jsp files from apache 
>>> document root"
>>> I just want to access my website as follow:
>>> www.mydomain.com/index.jsp
>>>
>>> the same as the solustion you wrote, but that solustion didn't work for me.
>>> maybe because in that solution you were talking about
>>> CATALINA_BASE/webapps/ROOT directory
>>> and I created CATALINA_BASE/webapps/myapplication/ROOT directory.
>>>
>>> can we have ROOT directory for each application ?
>>> like:
>>>
>>> CATALINA_BASE/webapps/ROOT
>>> CATALINA_BASE/webapps/firstapp/ROOT
>>> CATALINA_BASE/webapps/secondapp/ROOT
>> No, you can't. None of the docs day you can.
>>
>> ROOT is the special name for the default application, which serves
>> resources from / and handles all requests which are not handled by
>> other applications.
>>
>> Putting ROOT inside other apps just results in publishing that whole
>> dir as /appname/ROOT.
>>
>> If you don't provide other details of your config, no-one here will be
>> able to help, without a really, really lucky guess.
>>
>>
>> p
>>
>>
>>> anyway, here is the out put of the package query on my FreeBSD box:
>>> ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using 
>>> AJP1X
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>>
>> Its a virtual host with following lines have been added to main httpd.conf:
>> LoadModule jk_module          libexec/apache22/mod_jk.so
>> JkWorkersFile /usr/local/etc/apache22/workers.properties
>> JkShmFile     /var/log/mod_jk.shm
>> JkLogFile     /var/log/mod_jk.log
>> JkLogLevel   debug 
>> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
>>
>> 

Re: MVC or Model2 with Tomcat

2011-12-04 Thread André Warnier

Blaxton wrote:





 From: André Warnier 
To: Tomcat Users List  
Sent: Monday, December 5, 2011 2:00:09 AM

Subject: Re: MVC or Model2 with Tomcat
 
Blaxton wrote:




  From: Pid * 
To: Tomcat Users List  
Sent: Sunday, December 4, 2011 11:10:08 PM

Subject: Re: MVC or Model2 with Tomcat
  
On 4 Dec 2011, at 16:17, Blaxton  wrote:






From: André Warnier 
To: Tomcat Users List 
Sent: Sunday, December 4, 2011 6:51:58 PM
Subject: Re: MVC or Model2 with Tomcat

Blaxton wrote:

I have created ROOT directory and placed index.jsp in ROOT directory
the same as your example:
/path/to/appbase/ROOT/index.jsp-> myhost.com/index.jsp

but that didn't work.

I followed following instructions but those didn't work either.

http://www.jguru.com/faq/view.jsp?EID=91006

http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F

is there any thing else I should do to work this out?


I wrote that second faq, but I don't see what it has to do with your problem.

You haven't answered Pid's question :


Why do you need to do that to implement MVC?

Nor his second question :


Without more information about your config, e.g. workers.properties it's
impossible to tell why this didn't work.

And please, do not top-post.  It is very hard to follow a discussion when you 
have to jump up and down in the mesage to understand what each phrase relates 
to.

Also, thank you for providing the versions of Apache httpd and Tomcat up-front.
But "mod_jk version 2", that does not exist.

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


My bad, the subject should have been "serving .jsp files from apache document 
root"
I just want to access my website as follow:
www.mydomain.com/index.jsp

the same as the solustion you wrote, but that solustion didn't work for me.
maybe because in that solution you were talking about
CATALINA_BASE/webapps/ROOT directory
and I created CATALINA_BASE/webapps/myapplication/ROOT directory.

can we have ROOT directory for each application ?
like:

CATALINA_BASE/webapps/ROOT
CATALINA_BASE/webapps/firstapp/ROOT
CATALINA_BASE/webapps/secondapp/ROOT

No, you can't. None of the docs day you can.

ROOT is the special name for the default application, which serves
resources from / and handles all requests which are not handled by
other applications.

Putting ROOT inside other apps just results in publishing that whole
dir as /appname/ROOT.

If you don't provide other details of your config, no-one here will be
able to help, without a really, really lucky guess.


p



anyway, here is the out put of the package query on my FreeBSD box:
ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using AJP1X

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



Its a virtual host with following lines have been added to main httpd.conf:
LoadModule jk_module  libexec/apache22/mod_jk.so
JkWorkersFile /usr/local/etc/apache22/workers.properties
JkShmFile /var/log/mod_jk.shm
JkLogFile /var/log/mod_jk.log
JkLogLevel   debug 
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


and following JkMount directives for each virtual host:
JkMount  /appexmp1/* appexmp1
JkMount  /appexmp1/*.jsp appexmp1

and following is the worker file for two of the sites:
worker.list=appexmp2,appexmp1
worker.appexmp2.type=ajp13
worker.appexmp2.host=localhost
worker.appexmp2.port=8009
worker.appexmp1.type=ajp13
worker.appexmp1.host=localhost
worker.appexmp1.port=8109


Created separate directories in CATALINA_BASE/webapps/
for each application so , it contain following directories:
CATALINA_BASE/webapps/ROOT
CATALINA_BASE/webapps/appexmp1
CATALINA_BASE/webapps/appexmp2

context file for each application resides in 
CATALINA_BASE/conf/Catalina/localhost for example:

CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml
CATALINA_BASE/conf/Catalina/localhost/appexmp2.xml

cat  CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml



and web.xml file as follow:
cat CATALINA_BASE/webapps/appexmp1/WEB-INF/web.xml
http://java.sun.com/xml/ns/javaee"; version="2.5">

 App1
 com.appexmp1.App1
   

   
 App1
 /APP1
   

   
 index.jsp
   




I already can access mydomain.com/App1/index.jsp and every thing works fine
but want to be able to serve .jsp files as follow:
mydomain.com/index.jsp
for each of my virtual hosts.

I hope I have provided enough information.


No. :-)

What we are still missing, is how you have defined the DocumentRoot in each of your Apache 
httpd VirtualHost's. And a

Re: MVC or Model2 with Tomcat

2011-12-04 Thread Blaxton





 From: André Warnier 
To: Tomcat Users List  
Sent: Monday, December 5, 2011 2:00:09 AM
Subject: Re: MVC or Model2 with Tomcat
 
Blaxton wrote:
> 
> 
> 
> 
>  From: Pid * 
> To: Tomcat Users List  
> Sent: Sunday, December 4, 2011 11:10:08 PM
> Subject: Re: MVC or Model2 with Tomcat
>  
> On 4 Dec 2011, at 16:17, Blaxton  wrote:
> 
>>
>>
>>
>> 
>> From: André Warnier 
>> To: Tomcat Users List 
>> Sent: Sunday, December 4, 2011 6:51:58 PM
>> Subject: Re: MVC or Model2 with Tomcat
>>
>> Blaxton wrote:
>>> I have created ROOT directory and placed index.jsp in ROOT directory
>>> the same as your example:
>>> /path/to/appbase/ROOT/index.jsp    -> myhost.com/index.jsp
>>>
>>> but that didn't work.
>>>
>>> I followed following instructions but those didn't work either.
>>>
>>> http://www.jguru.com/faq/view.jsp?EID=91006
>>>
>>> http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F
>>>
>>> is there any thing else I should do to work this out?
>>>
>> I wrote that second faq, but I don't see what it has to do with your problem.
>>
>> You haven't answered Pid's question :
>>
>>> Why do you need to do that to implement MVC?
>> Nor his second question :
>>
>>> Without more information about your config, e.g. workers.properties it's
>>> impossible to tell why this didn't work.
>> And please, do not top-post.  It is very hard to follow a discussion when 
>> you have to jump up and down in the mesage to understand what each phrase 
>> relates to.
>>
>> Also, thank you for providing the versions of Apache httpd and Tomcat 
>> up-front.
>> But "mod_jk version 2", that does not exist.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>> My bad, the subject should have been "serving .jsp files from apache 
>> document root"
>> I just want to access my website as follow:
>> www.mydomain.com/index.jsp
>>
>> the same as the solustion you wrote, but that solustion didn't work for me.
>> maybe because in that solution you were talking about
>> CATALINA_BASE/webapps/ROOT directory
>> and I created CATALINA_BASE/webapps/myapplication/ROOT directory.
>>
>> can we have ROOT directory for each application ?
>> like:
>>
>> CATALINA_BASE/webapps/ROOT
>> CATALINA_BASE/webapps/firstapp/ROOT
>> CATALINA_BASE/webapps/secondapp/ROOT
> 
> No, you can't. None of the docs day you can.
> 
> ROOT is the special name for the default application, which serves
> resources from / and handles all requests which are not handled by
> other applications.
> 
> Putting ROOT inside other apps just results in publishing that whole
> dir as /appname/ROOT.
> 
> If you don't provide other details of your config, no-one here will be
> able to help, without a really, really lucky guess.
> 
> 
> p
> 
> 
>> anyway, here is the out put of the package query on my FreeBSD box:
>> ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using 
>> AJP1X
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 
> Its a virtual host with following lines have been added to main httpd.conf:
> LoadModule jk_module          libexec/apache22/mod_jk.so
> JkWorkersFile /usr/local/etc/apache22/workers.properties
> JkShmFile     /var/log/mod_jk.shm
> JkLogFile     /var/log/mod_jk.log
> JkLogLevel   debug 
> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
> 
> and following JkMount directives for each virtual host:
> JkMount  /appexmp1/*     appexmp1
> JkMount  /appexmp1/*.jsp appexmp1
> 
> and following is the worker file for two of the sites:
> worker.list=appexmp2,appexmp1
> worker.appexmp2.type=ajp13
> worker.appexmp2.host=localhost
> worker.appexmp2.port=8009
> worker.appexmp1.type=ajp13
> worker.appexmp1.host=localhost
> worker.appexmp1.port=8109
> 
> 
> Created separate directories in CATALINA_BASE/webapps/
> for each application so , it contain following directories:
> CATALINA_BASE/webapps/ROOT
> CATALINA_BASE/webapps/

Re: MVC or Model2 with Tomcat

2011-12-04 Thread André Warnier

Blaxton wrote:





 From: Pid * 
To: Tomcat Users List  
Sent: Sunday, December 4, 2011 11:10:08 PM

Subject: Re: MVC or Model2 with Tomcat
 
On 4 Dec 2011, at 16:17, Blaxton  wrote:







From: André Warnier 
To: Tomcat Users List 
Sent: Sunday, December 4, 2011 6:51:58 PM
Subject: Re: MVC or Model2 with Tomcat

Blaxton wrote:

I have created ROOT directory and placed index.jsp in ROOT directory
the same as your example:
/path/to/appbase/ROOT/index.jsp-> myhost.com/index.jsp

but that didn't work.

I followed following instructions but those didn't work either.

http://www.jguru.com/faq/view.jsp?EID=91006

http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F

is there any thing else I should do to work this out?


I wrote that second faq, but I don't see what it has to do with your problem.

You haven't answered Pid's question :


Why do you need to do that to implement MVC?

Nor his second question :


Without more information about your config, e.g. workers.properties it's
impossible to tell why this didn't work.

And please, do not top-post.  It is very hard to follow a discussion when you 
have to jump up and down in the mesage to understand what each phrase relates 
to.

Also, thank you for providing the versions of Apache httpd and Tomcat up-front.
But "mod_jk version 2", that does not exist.

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


My bad, the subject should have been "serving .jsp files from apache document 
root"
I just want to access my website as follow:
www.mydomain.com/index.jsp

the same as the solustion you wrote, but that solustion didn't work for me.
maybe because in that solution you were talking about
CATALINA_BASE/webapps/ROOT directory
and I created CATALINA_BASE/webapps/myapplication/ROOT directory.

can we have ROOT directory for each application ?
like:

CATALINA_BASE/webapps/ROOT
CATALINA_BASE/webapps/firstapp/ROOT
CATALINA_BASE/webapps/secondapp/ROOT


No, you can't. None of the docs day you can.

ROOT is the special name for the default application, which serves
resources from / and handles all requests which are not handled by
other applications.

Putting ROOT inside other apps just results in publishing that whole
dir as /appname/ROOT.

If you don't provide other details of your config, no-one here will be
able to help, without a really, really lucky guess.


p



anyway, here is the out put of the package query on my FreeBSD box:
ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using AJP1X


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



Its a virtual host with following lines have been added to main httpd.conf:
LoadModule jk_module  libexec/apache22/mod_jk.so
JkWorkersFile /usr/local/etc/apache22/workers.properties
JkShmFile /var/log/mod_jk.shm
JkLogFile /var/log/mod_jk.log
JkLogLevel   debug 
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


and following JkMount directives for each virtual host:
JkMount  /appexmp1/* appexmp1
JkMount  /appexmp1/*.jsp appexmp1

and following is the worker file for two of the sites:
worker.list=appexmp2,appexmp1
worker.appexmp2.type=ajp13
worker.appexmp2.host=localhost
worker.appexmp2.port=8009
worker.appexmp1.type=ajp13
worker.appexmp1.host=localhost
worker.appexmp1.port=8109


Created separate directories in CATALINA_BASE/webapps/
for each application so , it contain following directories:
CATALINA_BASE/webapps/ROOT
CATALINA_BASE/webapps/appexmp1
CATALINA_BASE/webapps/appexmp2

context file for each application resides in 
CATALINA_BASE/conf/Catalina/localhost for example:

CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml
CATALINA_BASE/conf/Catalina/localhost/appexmp2.xml

cat  CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml



and web.xml file as follow:
cat CATALINA_BASE/webapps/appexmp1/WEB-INF/web.xml
http://java.sun.com/xml/ns/javaee"; version="2.5">

App1
com.appexmp1.App1
  

  
App1
/APP1
  

  
index.jsp
  




I already can access mydomain.com/App1/index.jsp and every thing works fine
but want to be able to serve .jsp files as follow:
mydomain.com/index.jsp
for each of my virtual hosts.

I hope I have provided enough information.


No. :-)

What we are still missing, is how you have defined the DocumentRoot in each of your Apache 
httpd VirtualHost's. And also any Alias directive which mentions "App1".


Because with your above setup, calling "mydomain.com/App1/index.jsp" can only work, if you 
have allowed Apache httpd to access y

Re: MVC or Model2 with Tomcat

2011-12-04 Thread Blaxton





 From: Pid * 
To: Tomcat Users List  
Sent: Sunday, December 4, 2011 11:10:08 PM
Subject: Re: MVC or Model2 with Tomcat
 
On 4 Dec 2011, at 16:17, Blaxton  wrote:

>
>
>
>
> 
> From: André Warnier 
> To: Tomcat Users List 
> Sent: Sunday, December 4, 2011 6:51:58 PM
> Subject: Re: MVC or Model2 with Tomcat
>
> Blaxton wrote:
>> I have created ROOT directory and placed index.jsp in ROOT directory
>> the same as your example:
>> /path/to/appbase/ROOT/index.jsp    -> myhost.com/index.jsp
>>
>> but that didn't work.
>>
>> I followed following instructions but those didn't work either.
>>
>> http://www.jguru.com/faq/view.jsp?EID=91006
>>
>> http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F
>>
>> is there any thing else I should do to work this out?
>>
>
> I wrote that second faq, but I don't see what it has to do with your problem.
>
> You haven't answered Pid's question :
>
>> Why do you need to do that to implement MVC?
>
> Nor his second question :
>
>> Without more information about your config, e.g. workers.properties it's
>> impossible to tell why this didn't work.
>
> And please, do not top-post.  It is very hard to follow a discussion when you 
> have to jump up and down in the mesage to understand what each phrase relates 
> to.
>
> Also, thank you for providing the versions of Apache httpd and Tomcat 
> up-front.
> But "mod_jk version 2", that does not exist.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
> My bad, the subject should have been "serving .jsp files from apache document 
> root"
> I just want to access my website as follow:
> www.mydomain.com/index.jsp
>
> the same as the solustion you wrote, but that solustion didn't work for me.
> maybe because in that solution you were talking about
> CATALINA_BASE/webapps/ROOT directory
> and I created CATALINA_BASE/webapps/myapplication/ROOT directory.
>
> can we have ROOT directory for each application ?
> like:
>
> CATALINA_BASE/webapps/ROOT
> CATALINA_BASE/webapps/firstapp/ROOT
> CATALINA_BASE/webapps/secondapp/ROOT

No, you can't. None of the docs day you can.

ROOT is the special name for the default application, which serves
resources from / and handles all requests which are not handled by
other applications.

Putting ROOT inside other apps just results in publishing that whole
dir as /appname/ROOT.

If you don't provide other details of your config, no-one here will be
able to help, without a really, really lucky guess.


p


> anyway, here is the out put of the package query on my FreeBSD box:
> ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using AJP1X

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



Its a virtual host with following lines have been added to main httpd.conf:
LoadModule jk_module  libexec/apache22/mod_jk.so
JkWorkersFile /usr/local/etc/apache22/workers.properties
JkShmFile /var/log/mod_jk.shm
JkLogFile /var/log/mod_jk.log
JkLogLevel   debug 
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

and following JkMount directives for each virtual host:
JkMount  /appexmp1/* appexmp1
JkMount  /appexmp1/*.jsp appexmp1

and following is the worker file for two of the sites:
worker.list=appexmp2,appexmp1
worker.appexmp2.type=ajp13
worker.appexmp2.host=localhost
worker.appexmp2.port=8009
worker.appexmp1.type=ajp13
worker.appexmp1.host=localhost
worker.appexmp1.port=8109


Created separate directories in CATALINA_BASE/webapps/
for each application so , it contain following directories:
CATALINA_BASE/webapps/ROOT
CATALINA_BASE/webapps/appexmp1
CATALINA_BASE/webapps/appexmp2

context file for each application resides in 
CATALINA_BASE/conf/Catalina/localhost for example:
CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml
CATALINA_BASE/conf/Catalina/localhost/appexmp2.xml

cat  CATALINA_BASE/conf/Catalina/localhost/appexmp1.xml



and web.xml file as follow:
cat CATALINA_BASE/webapps/appexmp1/WEB-INF/web.xml
http://java.sun.com/xml/ns/javaee"; version="2.5">

    App1
    com.appexmp1.App1
  

  
    App1
    /APP1
  

  
    index.jsp
  




I already can access mydomain.com/App1/index.jsp and every thing works fine
but want to be able to serve .jsp files as follow:
mydomain.com/index.jsp
for each of my virtual hosts.

I hope I have provided enough information.

Thanks for help

Re: MVC or Model2 with Tomcat

2011-12-04 Thread Pid *
On 4 Dec 2011, at 16:17, Blaxton  wrote:

>
>
>
>
> 
> From: André Warnier 
> To: Tomcat Users List 
> Sent: Sunday, December 4, 2011 6:51:58 PM
> Subject: Re: MVC or Model2 with Tomcat
>
> Blaxton wrote:
>> I have created ROOT directory and placed index.jsp in ROOT directory
>> the same as your example:
>> /path/to/appbase/ROOT/index.jsp-> myhost.com/index.jsp
>>
>> but that didn't work.
>>
>> I followed following instructions but those didn't work either.
>>
>> http://www.jguru.com/faq/view.jsp?EID=91006
>>
>> http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F
>>
>> is there any thing else I should do to work this out?
>>
>
> I wrote that second faq, but I don't see what it has to do with your problem.
>
> You haven't answered Pid's question :
>
>> Why do you need to do that to implement MVC?
>
> Nor his second question :
>
>> Without more information about your config, e.g. workers.properties it's
>> impossible to tell why this didn't work.
>
> And please, do not top-post.  It is very hard to follow a discussion when you 
> have to jump up and down in the mesage to understand what each phrase relates 
> to.
>
> Also, thank you for providing the versions of Apache httpd and Tomcat 
> up-front.
> But "mod_jk version 2", that does not exist.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
> My bad, the subject should have been "serving .jsp files from apache document 
> root"
> I just want to access my website as follow:
> www.mydomain.com/index.jsp
>
> the same as the solustion you wrote, but that solustion didn't work for me.
> maybe because in that solution you were talking about
> CATALINA_BASE/webapps/ROOT directory
> and I created CATALINA_BASE/webapps/myapplication/ROOT directory.
>
> can we have ROOT directory for each application ?
> like:
>
> CATALINA_BASE/webapps/ROOT
> CATALINA_BASE/webapps/firstapp/ROOT
> CATALINA_BASE/webapps/secondapp/ROOT

No, you can't. None of the docs day you can.

ROOT is the special name for the default application, which serves
resources from / and handles all requests which are not handled by
other applications.

Putting ROOT inside other apps just results in publishing that whole
dir as /appname/ROOT.

If you don't provide other details of your config, no-one here will be
able to help, without a really, really lucky guess.


p


> anyway, here is the out put of the package query on my FreeBSD box:
> ap22-mo_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using AJP1X

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



Re: MVC or Model2 with Tomcat

2011-12-04 Thread Blaxton





 From: André Warnier 
To: Tomcat Users List  
Sent: Sunday, December 4, 2011 6:51:58 PM
Subject: Re: MVC or Model2 with Tomcat
 
Blaxton wrote:
> I have created ROOT directory and placed index.jsp in ROOT directory
> the same as your example:
> /path/to/appbase/ROOT/index.jsp    -> myhost.com/index.jsp
> 
> but that didn't work. 
> 
> I followed following instructions but those didn't work either.
> 
> http://www.jguru.com/faq/view.jsp?EID=91006
> 
> http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F
> 
> is there any thing else I should do to work this out?
> 

I wrote that second faq, but I don't see what it has to do with your problem.

You haven't answered Pid's question :

> Why do you need to do that to implement MVC?

Nor his second question :

> Without more information about your config, e.g. workers.properties it's
> impossible to tell why this didn't work.

And please, do not top-post.  It is very hard to follow a discussion when you 
have to jump up and down in the mesage to understand what each phrase relates 
to.

Also, thank you for providing the versions of Apache httpd and Tomcat up-front.
But "mod_jk version 2", that does not exist.

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


My bad, the subject should have been "serving .jsp files from apache document 
root"
I just want to access my website as follow:
www.mydomain.com/index.jsp

the same as the solustion you wrote, but that solustion didn't work for me.
maybe because in that solution you were talking about 
CATALINA_BASE/webapps/ROOT directory
and I created CATALINA_BASE/webapps/myapplication/ROOT directory.

can we have ROOT directory for each application ?
like:

CATALINA_BASE/webapps/ROOT
CATALINA_BASE/webapps/firstapp/ROOT
CATALINA_BASE/webapps/secondapp/ROOT
.
.
.


anyway, here is the out put of the package query on my FreeBSD box:
ap22-mod_jk-ap2-1.2.30_1 Apache2 JK module for connecting to Tomcat using AJP1X


Thanks

Re: MVC or Model2 with Tomcat

2011-12-04 Thread André Warnier

Blaxton wrote:

I have created ROOT directory and placed index.jsp in ROOT directory
the same as your example:
/path/to/appbase/ROOT/index.jsp-> myhost.com/index.jsp

but that didn't work. 



I followed following instructions but those didn't work either.

http://www.jguru.com/faq/view.jsp?EID=91006

http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F

is there any thing else I should do to work this out?



I wrote that second faq, but I don't see what it has to do with your problem.

You haven't answered Pid's question :

> Why do you need to do that to implement MVC?

Nor his second question :

> Without more information about your config, e.g. workers.properties it's
> impossible to tell why this didn't work.

And please, do not top-post.  It is very hard to follow a discussion when you have to jump 
up and down in the mesage to understand what each phrase relates to.


Also, thank you for providing the versions of Apache httpd and Tomcat up-front.
But "mod_jk version 2", that does not exist.

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



Re: MVC or Model2 with Tomcat

2011-12-04 Thread Blaxton
I have created ROOT directory and placed index.jsp in ROOT directory
the same as your example:
/path/to/appbase/ROOT/index.jsp    -> myhost.com/index.jsp

but that didn't work. 


I followed following instructions but those didn't work either.

http://www.jguru.com/faq/view.jsp?EID=91006

http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F

is there any thing else I should do to work this out?

just want 






 From: Pid 
To: Tomcat Users List  
Sent: Sunday, December 4, 2011 2:11:22 PM
Subject: Re: MVC or Model2 with Tomcat
 
On 04/12/2011 09:32, Blaxton wrote:
> Apache 2.2.16  is connected to  Tomcat 6.0.29 through mod_jk version 2
> and every thing is working fine, but to implement Model2 or MVC, I need
> to serve JSP files from apache document root and don't know what is 
> the best soluction.

Why do you need to do that to implement MVC?


Mixing Apache HTTPD DocumentRoot and Tomcat appBase's is risky and often
users make mistakes which expose secure data.

Tomcat applications are not comparable with a DocumentRoot.  Each
application is indepedent and may be mapped to path which does not
exactly match the directory name.

Better practice is to separate the two:

/path/to/httpd/docroot/
/path/to/httpd/docroot/index.html  -> myhost.com/index.html
/path/to/httpd/docroot/images

/path/to/appbase/
/path/to/appbase/ROOT
/path/to/appbase/ROOT/index.jsp    -> myhost.com/index.jsp
/path/to/appbase/myapp/index.jsp   -> myhost.com/myapp/index.jsp


> Tried adding following to apache config file but that didn't help serving
> jsp files from apache document root.

Strongly recommend not doing that.


> JkMount /*.jsp ajp13

Without more information about your config, e.g. workers.properties it's
impossible to tell why this didn't work.


> Should i change Apache document root to tomcat's web application root
> to be able to support jsp files in apache document root ?
> 
> Or should i change the Tomcat's docbase to Apache's document root ?

No, definitely not.


> Or it can be done be aliasing in apache config file:
>
> Alias /examples /vat/tomcat3/webapps/examples

No, definitely not.


p



-- 

[key:62590808]

Re: MVC or Model2 with Tomcat

2011-12-04 Thread Pid
On 04/12/2011 09:32, Blaxton wrote:
> Apache 2.2.16  is connected to  Tomcat 6.0.29 through mod_jk version 2
> and every thing is working fine, but to implement Model2 or MVC, I need
> to serve JSP files from apache document root and don't know what is 
> the best soluction.

Why do you need to do that to implement MVC?


Mixing Apache HTTPD DocumentRoot and Tomcat appBase's is risky and often
users make mistakes which expose secure data.

Tomcat applications are not comparable with a DocumentRoot.  Each
application is indepedent and may be mapped to path which does not
exactly match the directory name.

Better practice is to separate the two:

 /path/to/httpd/docroot/
 /path/to/httpd/docroot/index.html  -> myhost.com/index.html
 /path/to/httpd/docroot/images

 /path/to/appbase/
 /path/to/appbase/ROOT
 /path/to/appbase/ROOT/index.jsp-> myhost.com/index.jsp
 /path/to/appbase/myapp/index.jsp   -> myhost.com/myapp/index.jsp


> Tried adding following to apache config file but that didn't help serving
> jsp files from apache document root.

Strongly recommend not doing that.


> JkMount /*.jsp ajp13

Without more information about your config, e.g. workers.properties it's
impossible to tell why this didn't work.


> Should i change Apache document root to tomcat's web application root
> to be able to support jsp files in apache document root ?
> 
> Or should i change the Tomcat's docbase to Apache's document root ?

No, definitely not.


> Or it can be done be aliasing in apache config file:
>
> Alias /examples /vat/tomcat3/webapps/examples

No, definitely not.


p



-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


MVC or Model2 with Tomcat

2011-12-04 Thread Blaxton
Apache 2.2.16  is connected to  Tomcat 6.0.29 through mod_jk version 2
and every thing is working fine, but to implement Model2 or MVC, I need
to serve JSP files from apache document root and don't know what is 
the best soluction.

Tried adding following to apache config file but that didn't help serving
jsp files from apache document root.

JkMount /*.jsp ajp13
Should i change Apache document root to tomcat's web application root
to be able to support jsp files in apache document root ?

Or should i change the Tomcat's docbase to Apache's document root ?

Or it can be done be aliasing in apache config file:

Alias /examples /vat/tomcat3/webapps/examples

Thanks for help