Apache: Tips and Tricks

  1. Learn how to start and stop Apache Tomcat from the command line in a Windows environment.

    Read Article
  2. Deploying a web application to Apache Tomcat is very straightforward using a WAR (Web ARchive) file. By deploying we mean that we are placing a zipped web application in a location on the file system where Tomcat can make the web page(s) available to the world.

    Read Article
  3. Apache Tomcat can be started and stopped from the command line. In this topic I will show you how to start and stop Tomcat from the command line in Ubuntu, which is a Linux distribution derived from Debian.

    Read Article
  4. Deploying a web application to Apache Tomcat is very straightforward using a WAR (Web ARchive) file. By deploying we mean that we are placing a zipped web application in a location on the file system where Tomcat can make the web page(s) available to the world.

    Read Article
  5. A Java Server Page, or JSP, program is a crucial part of a Java web application because the JSP will send a response back to the server in the form of a web page. For example, a JSP might display the line items of an order to the browser user. In this topic, you will create a very simple JSP and learn how to run the program at the Tomcat server.

    Read Article
  6. Monitoring the JVM is an important part of administering the Apache Tomcat server. The Tomcat manager provides a quick way to check our server's status by displaying how many HTTP threads are active, the storage allocation in the various memory pools plus other helpful data.

    Read Article
  7. To deploy a web application to Apache Tomcat, you can copy a WAR file to the application base directory, e.g., c:/Tomcat8/webapps. This operation of course presupposes we know the application base directory. We could consult server.xml and look up the Host element to determine the directory name. A more straightforward approach, though, is to use the Tomcat manager web application.

    Read Article
  8. Monitoring the JVM is an important part of administering the Apache Tomcat server. The Tomcat manager provides a quick way to check our server's status by displaying how many HTTP threads are active, the storage allocation in the various memory pools plus other helpful data.

    Read Article
  9. A context path in Apache Tomcat refers to the name of the website as presented by the browser. For example, imagine I tell you to enter "localhost:8080/DemoWebsite/DateJSP.jsp" in your browser. The context path is "DemoWebsite". The term "context" in Tomcat is in fact synonymous with "website". The default context path can be specified if we provide a context file to Tomcat that is given the same name as the website. In this topic, you will learn how to accomplish this important task.

    Read Article
  10. When we copy a WAR file to the application base directory of Apache Tomcat, we usually expect the web application to be deployed. In other words, we expect the website to be immediately available on the World Wide Web. However, this doesn't always have to be the case. The autoDeply attribute on the Host element determines if the web application will be available for access on the internet.

    Read Article
  11. To deploy a web application to Apache Tomcat you can copy a WAR file to the application base directory, e.g., /var/lib/tomcat7/webapps. This operation of course presupposes we know the application base directory. We could consult server.xml and look up the Host element to determine the directory name. A more straightforward approach is to use the Tomcat manager web application.

    Read Article
  12. The Apache Tomcat manager web application provides a convenient interface that lists deployed web applications.

    Read Article
  13. In another topic, I discussed how to start one member of a Tomcat cluster. Click here to learn how to cluster in Apache Tomcat (Windows). When you have completed the work in that topic, you will be prepared for this topic. I will show you how to run another Tomcat instance on the same server, or computer.

    Read Article
  14. A Java Server Page, or JSP, program is a crucial part of a Java web application because the JSP will send a response back to the server in the form of a web page. For example, a JSP might display the line items of an order to the browser user. In this topic, you will create a very simple JSP and learn how to run the program at the Tomcat server.

    Read Article
  15. Business web applications rely on databases. Therefore, you will probably be required to make a connection to your relational database during the development of a web application. Java accesses relational databases through JDBC (Java Database Connectivity). As of JDBC 2, the database is represented to Tomcat as a data source. In this topic I will discuss establishing a JDBC connection to a MySQL data source in Tomcat.

    Read Article
  16. After you have started the Apache Tomcat server, a logical question to ask would be: "How do I verify the Tomcat server is operational?" In this topic we will find out!

    Read Article
  17. In a production Tomcat environment, you might have hundreds of web requests per second on a routine basis. With so much volume assaulting your Tomcat server, you'll probably discover that memory resources in one Tomcat JVM (Java Virtual Machine) can become overwhelmed. To help prevent this situation from becoming reality you can place two or more Tomcat servers in a cluster.

    Read Article
  18. One important function of the Apache Tomcat manager web application is to undeploy web applications. In other words, the website will be removed from Tomcat and therefore no longer be available on the World Wide Web.

    Read Article
  19. A context path in Apache Tomcat refers to the name of the website as presented by the browser. For example, imagine I tell you to enter "localhost:8080/DemoWebsite/DateJSP.jsp" in your browser. The context path is "DemoWebsite". The term "context" in Tomcat is in fact synonymous with "website". The default context path can be specified if we provide a context file to Tomcat that is given the same name as the website. In this topic, you will learn how to accomplish this important task.

    Read Article
  20. Developers and administrators alike will refer to Apache Tomcat logs from time for diagnostic and performance data. Tomcat uses a customized implementation of java.util.logging called JULI (Java Utility Logging Implementation). JULI is very similar to standard Java SE logging, even supporting the same configuration file, logging.properties. In this topic, we'll explore a way to route the Catalina logs to a specific destination and then check out the log contents.

    Read Article
  21. In a Tomcat production environment, you might have hundreds of web requests per second on a routine basis. With so much volume assaulting your Tomcat server, you'll probably discover that memory resources in one Tomcat JVM (Java Virtual Machine) can become overwhelmed. To help prevent this situation from becoming reality you can place two or more Tomcat servers in a cluster.

    Read Article
  22. Developers and administrators alike will refer to Apache Tomcat logs from time for diagnostic and performance data. Tomcat uses a customized implementation of java.util.logging called JULI (Java Utility Logging Implementation). JULI is very similar to standard Java SE logging, even supporting the same configuration file, logging.properties. In this topic, we'll explore a way to route the Catalina logs to a specific destination and then check out the log contents.

    Read Article
  23. When we copy a WAR file to the application base directory of Apache Tomcat we usually expect the web application to be deployed. In other words, we expect the web site to be immediately available on the World Wide Web. However, this doesn't always have to be the case. The autoDeply attribute on the Host element determines if the web application will be available for access on the internet.

    Read Article
  24. Java Management Extensions (JMX) is a technology that permits applications to expose properties and operations through managed beans, or "MBeans". Tomcat supports JMX and provides numerous MBeans to a consumer program, such as jconsole, that expose useful properties and operations. But in order to access Tomcat's MBeans we must configure Tomcat to expose the MBeans to consumers.

    Read Article
  25. The Apache Tomcat manager web application provides a convenient interface that lists deployed web applications.

    Read Article
  26. Apache Tomcat can be installed and configured for first time use in a straightforward way.

    Read Article
  27. Java Management Extensions (JMX) is a technology that permits applications to expose properties and operations through managed beans, or "MBeans". Tomcat supports JMX and provides numerous MBeans to a consumer program, such as jconsole, that expose useful properties and operations. But in order to access Tomcat's MBeans we must configure Tomcat to expose the MBeans to consumers.

    Read Article