Quantcast

How to run Tomcat as Service on windows start up.

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to run Tomcat as Service on windows start up.

Kiran Badi
Hi,

I have installed and added tomcat 7.0.11 to netbeans 7.01 and now I want
it to run as windows service so that whenever I start windows, it should
start up and run.

Currently whenever I close netbeans it shut down tomcat along with it.

PS : I cannot download and install the fresh copy since being a 7 months
old developer I do not want to take the risk of breaking my existing
setup.Time is my constraint.

Can we create some startup bat file for windows 7 32 bit home premium
and somehow push it on start up program list ?

- Kiran

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Jacques Desodt
Hi Kiran,

On Windows 7, you can't run batch files as services.
See :
http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service

Your first step : compile the .bat file into .exe
Then create the service, and after change the service register values with
regedit.
This is a pure windows process, i think you'll have better answers using
Microsoft forums.

Best regards,
Jacques

2012/4/28 Kiran Badi <[hidden email]>

> Hi,
>
> I have installed and added tomcat 7.0.11 to netbeans 7.01 and now I want
> it to run as windows service so that whenever I start windows, it should
> start up and run.
>
> Currently whenever I close netbeans it shut down tomcat along with it.
>
> PS : I cannot download and install the fresh copy since being a 7 months
> old developer I do not want to take the risk of breaking my existing
> setup.Time is my constraint.
>
> Can we create some startup bat file for windows 7 32 bit home premium and
> somehow push it on start up program list ?
>
> - Kiran
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<[hidden email]>
> For additional commands, e-mail: [hidden email]
>
>
Pid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Pid
On 28 Apr 2012, at 06:51, Jacques Desodt <[hidden email]> wrote:

> Hi Kiran,
>
> On Windows 7, you can't run batch files as services.
> See :
> http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service
>
> Your first step : compile the .bat file into .exe
> Then create the service, and after change the service register values with
> regedit.
> This is a pure windows process, i think you'll have better answers using
> Microsoft forums.

Woah there!

How is this less



>
> Best regards,
> Jacques
>
> 2012/4/28 Kiran Badi <[hidden email]>
>
>> Hi,
>>
>> I have installed and added tomcat 7.0.11 to netbeans 7.01 and now I want
>> it to run as windows service so that whenever I start windows, it should
>> start up and run.
>>
>> Currently whenever I close netbeans it shut down tomcat along with it.
>>
>> PS : I cannot download and install the fresh copy since being a 7 months
>> old developer I do not want to take the risk of breaking my existing
>> setup.Time is my constraint.
>>
>> Can we create some startup bat file for windows 7 32 bit home premium and
>> somehow push it on start up program list ?
>>
>> - Kiran
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<[hidden email]>
>> For additional commands, e-mail: [hidden email]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

André Warnier
In reply to this post by Jacques Desodt
Jacques Desodt wrote:
> Hi Kiran,
>
> On Windows 7, you can't run batch files as services.
> See :
> http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service
>
> Your first step : compile the .bat file into .exe
> Then create the service, and after change the service register values with
> regedit.

I think that it is a bit more complicated that that.
A .bat file compiled to a .exe will still not work properly as a Windows service.

The standard Tomcat installation for Windows does it right, by providing a correct
"service wrapper" for the JVM which runs Tomcat.
The OP would probably, in the end, save himself some time by installing a proper
Tomcat-as-a-Windows-service from the Tomcat website, and then arrange for Netbeans to talk
to that one.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Kiran Badi
Thanks for the all your suggestions,

How about running service.bat and registering tomcat7.exe as windows
service , the one for which I already have a copy,

Below is the output I get,


C:\Program Files\Apache Software Foundation\Apache Tomcat
7.0.11\bin>service.bat
  install tomcat7.exe
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
Service will try to guess them from the registry.
Installing the service 'tomcat7.exe' ...
Using CATALINA_HOME:    "C:\Program Files\Apache Software
Foundation\Apache Tomc
at 7.0.11"
Using CATALINA_BASE:    "C:\Program Files\Apache Software
Foundation\Apache Tomc
at 7.0.11"
Using JAVA_HOME:        ""
Using JRE_HOME:         ""
Using JVM:              "auto"
Failed installing 'tomcat7.exe' service

C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.11\bin>

and when check java home/jre variables, I see its already defined,


C:\Users\kiran>echo %JRE_HOME%
C:\Program Files\Java\jre6

C:\Users\kiran>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_26

am I understanding something incorrect here ?





I just did some google and feel that there might be some
On 4/28/2012 5:01 PM, André Warnier wrote:

> Jacques Desodt wrote:
>> Hi Kiran,
>>
>> On Windows 7, you can't run batch files as services.
>> See :
>> http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service 
>>
>>
>> Your first step : compile the .bat file into .exe
>> Then create the service, and after change the service register values
>> with
>> regedit.
>
> I think that it is a bit more complicated that that.
> A .bat file compiled to a .exe will still not work properly as a
> Windows service.
>
> The standard Tomcat installation for Windows does it right, by
> providing a correct "service wrapper" for the JVM which runs Tomcat.
> The OP would probably, in the end, save himself some time by
> installing a proper Tomcat-as-a-Windows-service from the Tomcat
> website, and then arrange for Netbeans to talk to that one.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Mark Eggers-2
In reply to this post by André Warnier
>From: André Warnier <[hidden email]>
>To: Tomcat Users List <[hidden email]>
>Sent: Saturday, April 28, 2012 4:31 AM
>Subject: Re: How to run Tomcat as Service on windows start up.
>
>Jacques Desodt wrote:
>> Hi Kiran,
>>
>> On Windows 7, you can't run batch files as services.
>> See :
>> http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service
>>
>> Your first step : compile the .bat file into .exe
>> Then create the service, and after change the service register values with
>> regedit.
>
>I think that it is a bit more complicated that that.
>A .bat file compiled to a .exe will still not work properly as a Windows service.
>
>The standard Tomcat installation for Windows does it right, by providing a correct "service wrapper" for the JVM which runs Tomcat.
>The OP would probably, in the end, save himself some time by installing a proper Tomcat-as-a-Windows-service from the Tomcat website, and then arrange for Netbeans to talk to that one.


NetBeans will not talk to the service very well.

NetBeans uses the .bat files (.sh on Linux / UNIX) to control Tomcat. From within NetBeans you can start, stop, and restart Tomcat, or run it in debug mode.

NetBeans will complain that it cannot find the startup.bat and shutdown.bat required to do these tasks if you install the service.

When I develop, I normally don't run Tomcat as a service. However, there are some systems where I need to run the service as well as develop. Here's what I do.

1. Install my primary Tomcat as a service

I usually make an Apache directory, and then start installing Tomcat underneath that.

I do not register this Tomcat with NetBeans since NetBeans cannot really control it properly.

2. Install development Tomcats

I then download the zip files for as many different versions of Tomcat as I need. Each gets unzipped and put in its own directory under the Apache directory.

3. Edit files

a. Service Tomcat
   Leave ports at 8080 in server.xml

   Edit tomcat-users.xml to set up manager-gui access

b. Non-service Tomcats
   Change shutdown port to be something different than the default 8005
   Change HTTP port to something different - 8090 perhaps
   Edit tomcat-users.xml to set up manager-script for NetBeans
      If this is pre-7 Tomcat, set up manager for NetBeans

4. Register Tomcats with NetBeans

Only register those Tomcats with NetBeans that you've installed by unzipping. Do not register the service Tomcat with NetBeans.

When you're developing, use the registered (non-service) Tomcats. When you want to run an application outside of NetBeans, use the manager application to deploy the web application to the service Tomct. The WAR file (from NetBeans' build command) will be found in Project-Name\dist.

This works for me. I have three Tomcats ( 5.5.35, 6.0.35, 7.0.27) registered with netBeans 7.1.1 (soon to be 7.1.2). I have a service Tomcat (7.0.27) running separately.

. . . . just my two cents.
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

André Warnier
Mark Eggers wrote:

>> From: André Warnier <[hidden email]>
>> To: Tomcat Users List <[hidden email]>
>> Sent: Saturday, April 28, 2012 4:31 AM
>> Subject: Re: How to run Tomcat as Service on windows start up.
>>
>> Jacques Desodt wrote:
>>> Hi Kiran,
>>>
>>> On Windows 7, you can't run batch files as services.
>>> See :
>>> http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service
>>>
>>> Your first step : compile the .bat file into .exe
>>> Then create the service, and after change the service register values with
>>> regedit.
>> I think that it is a bit more complicated that that.
>> A .bat file compiled to a .exe will still not work properly as a Windows service.
>>
>> The standard Tomcat installation for Windows does it right, by providing a correct "service wrapper" for the JVM which runs Tomcat.
>> The OP would probably, in the end, save himself some time by installing a proper Tomcat-as-a-Windows-service from the Tomcat website, and then arrange for Netbeans to talk to that one.
>
>
> NetBeans will not talk to the service very well.
>
> NetBeans uses the .bat files (.sh on Linux / UNIX) to control Tomcat. From within NetBeans you can start, stop, and restart Tomcat, or run it in debug mode.
>
> NetBeans will complain that it cannot find the startup.bat and shutdown.bat required to do these tasks if you install the service.

Presumably then, you could replace startup.bat and shutdown.bat by similarly-named .bat
files which respectively do
net start "Apache Tomcat"
and
net stop "Apache Tomcat"
(to keep it simple)

Similarly, it should be possible to create .bat files which run the Tomcat wrapper
tomcatX.exe with the appropriate arguments to start, stop, or run Tomcat in debug mode.

No ?

(Although, if I understood the OP's request correctly, the point here would be to start
Tomcat as a service as soon as Windows starts.  So presumably, the necessity of having a
"startup.bat" is not evident anymore).

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Kiran Badi
I think I got your point Mark,it has to bat file  which net beans uses
to control tomcat.Seems like I have to go and download a fresh copy of
tomcat , install it as service and then use the manager app to deploy
the war file.If I play around with my existing setup, there exists a
risk of breaking it.

Andre, you are correct I need Tomcat to run as a service on windows
start up,seems like it will be better to download a fresh copy rather
than playing around with existing setup.

Thanks a lot for suggestions.

On 4/30/2012 2:48 AM, André Warnier wrote:

> Mark Eggers wrote:
>>> From: André Warnier <[hidden email]>
>>> To: Tomcat Users List <[hidden email]> Sent: Saturday,
>>> April 28, 2012 4:31 AM
>>> Subject: Re: How to run Tomcat as Service on windows start up.
>>>
>>> Jacques Desodt wrote:
>>>> Hi Kiran,
>>>>
>>>> On Windows 7, you can't run batch files as services.
>>>> See :
>>>> http://stackoverflow.com/questions/8972679/windows-7-bat-file-not-starting-as-a-service 
>>>>
>>>>
>>>> Your first step : compile the .bat file into .exe
>>>> Then create the service, and after change the service register
>>>> values with
>>>> regedit.
>>> I think that it is a bit more complicated that that.
>>> A .bat file compiled to a .exe will still not work properly as a
>>> Windows service.
>>>
>>> The standard Tomcat installation for Windows does it right, by
>>> providing a correct "service wrapper" for the JVM which runs Tomcat.
>>> The OP would probably, in the end, save himself some time by
>>> installing a proper Tomcat-as-a-Windows-service from the Tomcat
>>> website, and then arrange for Netbeans to talk to that one.
>>
>>
>> NetBeans will not talk to the service very well.
>>
>> NetBeans uses the .bat files (.sh on Linux / UNIX) to control Tomcat.
>> From within NetBeans you can start, stop, and restart Tomcat, or run
>> it in debug mode.
>>
>> NetBeans will complain that it cannot find the startup.bat and
>> shutdown.bat required to do these tasks if you install the service.
>
> Presumably then, you could replace startup.bat and shutdown.bat by
> similarly-named .bat files which respectively do
> net start "Apache Tomcat"
> and
> net stop "Apache Tomcat"
> (to keep it simple)
>
> Similarly, it should be possible to create .bat files which run the
> Tomcat wrapper tomcatX.exe with the appropriate arguments to start,
> stop, or run Tomcat in debug mode.
>
> No ?
>
> (Although, if I understood the OP's request correctly, the point here
> would be to start Tomcat as a service as soon as Windows starts.  So
> presumably, the necessity of having a "startup.bat" is not evident
> anymore).
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Mark Eggers-2
In reply to this post by André Warnier
>________________________________
> From: André Warnier <[hidden email]>
>To: Tomcat Users List <[hidden email]>
>Sent: Sunday, April 29, 2012 2:18 PM
>Subject: Re: How to run Tomcat as Service on windows start up.


>> Mark Eggers wrote:
>> NetBeans will complain that it cannot find the startup.bat and shutdown.bat
>> required to do these tasks if you install the service.

>
> Presumably then, you could replace startup.bat and shutdown.bat
> by similarly-named .bat files which respectively do
>net start "Apache Tomcat"
>and
>net stop "Apache Tomcat"
>(to keep it simple)
>

I suppose you could. I don't know how intrusive NetBeans' investigation of the scripts are. In Windows Vista and Windows 7, UAC might become a problem. I'm not a Windows person, so I'd have to investigate this.

> Similarly, it should be possible to create .bat files which run the Tomcat 
> wrapper tomcatX.exe with the appropriate arguments to start, stop, or run 
> Tomcat in debug mode.

From my recollection of the service, don't you have to configure the service for debug using the service configuration program? I'm not sure how you would handle that through NetBeans, since I believe it simply does what start.bat / catalina.bat require (pass the debug argument to catalina.bat).

So, you might need a single startup.bat and shutdown.bat that would determine which service to run, and which service was running . . . .

>
> No ?
>
>(Although, if I understood the OP's request correctly, the point here would
> be to start Tomcat as a service as soon as Windows starts.  So presumably,
> the necessity of having a "startup.bat" is not evident anymore).

It's a little unclear as to what the OP request is. It sounds like the OP has two requirements:

1. Deal with Tomcat in a development environment using NetBeans

To me this means starting, stopping, debugging, launching with the security manager, etc. That's hard to do when you don't own / completely control the service.

The same problem exists in Linux. People want a system-wide Tomcat but want to use NetBean's deploy and debug facilities. There are all sorts of interesting permissions problems with this.

NetBeans operates by deploying a context.xml file as [app-name].xml in the appropriate Engine/host directory. The application is actually run out of [project-name]/build. This works fine, and you can do a lot of dynamic updates in this fashion.

What happens when the user of the IDE doesn't have access to post a context. xml to the appropriate directory? What happens when Tomcat doesn't have access to read a user's [project-name]/build directory?

So for this use case, it's far easier and cleaner to maintain your own copy of Tomcat that can be registered, managed, and controlled by NetBeans.

2. Demonstrate works in progress to other developers

Putting aside for the moment that turning development box into a demonstration server may not be a good thing, it's sometimes handy. For this I was recommending a system-wide Tomcat (run as a service). You then just use the manager application to update it with the latest demonstration-ready software.

I think this has a few advantages. You don't show off intermediate (and potentially embarrassing) code. The service is up regardless of whether you're developing or not (OP's original request).


. . . . just my two cents.

/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Kiran Badi
I just want to have one instance of tomcat up and running always
whenever I start my system exactly the way I have httpd service running
always.

ok now moving forward, I installed the tomcat 7.0.27 as service,made
changes to shutdown ports/APR ports etc and now its runing fine as a
service.I have now 2 tomcats sitting in same apache directory one is
7.0.11(this runs with netbeans) and another is 7.0.27(this runs as
windows service).

Now I want to deploy the my app war file to 7.0.27.But for some reasons
Manager App is not accepting my credentials.Here is what I did,
I copied the tomcat users file of 7.0.11 to 7.0.27 and after copying
restarted the service again,and tried to give the same credentials which
are working fine in 7.0.11,but to my surprise,those are not working in
7.0.27
here is tomcat users file,(Sorry for pasting some commented section in
below file,but its imp for me not to delete anything for which I dont
have much information or knowledge).Pls note that his tomcat users file
works perfect fine in 7.0.11 for user kiran/kiran

<?xml version='1.0' encoding='cp1252'?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<tomcat-users>
<user name="admin" password="kiran" roles="admin-gui,manager-gui" />
<!--
   NOTE:  By default, no user is included in the "manager-gui" role required
   to operate the "/manager/html" web application.  If you wish to use
this app,
   you must define such a user - the username and password are arbitrary.
-->
<!--
   NOTE:  The sample user and role entries below are wrapped in a comment
   and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<tomcat-users>
<!--
   NOTE:  By default, no user is included in the "manager-gui" role required
   to operate the "/manager/html" web application.  If you wish to use
this app,
   you must define such a user - the username and password are arbitrary.
-->
<!--
   NOTE:  The sample user and role entries below are wrapped in a comment
   and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<role rolename="AdminRole"/>
<role rolename="UserRole"/>
<user password="tomcat" roles="tomcat,role1" username="both"/>
<user password="tomcat" roles="UserRole" username="role1"/>
<user password="tomcat" roles="AdminRole,manager-script,admin"
username="tomcat"/>
<role rolename="manager-gui"/>
<user username="kiran" password="kiran" roles="manager-gui"/>
<role rolename="probeuser" />
<role rolename="poweruser" />
<role rolename="poweruserplus" />
<role rolename="manager" />
<user username="admin" password="t0psecret" roles="manager" />
</tomcat-users>


Any ideas why its not working in 7.0.27 ?

My system is win 7 32 bit home premium with JDK 1.6.32

>> ________________________________
>> From: André Warnier<[hidden email]>
>> To: Tomcat Users List<[hidden email]>
>> Sent: Sunday, April 29, 2012 2:18 PM
>> Subject: Re: How to run Tomcat as Service on windows start up.
>
>>> Mark Eggers wrote:
>>> NetBeans will complain that it cannot find the startup.bat and shutdown.bat
>>> required to do these tasks if you install the service.
>> Presumably then, you could replace startup.bat and shutdown.bat
>> by similarly-named .bat files which respectively do
>> net start "Apache Tomcat"
>> and
>> net stop "Apache Tomcat"
>> (to keep it simple)
>>
> I suppose you could. I don't know how intrusive NetBeans' investigation of the scripts are. In Windows Vista and Windows 7, UAC might become a problem. I'm not a Windows person, so I'd have to investigate this.
>
>> Similarly, it should be possible to create .bat files which run the Tomcat
>> wrapper tomcatX.exe with the appropriate arguments to start, stop, or run
>> Tomcat in debug mode.
>  From my recollection of the service, don't you have to configure the service for debug using the service configuration program? I'm not sure how you would handle that through NetBeans, since I believe it simply does what start.bat / catalina.bat require (pass the debug argument to catalina.bat).
>
> So, you might need a single startup.bat and shutdown.bat that would determine which service to run, and which service was running . . . .
>
>> No ?
>>
>> (Although, if I understood the OP's request correctly, the point here would
>> be to start Tomcat as a service as soon as Windows starts.  So presumably,
>> the necessity of having a "startup.bat" is not evident anymore).
> It's a little unclear as to what the OP request is. It sounds like the OP has two requirements:
>
> 1. Deal with Tomcat in a development environment using NetBeans
>
> To me this means starting, stopping, debugging, launching with the security manager, etc. That's hard to do when you don't own / completely control the service.
>
> The same problem exists in Linux. People want a system-wide Tomcat but want to use NetBean's deploy and debug facilities. There are all sorts of interesting permissions problems with this.
>
> NetBeans operates by deploying a context.xml file as [app-name].xml in the appropriate Engine/host directory. The application is actually run out of [project-name]/build. This works fine, and you can do a lot of dynamic updates in this fashion.
>
> What happens when the user of the IDE doesn't have access to post a context. xml to the appropriate directory? What happens when Tomcat doesn't have access to read a user's [project-name]/build directory?
>
> So for this use case, it's far easier and cleaner to maintain your own copy of Tomcat that can be registered, managed, and controlled by NetBeans.
>
> 2. Demonstrate works in progress to other developers
>
> Putting aside for the moment that turning development box into a demonstration server may not be a good thing, it's sometimes handy. For this I was recommending a system-wide Tomcat (run as a service). You then just use the manager application to update it with the latest demonstration-ready software.
>
> I think this has a few advantages. You don't show off intermediate (and potentially embarrassing) code. The service is up regardless of whether you're developing or not (OP's original request).
>
>
> . . . . just my two cents.
>
> /mde/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

André Warnier
Kiran Badi wrote:

> I just want to have one instance of tomcat up and running always
> whenever I start my system exactly the way I have httpd service running
> always.
>
> ok now moving forward, I installed the tomcat 7.0.27 as service,made
> changes to shutdown ports/APR ports etc and now its runing fine as a
> service.I have now 2 tomcats sitting in same apache directory one is
> 7.0.11(this runs with netbeans) and another is 7.0.27(this runs as
> windows service).
>
> Now I want to deploy the my app war file to 7.0.27.But for some reasons
> Manager App is not accepting my credentials.Here is what I did,
> I copied the tomcat users file of 7.0.11 to 7.0.27 and after copying
> restarted the service again,and tried to give the same credentials which
> are working fine in 7.0.11,but to my surprise,those are not working in
> 7.0.27
> here is tomcat users file,(Sorry for pasting some commented section in
> below file,but its imp for me not to delete anything for which I dont
> have much information or knowledge).Pls note that his tomcat users file
> works perfect fine in 7.0.11 for user kiran/kiran

If it does, then there is severe bug somewhere.  As shown below, that file has 2 openin
<tomcat-users> tags, and only one closing </tomcat-users> tag. That is invalid xml.
Try again.

It is usually a better idea to make a copy of the original file as it was in the
distribution (adding some suffix like ".original"), and then make a "working" version,
removing all superfluous comments and leaving only what is really effective.
It also makes it a lot easier for people on the list to spot the errors, without having to
waft through kazillions of comment lines which may be badly-formatted in an email..



>
> <?xml version='1.0' encoding='cp1252'?>
> <!--
>   Licensed to the Apache Software Foundation (ASF) under one or more
>   contributor license agreements.  See the NOTICE file distributed with
>   this work for additional information regarding copyright ownership.
>   The ASF licenses this file to You under the Apache License, Version 2.0
>   (the "License"); you may not use this file except in compliance with
>   the License.  You may obtain a copy of the License at
>
>       http://www.apache.org/licenses/LICENSE-2.0
>
>   Unless required by applicable law or agreed to in writing, software
>   distributed under the License is distributed on an "AS IS" BASIS,
>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>   See the License for the specific language governing permissions and
>   limitations under the License.
> -->
> <tomcat-users>
> <user name="admin" password="kiran" roles="admin-gui,manager-gui" />
> <!--
>   NOTE:  By default, no user is included in the "manager-gui" role required
>   to operate the "/manager/html" web application.  If you wish to use
> this app,
>   you must define such a user - the username and password are arbitrary.
> -->
> <!--
>   NOTE:  The sample user and role entries below are wrapped in a comment
>   and thus are ignored when reading this file. Do not forget to remove
> <!.. ..> that surrounds them.
> -->
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
>   Licensed to the Apache Software Foundation (ASF) under one or more
>   contributor license agreements.  See the NOTICE file distributed with
>   this work for additional information regarding copyright ownership.
>   The ASF licenses this file to You under the Apache License, Version 2.0
>   (the "License"); you may not use this file except in compliance with
>   the License.  You may obtain a copy of the License at
>
>       http://www.apache.org/licenses/LICENSE-2.0
>
>   Unless required by applicable law or agreed to in writing, software
>   distributed under the License is distributed on an "AS IS" BASIS,
>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>   See the License for the specific language governing permissions and
>   limitations under the License.
> -->
> <tomcat-users>
> <!--
>   NOTE:  By default, no user is included in the "manager-gui" role required
>   to operate the "/manager/html" web application.  If you wish to use
> this app,
>   you must define such a user - the username and password are arbitrary.
> -->
> <!--
>   NOTE:  The sample user and role entries below are wrapped in a comment
>   and thus are ignored when reading this file. Do not forget to remove
> <!.. ..> that surrounds them.
> -->
> <role rolename="AdminRole"/>
> <role rolename="UserRole"/>
> <user password="tomcat" roles="tomcat,role1" username="both"/>
> <user password="tomcat" roles="UserRole" username="role1"/>
> <user password="tomcat" roles="AdminRole,manager-script,admin"
> username="tomcat"/>
> <role rolename="manager-gui"/>
> <user username="kiran" password="kiran" roles="manager-gui"/>
> <role rolename="probeuser" />
> <role rolename="poweruser" />
> <role rolename="poweruserplus" />
> <role rolename="manager" />
> <user username="admin" password="t0psecret" roles="manager" />
> </tomcat-users>
>
>
> Any ideas why its not working in 7.0.27 ?
>
> My system is win 7 32 bit home premium with JDK 1.6.32
>>> ________________________________
>>> From: André Warnier<[hidden email]>
>>> To: Tomcat Users List<[hidden email]>
>>> Sent: Sunday, April 29, 2012 2:18 PM
>>> Subject: Re: How to run Tomcat as Service on windows start up.
>>
>>>> Mark Eggers wrote:
>>>> NetBeans will complain that it cannot find the startup.bat and
>>>> shutdown.bat
>>>> required to do these tasks if you install the service.
>>> Presumably then, you could replace startup.bat and shutdown.bat
>>> by similarly-named .bat files which respectively do
>>> net start "Apache Tomcat"
>>> and
>>> net stop "Apache Tomcat"
>>> (to keep it simple)
>>>
>> I suppose you could. I don't know how intrusive NetBeans'
>> investigation of the scripts are. In Windows Vista and Windows 7, UAC
>> might become a problem. I'm not a Windows person, so I'd have to
>> investigate this.
>>
>>> Similarly, it should be possible to create .bat files which run the
>>> Tomcat wrapper tomcatX.exe with the appropriate arguments to start,
>>> stop, or run Tomcat in debug mode.
>>  From my recollection of the service, don't you have to configure the
>> service for debug using the service configuration program? I'm not
>> sure how you would handle that through NetBeans, since I believe it
>> simply does what start.bat / catalina.bat require (pass the debug
>> argument to catalina.bat).
>>
>> So, you might need a single startup.bat and shutdown.bat that would
>> determine which service to run, and which service was running . . . .
>>
>>> No ?
>>>
>>> (Although, if I understood the OP's request correctly, the point here
>>> would
>>> be to start Tomcat as a service as soon as Windows starts.  So
>>> presumably,
>>> the necessity of having a "startup.bat" is not evident anymore).
>> It's a little unclear as to what the OP request is. It sounds like the
>> OP has two requirements:
>>
>> 1. Deal with Tomcat in a development environment using NetBeans
>>
>> To me this means starting, stopping, debugging, launching with the
>> security manager, etc. That's hard to do when you don't own /
>> completely control the service.
>>
>> The same problem exists in Linux. People want a system-wide Tomcat but
>> want to use NetBean's deploy and debug facilities. There are all sorts
>> of interesting permissions problems with this.
>>
>> NetBeans operates by deploying a context.xml file as [app-name].xml in
>> the appropriate Engine/host directory. The application is actually run
>> out of [project-name]/build. This works fine, and you can do a lot of
>> dynamic updates in this fashion.
>>
>> What happens when the user of the IDE doesn't have access to post a
>> context. xml to the appropriate directory? What happens when Tomcat
>> doesn't have access to read a user's [project-name]/build directory?
>>
>> So for this use case, it's far easier and cleaner to maintain your own
>> copy of Tomcat that can be registered, managed, and controlled by
>> NetBeans.
>>
>> 2. Demonstrate works in progress to other developers
>>
>> Putting aside for the moment that turning development box into a
>> demonstration server may not be a good thing, it's sometimes handy.
>> For this I was recommending a system-wide Tomcat (run as a service).
>> You then just use the manager application to update it with the latest
>> demonstration-ready software.
>>
>> I think this has a few advantages. You don't show off intermediate
>> (and potentially embarrassing) code. The service is up regardless of
>> whether you're developing or not (OP's original request).
>>
>>
>> . . . . just my two cents.
>>
>> /mde/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Kiran Badi
No Luck Andre :-( , Removed one of the tomcat users tag,how do i
validate xml ?

I tried with below tomcat users file,

<tomcat-users>
<user name="admin" password="kiran" roles="admin-gui,manager-gui" />
<role rolename="AdminRole"/>
<role rolename="UserRole"/>
<user password="tomcat" roles="tomcat,role1" username="both"/>
<user password="tomcat" roles="UserRole" username="role1"/>
<user password="tomcat" roles="AdminRole,manager-script,admin"
username="tomcat"/>
<role rolename="manager-gui"/>
<user username="kiran" password="kiran" roles="manager-gui"/>
<role rolename="probeuser" />
<role rolename="poweruser" />
<role rolename="poweruserplus" />
<role rolename="manager" />
<user username="admin" password="t0psecret" roles="manager" />
</tomcat-users>
On 5/3/2012 12:58 PM, André Warnier wrote:

> Kiran Badi wrote:
>> I just want to have one instance of tomcat up and running always
>> whenever I start my system exactly the way I have httpd service
>> running always.
>>
>> ok now moving forward, I installed the tomcat 7.0.27 as service,made
>> changes to shutdown ports/APR ports etc and now its runing fine as a
>> service.I have now 2 tomcats sitting in same apache directory one is
>> 7.0.11(this runs with netbeans) and another is 7.0.27(this runs as
>> windows service).
>>
>> Now I want to deploy the my app war file to 7.0.27.But for some
>> reasons Manager App is not accepting my credentials.Here is what I did,
>> I copied the tomcat users file of 7.0.11 to 7.0.27 and after copying
>> restarted the service again,and tried to give the same credentials
>> which are working fine in 7.0.11,but to my surprise,those are not
>> working in 7.0.27
>> here is tomcat users file,(Sorry for pasting some commented section
>> in below file,but its imp for me not to delete anything for which I
>> dont have much information or knowledge).Pls note that his tomcat
>> users file works perfect fine in 7.0.11 for user kiran/kiran
>
> If it does, then there is severe bug somewhere.  As shown below, that
> file has 2 openin <tomcat-users> tags, and only one closing
> </tomcat-users> tag. That is invalid xml.
> Try again.
>
> It is usually a better idea to make a copy of the original file as it
> was in the distribution (adding some suffix like ".original"), and
> then make a "working" version, removing all superfluous comments and
> leaving only what is really effective.
> It also makes it a lot easier for people on the list to spot the
> errors, without having to waft through kazillions of comment lines
> which may be badly-formatted in an email..
>
>
>
>>
>> <?xml version='1.0' encoding='cp1252'?>
>> <!--
>>   Licensed to the Apache Software Foundation (ASF) under one or more
>>   contributor license agreements.  See the NOTICE file distributed with
>>   this work for additional information regarding copyright ownership.
>>   The ASF licenses this file to You under the Apache License, Version
>> 2.0
>>   (the "License"); you may not use this file except in compliance with
>>   the License.  You may obtain a copy of the License at
>>
>>       http://www.apache.org/licenses/LICENSE-2.0
>>
>>   Unless required by applicable law or agreed to in writing, software
>>   distributed under the License is distributed on an "AS IS" BASIS,
>>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>>   See the License for the specific language governing permissions and
>>   limitations under the License.
>> -->
>> <tomcat-users>
>> <user name="admin" password="kiran" roles="admin-gui,manager-gui" />
>> <!--
>>   NOTE:  By default, no user is included in the "manager-gui" role
>> required
>>   to operate the "/manager/html" web application.  If you wish to use
>> this app,
>>   you must define such a user - the username and password are arbitrary.
>> -->
>> <!--
>>   NOTE:  The sample user and role entries below are wrapped in a comment
>>   and thus are ignored when reading this file. Do not forget to remove
>> <!.. ..> that surrounds them.
>> -->
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!--
>>   Licensed to the Apache Software Foundation (ASF) under one or more
>>   contributor license agreements.  See the NOTICE file distributed with
>>   this work for additional information regarding copyright ownership.
>>   The ASF licenses this file to You under the Apache License, Version
>> 2.0
>>   (the "License"); you may not use this file except in compliance with
>>   the License.  You may obtain a copy of the License at
>>
>>       http://www.apache.org/licenses/LICENSE-2.0
>>
>>   Unless required by applicable law or agreed to in writing, software
>>   distributed under the License is distributed on an "AS IS" BASIS,
>>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>>   See the License for the specific language governing permissions and
>>   limitations under the License.
>> -->
>> <tomcat-users>
>> <!--
>>   NOTE:  By default, no user is included in the "manager-gui" role
>> required
>>   to operate the "/manager/html" web application.  If you wish to use
>> this app,
>>   you must define such a user - the username and password are arbitrary.
>> -->
>> <!--
>>   NOTE:  The sample user and role entries below are wrapped in a comment
>>   and thus are ignored when reading this file. Do not forget to remove
>> <!.. ..> that surrounds them.
>> -->
>> <role rolename="AdminRole"/>
>> <role rolename="UserRole"/>
>> <user password="tomcat" roles="tomcat,role1" username="both"/>
>> <user password="tomcat" roles="UserRole" username="role1"/>
>> <user password="tomcat" roles="AdminRole,manager-script,admin"
>> username="tomcat"/>
>> <role rolename="manager-gui"/>
>> <user username="kiran" password="kiran" roles="manager-gui"/>
>> <role rolename="probeuser" />
>> <role rolename="poweruser" />
>> <role rolename="poweruserplus" />
>> <role rolename="manager" />
>> <user username="admin" password="t0psecret" roles="manager" />
>> </tomcat-users>
>>
>>
>> Any ideas why its not working in 7.0.27 ?
>>
>> My system is win 7 32 bit home premium with JDK 1.6.32
>>>> ________________________________
>>>> From: André Warnier<[hidden email]>
>>>> To: Tomcat Users List<[hidden email]>
>>>> Sent: Sunday, April 29, 2012 2:18 PM
>>>> Subject: Re: How to run Tomcat as Service on windows start up.
>>>
>>>>> Mark Eggers wrote:
>>>>> NetBeans will complain that it cannot find the startup.bat and
>>>>> shutdown.bat
>>>>> required to do these tasks if you install the service.
>>>> Presumably then, you could replace startup.bat and shutdown.bat
>>>> by similarly-named .bat files which respectively do
>>>> net start "Apache Tomcat"
>>>> and
>>>> net stop "Apache Tomcat"
>>>> (to keep it simple)
>>>>
>>> I suppose you could. I don't know how intrusive NetBeans'
>>> investigation of the scripts are. In Windows Vista and Windows 7,
>>> UAC might become a problem. I'm not a Windows person, so I'd have to
>>> investigate this.
>>>
>>>> Similarly, it should be possible to create .bat files which run the
>>>> Tomcat wrapper tomcatX.exe with the appropriate arguments to start,
>>>> stop, or run Tomcat in debug mode.
>>>  From my recollection of the service, don't you have to configure
>>> the service for debug using the service configuration program? I'm
>>> not sure how you would handle that through NetBeans, since I believe
>>> it simply does what start.bat / catalina.bat require (pass the debug
>>> argument to catalina.bat).
>>>
>>> So, you might need a single startup.bat and shutdown.bat that would
>>> determine which service to run, and which service was running . . . .
>>>
>>>> No ?
>>>>
>>>> (Although, if I understood the OP's request correctly, the point
>>>> here would
>>>> be to start Tomcat as a service as soon as Windows starts.  So
>>>> presumably,
>>>> the necessity of having a "startup.bat" is not evident anymore).
>>> It's a little unclear as to what the OP request is. It sounds like
>>> the OP has two requirements:
>>>
>>> 1. Deal with Tomcat in a development environment using NetBeans
>>>
>>> To me this means starting, stopping, debugging, launching with the
>>> security manager, etc. That's hard to do when you don't own /
>>> completely control the service.
>>>
>>> The same problem exists in Linux. People want a system-wide Tomcat
>>> but want to use NetBean's deploy and debug facilities. There are all
>>> sorts of interesting permissions problems with this.
>>>
>>> NetBeans operates by deploying a context.xml file as [app-name].xml
>>> in the appropriate Engine/host directory. The application is
>>> actually run out of [project-name]/build. This works fine, and you
>>> can do a lot of dynamic updates in this fashion.
>>>
>>> What happens when the user of the IDE doesn't have access to post a
>>> context. xml to the appropriate directory? What happens when Tomcat
>>> doesn't have access to read a user's [project-name]/build directory?
>>>
>>> So for this use case, it's far easier and cleaner to maintain your
>>> own copy of Tomcat that can be registered, managed, and controlled
>>> by NetBeans.
>>>
>>> 2. Demonstrate works in progress to other developers
>>>
>>> Putting aside for the moment that turning development box into a
>>> demonstration server may not be a good thing, it's sometimes handy.
>>> For this I was recommending a system-wide Tomcat (run as a service).
>>> You then just use the manager application to update it with the
>>> latest demonstration-ready software.
>>>
>>> I think this has a few advantages. You don't show off intermediate
>>> (and potentially embarrassing) code. The service is up regardless of
>>> whether you're developing or not (OP's original request).
>>>
>>>
>>> . . . . just my two cents.
>>>
>>> /mde/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Pid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Pid
On 03/05/2012 15:02, Kiran Badi wrote:

> No Luck Andre :-( , Removed one of the tomcat users tag,how do i
> validate xml ?
>
> I tried with below tomcat users file,
>
> <tomcat-users>
> <user name="admin" password="kiran" roles="admin-gui,manager-gui" />
> <role rolename="AdminRole"/>
> <role rolename="UserRole"/>
> <user password="tomcat" roles="tomcat,role1" username="both"/>
> <user password="tomcat" roles="UserRole" username="role1"/>
> <user password="tomcat" roles="AdminRole,manager-script,admin"
> username="tomcat"/>
> <role rolename="manager-gui"/>
> <user username="kiran" password="kiran" roles="manager-gui"/>
> <role rolename="probeuser" />
> <role rolename="poweruser" />
> <role rolename="poweruserplus" />
> <role rolename="manager" />
> <user username="admin" password="t0psecret" roles="manager" />
> </tomcat-users>
Please don't top-post.

Have you actually read the list of roles & users you have?

Perhaps if you tidied it up & put them all in a sensible order, you see
some of the problems you're making for yourself.


p



> On 5/3/2012 12:58 PM, André Warnier wrote:
>> Kiran Badi wrote:
>>> I just want to have one instance of tomcat up and running always
>>> whenever I start my system exactly the way I have httpd service
>>> running always.
>>>
>>> ok now moving forward, I installed the tomcat 7.0.27 as service,made
>>> changes to shutdown ports/APR ports etc and now its runing fine as a
>>> service.I have now 2 tomcats sitting in same apache directory one is
>>> 7.0.11(this runs with netbeans) and another is 7.0.27(this runs as
>>> windows service).
>>>
>>> Now I want to deploy the my app war file to 7.0.27.But for some
>>> reasons Manager App is not accepting my credentials.Here is what I did,
>>> I copied the tomcat users file of 7.0.11 to 7.0.27 and after copying
>>> restarted the service again,and tried to give the same credentials
>>> which are working fine in 7.0.11,but to my surprise,those are not
>>> working in 7.0.27
>>> here is tomcat users file,(Sorry for pasting some commented section
>>> in below file,but its imp for me not to delete anything for which I
>>> dont have much information or knowledge).Pls note that his tomcat
>>> users file works perfect fine in 7.0.11 for user kiran/kiran
>>
>> If it does, then there is severe bug somewhere.  As shown below, that
>> file has 2 openin <tomcat-users> tags, and only one closing
>> </tomcat-users> tag. That is invalid xml.
>> Try again.
>>
>> It is usually a better idea to make a copy of the original file as it
>> was in the distribution (adding some suffix like ".original"), and
>> then make a "working" version, removing all superfluous comments and
>> leaving only what is really effective.
>> It also makes it a lot easier for people on the list to spot the
>> errors, without having to waft through kazillions of comment lines
>> which may be badly-formatted in an email..
>>
>>
>>
>>>
>>> <?xml version='1.0' encoding='cp1252'?>
>>> <!--
>>>   Licensed to the Apache Software Foundation (ASF) under one or more
>>>   contributor license agreements.  See the NOTICE file distributed with
>>>   this work for additional information regarding copyright ownership.
>>>   The ASF licenses this file to You under the Apache License, Version
>>> 2.0
>>>   (the "License"); you may not use this file except in compliance with
>>>   the License.  You may obtain a copy of the License at
>>>
>>>       http://www.apache.org/licenses/LICENSE-2.0
>>>
>>>   Unless required by applicable law or agreed to in writing, software
>>>   distributed under the License is distributed on an "AS IS" BASIS,
>>>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>> implied.
>>>   See the License for the specific language governing permissions and
>>>   limitations under the License.
>>> -->
>>> <tomcat-users>
>>> <user name="admin" password="kiran" roles="admin-gui,manager-gui" />
>>> <!--
>>>   NOTE:  By default, no user is included in the "manager-gui" role
>>> required
>>>   to operate the "/manager/html" web application.  If you wish to use
>>> this app,
>>>   you must define such a user - the username and password are arbitrary.
>>> -->
>>> <!--
>>>   NOTE:  The sample user and role entries below are wrapped in a comment
>>>   and thus are ignored when reading this file. Do not forget to remove
>>> <!.. ..> that surrounds them.
>>> -->
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!--
>>>   Licensed to the Apache Software Foundation (ASF) under one or more
>>>   contributor license agreements.  See the NOTICE file distributed with
>>>   this work for additional information regarding copyright ownership.
>>>   The ASF licenses this file to You under the Apache License, Version
>>> 2.0
>>>   (the "License"); you may not use this file except in compliance with
>>>   the License.  You may obtain a copy of the License at
>>>
>>>       http://www.apache.org/licenses/LICENSE-2.0
>>>
>>>   Unless required by applicable law or agreed to in writing, software
>>>   distributed under the License is distributed on an "AS IS" BASIS,
>>>   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>> implied.
>>>   See the License for the specific language governing permissions and
>>>   limitations under the License.
>>> -->
>>> <tomcat-users>
>>> <!--
>>>   NOTE:  By default, no user is included in the "manager-gui" role
>>> required
>>>   to operate the "/manager/html" web application.  If you wish to use
>>> this app,
>>>   you must define such a user - the username and password are arbitrary.
>>> -->
>>> <!--
>>>   NOTE:  The sample user and role entries below are wrapped in a comment
>>>   and thus are ignored when reading this file. Do not forget to remove
>>> <!.. ..> that surrounds them.
>>> -->
>>> <role rolename="AdminRole"/>
>>> <role rolename="UserRole"/>
>>> <user password="tomcat" roles="tomcat,role1" username="both"/>
>>> <user password="tomcat" roles="UserRole" username="role1"/>
>>> <user password="tomcat" roles="AdminRole,manager-script,admin"
>>> username="tomcat"/>
>>> <role rolename="manager-gui"/>
>>> <user username="kiran" password="kiran" roles="manager-gui"/>
>>> <role rolename="probeuser" />
>>> <role rolename="poweruser" />
>>> <role rolename="poweruserplus" />
>>> <role rolename="manager" />
>>> <user username="admin" password="t0psecret" roles="manager" />
>>> </tomcat-users>
>>>
>>>
>>> Any ideas why its not working in 7.0.27 ?
>>>
>>> My system is win 7 32 bit home premium with JDK 1.6.32
>>>>> ________________________________
>>>>> From: André Warnier<[hidden email]>
>>>>> To: Tomcat Users List<[hidden email]>
>>>>> Sent: Sunday, April 29, 2012 2:18 PM
>>>>> Subject: Re: How to run Tomcat as Service on windows start up.
>>>>
>>>>>> Mark Eggers wrote:
>>>>>> NetBeans will complain that it cannot find the startup.bat and
>>>>>> shutdown.bat
>>>>>> required to do these tasks if you install the service.
>>>>> Presumably then, you could replace startup.bat and shutdown.bat
>>>>> by similarly-named .bat files which respectively do
>>>>> net start "Apache Tomcat"
>>>>> and
>>>>> net stop "Apache Tomcat"
>>>>> (to keep it simple)
>>>>>
>>>> I suppose you could. I don't know how intrusive NetBeans'
>>>> investigation of the scripts are. In Windows Vista and Windows 7,
>>>> UAC might become a problem. I'm not a Windows person, so I'd have to
>>>> investigate this.
>>>>
>>>>> Similarly, it should be possible to create .bat files which run the
>>>>> Tomcat wrapper tomcatX.exe with the appropriate arguments to start,
>>>>> stop, or run Tomcat in debug mode.
>>>>  From my recollection of the service, don't you have to configure
>>>> the service for debug using the service configuration program? I'm
>>>> not sure how you would handle that through NetBeans, since I believe
>>>> it simply does what start.bat / catalina.bat require (pass the debug
>>>> argument to catalina.bat).
>>>>
>>>> So, you might need a single startup.bat and shutdown.bat that would
>>>> determine which service to run, and which service was running . . . .
>>>>
>>>>> No ?
>>>>>
>>>>> (Although, if I understood the OP's request correctly, the point
>>>>> here would
>>>>> be to start Tomcat as a service as soon as Windows starts.  So
>>>>> presumably,
>>>>> the necessity of having a "startup.bat" is not evident anymore).
>>>> It's a little unclear as to what the OP request is. It sounds like
>>>> the OP has two requirements:
>>>>
>>>> 1. Deal with Tomcat in a development environment using NetBeans
>>>>
>>>> To me this means starting, stopping, debugging, launching with the
>>>> security manager, etc. That's hard to do when you don't own /
>>>> completely control the service.
>>>>
>>>> The same problem exists in Linux. People want a system-wide Tomcat
>>>> but want to use NetBean's deploy and debug facilities. There are all
>>>> sorts of interesting permissions problems with this.
>>>>
>>>> NetBeans operates by deploying a context.xml file as [app-name].xml
>>>> in the appropriate Engine/host directory. The application is
>>>> actually run out of [project-name]/build. This works fine, and you
>>>> can do a lot of dynamic updates in this fashion.
>>>>
>>>> What happens when the user of the IDE doesn't have access to post a
>>>> context. xml to the appropriate directory? What happens when Tomcat
>>>> doesn't have access to read a user's [project-name]/build directory?
>>>>
>>>> So for this use case, it's far easier and cleaner to maintain your
>>>> own copy of Tomcat that can be registered, managed, and controlled
>>>> by NetBeans.
>>>>
>>>> 2. Demonstrate works in progress to other developers
>>>>
>>>> Putting aside for the moment that turning development box into a
>>>> demonstration server may not be a good thing, it's sometimes handy.
>>>> For this I was recommending a system-wide Tomcat (run as a service).
>>>> You then just use the manager application to update it with the
>>>> latest demonstration-ready software.
>>>>
>>>> I think this has a few advantages. You don't show off intermediate
>>>> (and potentially embarrassing) code. The service is up regardless of
>>>> whether you're developing or not (OP's original request).
>>>>
>>>>
>>>> . . . . just my two cents.
>>>>
>>>> /mde/
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--

[key:62590808]


signature.asc (964 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Kiran Badi
Got this fixed, you were correct, tomcat user file was mess.Aligned it
correctly now.

Now I am getting some other issue while deploying my app war file.Let me
start a different thread on that.

>>>Please don't top-post.

What do you mean by this ?



On 5/3/2012 7:55 PM, Pid wrote:

> On 03/05/2012 15:02, Kiran Badi wrote:
>> No Luck Andre :-( , Removed one of the tomcat users tag,how do i
>> validate xml ?
>>
>> I tried with below tomcat users file,
>>
>> <tomcat-users>
>> <user name="admin" password="kiran" roles="admin-gui,manager-gui" />
>> <role rolename="AdminRole"/>
>> <role rolename="UserRole"/>
>> <user password="tomcat" roles="tomcat,role1" username="both"/>
>> <user password="tomcat" roles="UserRole" username="role1"/>
>> <user password="tomcat" roles="AdminRole,manager-script,admin"
>> username="tomcat"/>
>> <role rolename="manager-gui"/>
>> <user username="kiran" password="kiran" roles="manager-gui"/>
>> <role rolename="probeuser" />
>> <role rolename="poweruser" />
>> <role rolename="poweruserplus" />
>> <role rolename="manager" />
>> <user username="admin" password="t0psecret" roles="manager" />
>> </tomcat-users>
> Please don't top-post.
>
> Have you actually read the list of roles&  users you have?
>
> Perhaps if you tidied it up&  put them all in a sensible order, you see
> some of the problems you're making for yourself.
>
>
> p
>
>
>
>> On 5/3/2012 12:58 PM, André Warnier wrote:
>>> Kiran Badi wrote:
>>>> I just want to have one instance of tomcat up and running always
>>>> whenever I start my system exactly the way I have httpd service
>>>> running always.
>>>>
>>>> ok now moving forward, I installed the tomcat 7.0.27 as service,made
>>>> changes to shutdown ports/APR ports etc and now its runing fine as a
>>>> service.I have now 2 tomcats sitting in same apache directory one is
>>>> 7.0.11(this runs with netbeans) and another is 7.0.27(this runs as
>>>> windows service).
>>>>
>>>> Now I want to deploy the my app war file to 7.0.27.But for some
>>>> reasons Manager App is not accepting my credentials.Here is what I did,
>>>> I copied the tomcat users file of 7.0.11 to 7.0.27 and after copying
>>>> restarted the service again,and tried to give the same credentials
>>>> which are working fine in 7.0.11,but to my surprise,those are not
>>>> working in 7.0.27
>>>> here is tomcat users file,(Sorry for pasting some commented section
>>>> in below file,but its imp for me not to delete anything for which I
>>>> dont have much information or knowledge).Pls note that his tomcat
>>>> users file works perfect fine in 7.0.11 for user kiran/kiran
>>> If it does, then there is severe bug somewhere.  As shown below, that
>>> file has 2 openin<tomcat-users>  tags, and only one closing
>>> </tomcat-users>  tag. That is invalid xml.
>>> Try again.
>>>
>>> It is usually a better idea to make a copy of the original file as it
>>> was in the distribution (adding some suffix like ".original"), and
>>> then make a "working" version, removing all superfluous comments and
>>> leaving only what is really effective.
>>> It also makes it a lot easier for people on the list to spot the
>>> errors, without having to waft through kazillions of comment lines
>>> which may be badly-formatted in an email..
>>>
>>>
>>>
>>>> <?xml version='1.0' encoding='cp1252'?>
>>>> <!--
>>>>    Licensed to the Apache Software Foundation (ASF) under one or more
>>>>    contributor license agreements.  See the NOTICE file distributed with
>>>>    this work for additional information regarding copyright ownership.
>>>>    The ASF licenses this file to You under the Apache License, Version
>>>> 2.0
>>>>    (the "License"); you may not use this file except in compliance with
>>>>    the License.  You may obtain a copy of the License at
>>>>
>>>>        http://www.apache.org/licenses/LICENSE-2.0
>>>>
>>>>    Unless required by applicable law or agreed to in writing, software
>>>>    distributed under the License is distributed on an "AS IS" BASIS,
>>>>    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>>> implied.
>>>>    See the License for the specific language governing permissions and
>>>>    limitations under the License.
>>>> -->
>>>> <tomcat-users>
>>>> <user name="admin" password="kiran" roles="admin-gui,manager-gui" />
>>>> <!--
>>>>    NOTE:  By default, no user is included in the "manager-gui" role
>>>> required
>>>>    to operate the "/manager/html" web application.  If you wish to use
>>>> this app,
>>>>    you must define such a user - the username and password are arbitrary.
>>>> -->
>>>> <!--
>>>>    NOTE:  The sample user and role entries below are wrapped in a comment
>>>>    and thus are ignored when reading this file. Do not forget to remove
>>>> <!.. ..>  that surrounds them.
>>>> -->
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!--
>>>>    Licensed to the Apache Software Foundation (ASF) under one or more
>>>>    contributor license agreements.  See the NOTICE file distributed with
>>>>    this work for additional information regarding copyright ownership.
>>>>    The ASF licenses this file to You under the Apache License, Version
>>>> 2.0
>>>>    (the "License"); you may not use this file except in compliance with
>>>>    the License.  You may obtain a copy of the License at
>>>>
>>>>        http://www.apache.org/licenses/LICENSE-2.0
>>>>
>>>>    Unless required by applicable law or agreed to in writing, software
>>>>    distributed under the License is distributed on an "AS IS" BASIS,
>>>>    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>>> implied.
>>>>    See the License for the specific language governing permissions and
>>>>    limitations under the License.
>>>> -->
>>>> <tomcat-users>
>>>> <!--
>>>>    NOTE:  By default, no user is included in the "manager-gui" role
>>>> required
>>>>    to operate the "/manager/html" web application.  If you wish to use
>>>> this app,
>>>>    you must define such a user - the username and password are arbitrary.
>>>> -->
>>>> <!--
>>>>    NOTE:  The sample user and role entries below are wrapped in a comment
>>>>    and thus are ignored when reading this file. Do not forget to remove
>>>> <!.. ..>  that surrounds them.
>>>> -->
>>>> <role rolename="AdminRole"/>
>>>> <role rolename="UserRole"/>
>>>> <user password="tomcat" roles="tomcat,role1" username="both"/>
>>>> <user password="tomcat" roles="UserRole" username="role1"/>
>>>> <user password="tomcat" roles="AdminRole,manager-script,admin"
>>>> username="tomcat"/>
>>>> <role rolename="manager-gui"/>
>>>> <user username="kiran" password="kiran" roles="manager-gui"/>
>>>> <role rolename="probeuser" />
>>>> <role rolename="poweruser" />
>>>> <role rolename="poweruserplus" />
>>>> <role rolename="manager" />
>>>> <user username="admin" password="t0psecret" roles="manager" />
>>>> </tomcat-users>
>>>>
>>>>
>>>> Any ideas why its not working in 7.0.27 ?
>>>>
>>>> My system is win 7 32 bit home premium with JDK 1.6.32
>>>>>> ________________________________
>>>>>> From: André Warnier<[hidden email]>
>>>>>> To: Tomcat Users List<[hidden email]>
>>>>>> Sent: Sunday, April 29, 2012 2:18 PM
>>>>>> Subject: Re: How to run Tomcat as Service on windows start up.
>>>>>>> Mark Eggers wrote:
>>>>>>> NetBeans will complain that it cannot find the startup.bat and
>>>>>>> shutdown.bat
>>>>>>> required to do these tasks if you install the service.
>>>>>> Presumably then, you could replace startup.bat and shutdown.bat
>>>>>> by similarly-named .bat files which respectively do
>>>>>> net start "Apache Tomcat"
>>>>>> and
>>>>>> net stop "Apache Tomcat"
>>>>>> (to keep it simple)
>>>>>>
>>>>> I suppose you could. I don't know how intrusive NetBeans'
>>>>> investigation of the scripts are. In Windows Vista and Windows 7,
>>>>> UAC might become a problem. I'm not a Windows person, so I'd have to
>>>>> investigate this.
>>>>>
>>>>>> Similarly, it should be possible to create .bat files which run the
>>>>>> Tomcat wrapper tomcatX.exe with the appropriate arguments to start,
>>>>>> stop, or run Tomcat in debug mode.
>>>>>    From my recollection of the service, don't you have to configure
>>>>> the service for debug using the service configuration program? I'm
>>>>> not sure how you would handle that through NetBeans, since I believe
>>>>> it simply does what start.bat / catalina.bat require (pass the debug
>>>>> argument to catalina.bat).
>>>>>
>>>>> So, you might need a single startup.bat and shutdown.bat that would
>>>>> determine which service to run, and which service was running . . . .
>>>>>
>>>>>> No ?
>>>>>>
>>>>>> (Although, if I understood the OP's request correctly, the point
>>>>>> here would
>>>>>> be to start Tomcat as a service as soon as Windows starts.  So
>>>>>> presumably,
>>>>>> the necessity of having a "startup.bat" is not evident anymore).
>>>>> It's a little unclear as to what the OP request is. It sounds like
>>>>> the OP has two requirements:
>>>>>
>>>>> 1. Deal with Tomcat in a development environment using NetBeans
>>>>>
>>>>> To me this means starting, stopping, debugging, launching with the
>>>>> security manager, etc. That's hard to do when you don't own /
>>>>> completely control the service.
>>>>>
>>>>> The same problem exists in Linux. People want a system-wide Tomcat
>>>>> but want to use NetBean's deploy and debug facilities. There are all
>>>>> sorts of interesting permissions problems with this.
>>>>>
>>>>> NetBeans operates by deploying a context.xml file as [app-name].xml
>>>>> in the appropriate Engine/host directory. The application is
>>>>> actually run out of [project-name]/build. This works fine, and you
>>>>> can do a lot of dynamic updates in this fashion.
>>>>>
>>>>> What happens when the user of the IDE doesn't have access to post a
>>>>> context. xml to the appropriate directory? What happens when Tomcat
>>>>> doesn't have access to read a user's [project-name]/build directory?
>>>>>
>>>>> So for this use case, it's far easier and cleaner to maintain your
>>>>> own copy of Tomcat that can be registered, managed, and controlled
>>>>> by NetBeans.
>>>>>
>>>>> 2. Demonstrate works in progress to other developers
>>>>>
>>>>> Putting aside for the moment that turning development box into a
>>>>> demonstration server may not be a good thing, it's sometimes handy.
>>>>> For this I was recommending a system-wide Tomcat (run as a service).
>>>>> You then just use the manager application to update it with the
>>>>> latest demonstration-ready software.
>>>>>
>>>>> I think this has a few advantages. You don't show off intermediate
>>>>> (and potentially embarrassing) code. The service is up regardless of
>>>>> whether you're developing or not (OP's original request).
>>>>>
>>>>>
>>>>> . . . . just my two cents.
>>>>>
>>>>> /mde/
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [hidden email]
>>>>> For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to run Tomcat as Service on windows start up.

Caldarale, Charles R
> From: Kiran Badi [mailto:[hidden email]]
> Subject: Re: How to run Tomcat as Service on windows start up.

> > >>>Please don't top-post.

> What do you mean by this ?

http://lmgtfy.com/?q=top+post

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Kiran Badi



On 5/4/2012 7:32 AM, Caldarale, Charles R wrote:
>> From: Kiran Badi [mailto:[hidden email]]
>> Subject: Re: How to run Tomcat as Service on windows start up.
>>>>>> Please don't top-post.
>> What do you mean by this ?
> http://lmgtfy.com/?q=top+post
>
>   - Chuck

Thanks Got it Chuck .Interesting stuff which I wasn't aware in spite of
using usenet/online forums for years now.

Not sure as how relevant this topic is now given that most of the time
even in our work environment,we often scroll down towards the bottom of
the mail to see as what exactly is the communication about and each
reply goes to the top of previous mail.

However I will ensure that I dont top post at least to this list.

>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Pid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to run Tomcat as Service on windows start up.

Pid
On 04/05/2012 04:58, Kiran Badi wrote:

>
>
>
> On 5/4/2012 7:32 AM, Caldarale, Charles R wrote:
>>> From: Kiran Badi [mailto:[hidden email]]
>>> Subject: Re: How to run Tomcat as Service on windows start up.
>>>>>>> Please don't top-post.
>>> What do you mean by this ?
>> http://lmgtfy.com/?q=top+post
>>
>>   - Chuck
>
> Thanks Got it Chuck .Interesting stuff which I wasn't aware in spite of
> using usenet/online forums for years now.
>
> Not sure as how relevant this topic is now given that most of the time
> even in our work environment,we often scroll down towards the bottom of
> the mail to see as what exactly is the communication about and each
> reply goes to the top of previous mail.
Relevant?!

Well, just imagine how much easier it would be if you read statements &
responses inline in chronological order, rather than having to
frantically scroll down and then up constantly to keep track of the
conversation.


p

> However I will ensure that I dont top post at least to this list.
>
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
>> PROPRIETARY MATERIAL and is thus for use only by the intended
>> recipient. If you received this in error, please contact the sender
>> and delete the e-mail and its attachments from all computers.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--

[key:62590808]


signature.asc (964 bytes) Download Attachment
Loading...