Skip to main content

Posts

Multiple Tomcat Instances on Single Machine

In this post we will see how to run multiple tomcat instances on a single machine and under a single user account. Setup We already see how to run tomcat in Ubuntu machine in my previous blog ( http://kmlsarwar.blogspot.com/2014/08/how-to-install-apache-tomcat-on-ubuntu.html ). Step One—Create folder Create two folder named " tomcat-instance1 " and " tomcat-instance2 " anywhere, and copy conf, logs, temp, webapps and work   folder from CATALINA_HOME folder and change conf/server.xml file in  tomcat-instance1 and tomcat-instance2 . we need to change 3 port shutdown port, connector port and ajp port. Shutdown port - this port is used for shutdown the tomcat. when we call the shutdown.sh script they send signal to shutdown port. this port listen by tomcat java process. if signal is received the that process then its cleanup and exit by itself. Connector Port -This port is actual port to expose the applic...

Configure Tomcat Web Management Interface

We already see, how to install tomcat in ubuntu in my previous blog( http://kmlsarwar.blogspot.com/2014/08/how-to-install-apache-tomcat-on-ubuntu.html ) In order to use the manager webapp installed, we must add a login to our Tomcat server. We will do this by editing the tomcat-users.xml file: sudo nano /etc/tomcat7/tomcat-users.xml    This file is filled with comments which describe how to configure the file. You may want to delete all the comments between the following two lines, or you may leave them if you want to reference the examples: <tomcat-users> </tomcat-users>  You will want to add a user who can access the manager-gui and admin-gui (the management interface that we installed in Step Three). You can do so by defining a user similar to the example below. Be sure to change the password and username if you wish: <tomcat-users> <user username="admin" password="password" roles="manager-gui,admin-gui"...

How To Install Apache Tomcat on Ubuntu

Apache tomcat is a Java based application server released by the Apache Software Foundation. It is a web server and a servlet container for Java web applications. Setup Tomcat installation on a virtual private server is relatively easy. Its single required dependency is Java and this tutorial will include a step on how to install that platform. You do need to have a user with sudo privileges for this tutorial. There are two basic ways to install Tomcat on Ubuntu: Install through apt-get. This is the simplest method.  Download the binary distribution from the Apache Tomcat site . Step One—Install Through apt-get   The first thing you will want to do is update your apt-get package lists:   sudo apt-get update The most recent version of Tomcat is 7, and it can be easily downloaded through apt-get sudo apt-get install tomcat7   Install additional packages sudo apt-get install tomcat7-docs tomcat7-admin tomcat7-examples     ...

How to install Oracle JDK on Ubuntu from repository

This package provides Oracle Java JDK 7 (which includes Java JDK, JRE and the Java browser plugin). However, you can't only install Oracle JRE - the PPA only provides the full Oracle JDK7 package. To install: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-jdk7-installer And to uninstall: sudo apt-get remove oracle-jdk7-installer And to verify your installation: java -version java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode) And to verify the web browser installation: http://java.com/en/download/installed.jsp Verified Java Version Congratulations! You have the recommended Java installed (1.7.0_51). And to update: If for some reason, the Java version in use is not 1.7.0, you can try to run the following command: sudo update-java-alternatives -s java-7-oracle To Install and Set in environment variable: To...

How to set JAVA_HOME environment variable in Ubuntu

Setting the JAVA_HOME variable can be done in several ways. 1. Globally and at System level, i.e. no user is required to be logged in. This is the preferred way if you are configuring a server and planning to use boot strapped program that needs JAVA_HOME variable. 2. Globally and set for all logged in user, i.e. one user is needed to be logged in, to have the JAVA_HOME variable set. 3. User specific. Then the variable is only set when the designated user is logged in. First open a Terminal (Applications → Accessories → Terminal), then enter: sudo gedit /etc/environment Append to the end of the file: JAVA_HOME=/usr/lib/jvm/java-7-oracle Check with this echo command. echo $JAVA_HOME

Integrating code coverage tool JaCoCo in your play 2.1.x project

I've been looking into code coverage for Play 2.1.x and found that the only good option is Jacoco. Its always good to have a fine test coverage in any project. I am working on Play framework & this time i’ve tried to integrate the JaCoCo with my play java project & it’s cool to have it in my project. There are few easy steps to integrate the JaCoCo in Play project. 1. Add the following lines of code in your plugin.sbt file. You’ve to add the plugin dependency to your project’s plugins.sbt. libraryDependencies ++= Seq(   "org.jacoco" % "org.jacoco.core" % "0.5.9.201207300726" artifacts(Artifact("org.jacoco.core", "jar", "jar")),   "org.jacoco" % "org.jacoco.report" % "0.5.9.201207300726" artifacts(Artifact("org.jacoco.report", "jar", "jar"))) addSbtPlugin("de.johoop" % "jacoco4sbt" % "1.2.4") 2. Have...

Using the Play console

Launching the console The Play 2.0 console is a development console based on sbt that allows you to manage a Play application’s complete development cycle. To launch the console, enter any existing Play application directory and run the play script: $ cd / path / to / any / application $ play          Getting help Use the help play command to get basic help about the available commands: [ My first application ] $ help play   Running the server in development mode To run the current application in development mode, use the run command: [ My first application ] $ run In this mode, the server will be launched with the auto-reload feature enabled, meaning that for each request Play will check your project and recompile required sources. If needed the application will restart automatically. If there are any compilation errors you will see the result of the compilation directly in your browser: To stop th...