Tuesday, 2 April 2013

Installing Tomcat and Configuring as Server in NetBeans

Installing Tomcat 6.0.36 is dead-easy and configuring Tomcat as Server in NetBeans to allow direct (re)deployment of web applications from within NetBeans is just as easy. Still, a brief blog article explaining the steps – for even easier lives for Java Web developers. And as testimonial to the ease of use the development teams behind Tomcat and NetBeans provide to the world of Java developers.

Installation of Tomcat starts with downloading Tomcat, from the Apache site: http://tomcat.apache.org/download-60.cgi 

   


 After downloading the zip-file, I extracted it to E:\ (the location is of your own choosing though).




Next I turn to NetBeans to configure Tomcat 6.0.36 as a new server.
Open the Tools menu and select the option Servers:

 
 The list of currently configured servers appears. In the left side panel select server>>Add Server.. option.
 
 

Select the type of Server to add and provide a name for it – just for reference within NetBeans.
-->

Press Next.

 
Provide the location where this server instance is installed – the target directory for the extraction of Tomcat 6.0.36. Also provide credentials for a Tomcat Administrator account ( in my case I used admin/admin).
Press Finish.
The newly configured Server is presented:

 
Press Close.
Now the Tomcat 6.0.36 Server can be started (and stopped, deployed to etc.) from within NetBeans. Open the Services Window (from the Window menu – option Services or using Ctrl-5).

 

The Tomcat output console appears in NetBeans:




After a few seconds, Tomcat is running. The home page can be accessed at http://server:port – in my case localhost and port 9988:

 

Tomcat is now ready to have applications deployed to it – for example from within NetBeans.
Note: in order for the admin user to also access the management console at http://localhost:9988/manager/html it is imperative that this user is granted the manager-gui role. This can be done by editing the tomcat-users.xml file in the conf directory of the Tomcat installation and adding this role. The entry for user admin would then become:
<user password=”admin” roles=”manager-script,admin,manager-gui” username=”admin”/>

Thursday, 28 March 2013

Time calculation

1000 ms = 1sec
60000 ms60 sec1 min
3600000 ms3600 sec60 min1 hour
86400000 ms86400 sec1440 min24 hours1 day
604800000 ms604800 sec10080 min168 hours7 days1 week
2,592,000,000 ms2592000 sec43200 min720 hours30 days1 month
2,678,400,000 ms2678400 sec44640 min744 hours31 days1 month
31,536,000,000 ms31536000 sec525600 min8760 hours365 days1 year
31622400000 ms31622400 sec527040 min768 hours366 daysleap year