Showing posts with label Tomcat 9. Show all posts
Showing posts with label Tomcat 9. Show all posts

Friday, May 17, 2019

Deploy a web application WAR to Tomcat server

Below are two ways to deploy a WAR file to the Tomcat server.

A. Through the Apache Tomcat manager

  1. Launch your Tomcat management page by entering <your Tomcat server host>:8080 to a web brower..
  2. Click the Manager App button, enter the username and password to login to the Tomcat Web Application Manager site.
  3. Under the Deploy box, click the Choose File button following the text of Select WAR to uplaod, select the WAR file, and click the Deploy button.
  4. You will see a message at the top of the page saying OK.
  5. You should be able to see the project you just deployed in the Applications box. If you click on the path, it will take you to the initial screen of your application displayed in a web browser.
B. Copy the WAR file to the webapps folder in your Tomcat home, and then restart your Tomcat server.


-----------------------------------------------------------------------------------------------------------------
Watch the blessing and loving online channel: SupremeMasterTV live




If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book for free here.

Get and use the Tomcat home in Java

You can get the Tomcat home directory from a java file that is part of the web application deployed into the Tomcat server.

            System.getProperty("catalina.base");

For example, if you want to read a file, myConfigure.txt, located in the Tomcat directory.

            FileReader reader = new FileReader(System.getProperty("catalina.base") + File.separator + "myConfigure.txt");


-----------------------------------------------------------------------------------------------------------------
Watch the blessing and loving online channel: SupremeMasterTV live




If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book for free here.

Monday, May 6, 2019

Install Tomcat 9 as the web server in NetBeans 11.0

Download the Tomcat core zip file from https://tomcat.apache.org/download-90.cgi. The file downloaded is apache-tomcat-9.9.19.

Extract files from the zip file to the C:\Program Files directory.

Open the NetBeans 11.0, click on Tools in the top menu and select Servers.


In the popup window, click the Add Server button.


In the new popup window, select Apache Tomcat or TomEE from the server list. Then, click the Next button.



In the popup window, enter the Tomcat location as the Server location, fill in the username and password fields, and click the Finish button.


It will take you back to the Server screen, which now looks like the one below. Click the Close button to close the window.


To start the Tomcat server, right click the Apache Tomcat or TomEE under Servers in the Services tab, and select Start.



In a few seconds, the server is available to view at http://localhost:8080


Right click on your web service project and select run to start your website.

 -----------------------------------------------------------------------------------------------------------------
Watch the blessing and loving online channel: SupremeMasterTV live




If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book for free here.

Reference:

1. Installing Tomcat 7 and Configuring as Server in NetBeans