Re: Deploy application as Root

2014-09-14 Thread Kiran Badi
Thanks Sergio, I will give this approach a shot for next deployment.

On Fri, Sep 12, 2014 at 2:31 AM, Sergio Fernández wik...@apache.org wrote:

 Hi,

 On 12/09/14 04:22, Kiran Badi wrote:

 This will be basically myapp2.war ,so how do I manage this deployment so
 that whenever someones gives www.myapp2.com, it should open up ?

 I assume we cannot have 2 root deployment in the same tomcat.


 Usually you can delegate the VirtualHost resolution to a regular HTTP
 server, such as apache2 or nginx, proxing using AJP or any of the available
 connectors.

 BTW, relevant for the question what started this thread, remember that
 Tomcat Manager comes with a basic set of REST web services that you may
 find useful. Without messing with manually removing directories, you can
 just PUT your war to the root context as follows:

 http://localhost:8080/manager/text/deploy?path=%2Fupdate=true

 Further details at the documentation:

 http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.
 html#Supported_Manager_Commands

 Hope that helps.

 Cheers,

 --
 Sergio Fernández
 Partner Technology Manager
 Redlink GmbH
 m: +43 660 2747 925
 e: sergio.fernan...@redlink.co
 w: http://redlink.co


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




Re: Deploy application as Root

2014-09-14 Thread Kiran Badi
Hi Ognjen,

Thanks for information. Let me try this approach. I have another 3 weeks
for doing deployment for first piece of second app.

Probably I will start another fresh thread for few of my doubts.

Thanks and Appreciate your assistance.

- Kiran



On Fri, Sep 12, 2014 at 3:19 AM, Ognjen Blagojevic 
ognjen.d.blagoje...@gmail.com wrote:

 Kiran,

  Question I have is that if I upload war file via manager app, where does
 it
 go ?


 It goes to appBase (e.g. direcotry webapps) as war file, and if neither
 unpackWARs at Host element nor unpackWAR of Context element is set to
 false, they are unpacked to the directory of the same name (e.g.
 webapps/ROOT.war is unpacked to directory webapps/ROOT).


  I can understand that ROOT goes to the ROOT folder if I delete the root
 folder, how about myapp.war ?


 myapp.war will be extracted to directory myapp.


  Does it go to work folder ?


 All web applications are unpacked to appBase folder. Work folder is
 internal Tomcat folder.


 On 12.9.2014 4:22, Kiran Badi wrote:

 However I have another application which I will be deploying in the same
 tomcat.

 This will be basically myapp2.war ,so how do I manage this deployment so
 that whenever someones gives www.myapp2.com, it should open up ?

 I assume we cannot have 2 root deployment in the same tomcat.


 You need to create two webapps directories, e.g. webapps-myapp1 and
 webapps-myapp2, and configure two Host elements in server.xml
 accordignly, e.g.:

   Host name=www.myapp1.com appBase=webapps-myapp1 ...
   Host name=www.myapp2.com appBase=webapps-myapp2 ...

 Then you may deploy two ROOT.war files to two different webapps folders.

 If you want to use Manager application for each of your virtual hosts you
 need to copy directory webapps/manager/ to both webapps-myapp1/manager/ and
 webapps-myapp2/manager/.

 -Ognjen


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




Re: Deploy application as Root

2014-09-12 Thread Sergio Fernández

Hi,

On 12/09/14 04:22, Kiran Badi wrote:

This will be basically myapp2.war ,so how do I manage this deployment so
that whenever someones gives www.myapp2.com, it should open up ?

I assume we cannot have 2 root deployment in the same tomcat.


Usually you can delegate the VirtualHost resolution to a regular HTTP 
server, such as apache2 or nginx, proxing using AJP or any of the 
available connectors.


BTW, relevant for the question what started this thread, remember that 
Tomcat Manager comes with a basic set of REST web services that you may 
find useful. Without messing with manually removing directories, you can 
just PUT your war to the root context as follows:


http://localhost:8080/manager/text/deploy?path=%2Fupdate=true

Further details at the documentation:

http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Supported_Manager_Commands

Hope that helps.

Cheers,

--
Sergio Fernández
Partner Technology Manager
Redlink GmbH
m: +43 660 2747 925
e: sergio.fernan...@redlink.co
w: http://redlink.co

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



Re: Deploy application as Root

2014-09-12 Thread Ognjen Blagojevic

Kiran,


Question I have is that if I upload war file via manager app, where does it
go ?


It goes to appBase (e.g. direcotry webapps) as war file, and if 
neither unpackWARs at Host element nor unpackWAR of Context element is 
set to false, they are unpacked to the directory of the same name 
(e.g. webapps/ROOT.war is unpacked to directory webapps/ROOT).




I can understand that ROOT goes to the ROOT folder if I delete the root
folder, how about myapp.war ?


myapp.war will be extracted to directory myapp.



Does it go to work folder ?


All web applications are unpacked to appBase folder. Work folder is 
internal Tomcat folder.



On 12.9.2014 4:22, Kiran Badi wrote:

However I have another application which I will be deploying in the same
tomcat.

This will be basically myapp2.war ,so how do I manage this deployment so
that whenever someones gives www.myapp2.com, it should open up ?

I assume we cannot have 2 root deployment in the same tomcat.


You need to create two webapps directories, e.g. webapps-myapp1 and 
webapps-myapp2, and configure two Host elements in server.xml 
accordignly, e.g.:


  Host name=www.myapp1.com appBase=webapps-myapp1 ...
  Host name=www.myapp2.com appBase=webapps-myapp2 ...

Then you may deploy two ROOT.war files to two different webapps folders.

If you want to use Manager application for each of your virtual hosts 
you need to copy directory webapps/manager/ to both 
webapps-myapp1/manager/ and webapps-myapp2/manager/.


-Ognjen

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



Re: Deploy application as Root

2014-09-11 Thread Ognjen Blagojevic

Kiran,

On 11.9.2014 5:52, Kiran Badi wrote:

I am trying to deploy application as ROOT.war in tomcat  7.50 provided by
hosting service provider, but for some reasons I get below message

FAIL - War file ROOT.war cannot be uploaded if context is defined in
server.xml


I have below in server xml,


Host name=Myapp.com appBase=path  to public_html folder
   Aliaswww.myapp.com/Alias
   Aliasmyuserid.myhostingprovider.com/Alias
   Context path= reloadable=true docBase= path to
public_html debug=1/
   Context path=/manager debug=0 privileged=true
   docBase=path to /tomcat/webapps/manager
   /Context
/Host


You seem to specify the same directory for Host's appBase and Context's 
docBase. That is wrong.


AppBase is a place where you will be putting your web applications (.war 
files or directories). On default Tomcat installation that is webapps 
directory.


DocBase is a place where single web application resides. It may be 
relative to AppBase (e.g. ROOT), or absolute (e.g. 
/usr/local/tomcat/webapps/ROOT).


The two should not point to the same directory.


Next, configuring contexts in server.xml is not recommended [1]. You 
should remove Context elements from your server.xml, and move them to 
/META-INF/context.xml in web applications. If you do that, also remove 
docBase attributes.


-Ognjen

[1] 
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context


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



Re: Deploy application as Root

2014-09-11 Thread Konstantin Kolinko
2014-09-11 7:52 GMT+04:00 Kiran Badi ki...@poonam.org:
 Hi,

 I am trying to deploy application as ROOT.war in tomcat  7.50 provided by
 hosting service provider, but for some reasons I get below message

 FAIL - War file ROOT.war cannot be uploaded if context is defined in
 server.xml


 I have below in server xml,


 Host name=Myapp.com appBase=path  to public_html folder
   Aliaswww.myapp.com/Alias
   Aliasmyuserid.myhostingprovider.com/Alias
   Context path= reloadable=true docBase= path to
 public_html debug=1/
   Context path=/manager debug=0 privileged=true
   docBase=path to /tomcat/webapps/manager
   /Context
/Host


 However the ROOT.war gets deployed correctly in my local
 machine.Appreciate some help here for fixing this issue.


1. What Tomcat version does your local machine have?

2. Context path=  and ROOT.war define the same context. Thus the
error message is correct.

[1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming

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



Re: Deploy application as Root

2014-09-11 Thread André Warnier

Konstantin Kolinko wrote:

2014-09-11 7:52 GMT+04:00 Kiran Badi ki...@poonam.org:

Hi,

I am trying to deploy application as ROOT.war in tomcat  7.50 provided by
hosting service provider, but for some reasons I get below message

FAIL - War file ROOT.war cannot be uploaded if context is defined in
server.xml


I have below in server xml,


Host name=Myapp.com appBase=path  to public_html folder
  Aliaswww.myapp.com/Alias
  Aliasmyuserid.myhostingprovider.com/Alias
  Context path= reloadable=true docBase= path to
public_html debug=1/
  Context path=/manager debug=0 privileged=true
  docBase=path to /tomcat/webapps/manager
  /Context
   /Host


However the ROOT.war gets deployed correctly in my local
machine.Appreciate some help here for fixing this issue.



1. What Tomcat version does your local machine have?

2. Context path=  and ROOT.war define the same context. Thus the
error message is correct.

[1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming



And maybe read this too :
http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F

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



Re: Deploy application as Root

2014-09-11 Thread Kiran Badi
Ok I made the changes, and trying.

Andre, I tried your approach, it still same error.Making changes to server
xml now.

Pointing appBase to webapps.

Question I have is that if I upload war file via manager app, where does it
go ?

I can understand that ROOT goes to the ROOT folder if I delete the root
folder, how about myapp.war ?

Does it go to work folder ?

Konstantin, I have below version only difference is that localhost is on
windows and not working one is on linux.

Apache Tomcat/7.0.501.7.0_51-b13Oracle CorporationWindows Vista6.0x86

On Thu, Sep 11, 2014 at 4:32 AM, Ognjen Blagojevic 
ognjen.d.blagoje...@gmail.com wrote:

 Kiran,

 On 11.9.2014 5:52, Kiran Badi wrote:

 I am trying to deploy application as ROOT.war in tomcat  7.50 provided by
 hosting service provider, but for some reasons I get below message

 FAIL - War file ROOT.war cannot be uploaded if context is defined in
 server.xml


 I have below in server xml,


 Host name=Myapp.com appBase=path  to public_html folder
Aliaswww.myapp.com/Alias
Aliasmyuserid.myhostingprovider.com/Alias
Context path= reloadable=true docBase= path to
 public_html debug=1/
Context path=/manager debug=0 privileged=true
docBase=path to /tomcat/webapps/manager
/Context
 /Host


 You seem to specify the same directory for Host's appBase and Context's
 docBase. That is wrong.

 AppBase is a place where you will be putting your web applications (.war
 files or directories). On default Tomcat installation that is webapps
 directory.

 DocBase is a place where single web application resides. It may be
 relative to AppBase (e.g. ROOT), or absolute (e.g.
 /usr/local/tomcat/webapps/ROOT).

 The two should not point to the same directory.


 Next, configuring contexts in server.xml is not recommended [1]. You
 should remove Context elements from your server.xml, and move them to
 /META-INF/context.xml in web applications. If you do that, also remove
 docBase attributes.

 -Ognjen

 [1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.
 html#Defining_a_context

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




Re: Deploy application as Root

2014-09-11 Thread Kiran Badi
Ok I fixed this issue. Moved the context tag to context.xml and deployed it
as ROOT. Works fine now.

However I have another application which I will be deploying in the same
tomcat.

This will be basically myapp2.war ,so how do I manage this deployment so
that whenever someones gives www.myapp2.com, it should open up ?

I assume we cannot have 2 root deployment in the same tomcat.



On Thu, Sep 11, 2014 at 9:29 PM, Kiran Badi ki...@poonam.org wrote:

 Ok I made the changes, and trying.

 Andre, I tried your approach, it still same error.Making changes to server
 xml now.

 Pointing appBase to webapps.

 Question I have is that if I upload war file via manager app, where does
 it go ?

 I can understand that ROOT goes to the ROOT folder if I delete the root
 folder, how about myapp.war ?

 Does it go to work folder ?

 Konstantin, I have below version only difference is that localhost is on
 windows and not working one is on linux.

 Apache Tomcat/7.0.501.7.0_51-b13Oracle CorporationWindows Vista6.0x86

 On Thu, Sep 11, 2014 at 4:32 AM, Ognjen Blagojevic 
 ognjen.d.blagoje...@gmail.com wrote:

 Kiran,

 On 11.9.2014 5:52, Kiran Badi wrote:

 I am trying to deploy application as ROOT.war in tomcat  7.50 provided by
 hosting service provider, but for some reasons I get below message

 FAIL - War file ROOT.war cannot be uploaded if context is defined in
 server.xml


 I have below in server xml,


 Host name=Myapp.com appBase=path  to public_html folder
Aliaswww.myapp.com/Alias
Aliasmyuserid.myhostingprovider.com/Alias
Context path= reloadable=true docBase= path to
 public_html debug=1/
Context path=/manager debug=0 privileged=true
docBase=path to /tomcat/webapps/manager
/Context
 /Host


 You seem to specify the same directory for Host's appBase and Context's
 docBase. That is wrong.

 AppBase is a place where you will be putting your web applications (.war
 files or directories). On default Tomcat installation that is webapps
 directory.

 DocBase is a place where single web application resides. It may be
 relative to AppBase (e.g. ROOT), or absolute (e.g.
 /usr/local/tomcat/webapps/ROOT).

 The two should not point to the same directory.


 Next, configuring contexts in server.xml is not recommended [1]. You
 should remove Context elements from your server.xml, and move them to
 /META-INF/context.xml in web applications. If you do that, also remove
 docBase attributes.

 -Ognjen

 [1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.
 html#Defining_a_context

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