SKM IT World

Just another blog about IT


Leave a comment

Automatic Tomcat 8.5 Installation and Configuration as Windows Service

If you want to install Tomcat on Windows system as a service, you’ll get the recommendation to use the 32-/64-Bit Windows Service Installer. If you want to install the Tomcat manually, it’s fine. But you can’t use this installer for an automatic installation and configuration of Tomcat, because the installer is UI-based. The next sections explain how you can install and configure Tomcat on a CMD.

Tomcat Installation

  1. Download from the Apache Tomcat 8.5 download page the Core 64-bit Windows zip (or the 32-Bit zip).
  2. Unzip it (for example to C:\tomcat\)

That’s it. Now we have a ready-to-use Tomcat with default configuration values. But it isn’t install as a service.

Installation and Configuration As Windows Service

  1. Go to the bin folder in the installation folder of Tomcat (in the example  it’s C:\tomcat\apache-tomcat-8.5.11\bin)
  2. Install Tomcat as service named tomcat8 by calling service.bat install <servicename>
    C:\tomcat\apache-tomcat-8.5.11\bin>service.bat install tomcat8
    
  3.  tomcat8.exe //US//<servicename> followed by configuration parameter configures the Tomcat service. For example:
    C:\tomcat\apache-tomcat-8.5.11\bin>tomcat8.exe //US//tomcat8 --Startup=auto --JavaHome="C:\Program Files\Java\jre1.8.0_112" --JvmMs=2048 --JvmMx=4096 ++JvmOptions=-Dkey=value
    
  4. Start the Tomcat service with net start <servicename>
    net start tomcat8
    
  5. You can check on http://localhost:8080 whether Tomcat is installed correctly.

The configuration example (step 3) shows how to configure the JVM (heap space, Java option etc.), where Java is installed and which start type should use for the service. The full list of the possible configuration parameter for the Tomcat service can be found in the Apache Tomcat’s Windows Service documentation.

Now we have everything together for writing a Powershell script that does these steps automatically.

 

Advertisements


Leave a comment

Cygwin Embedded In Console2 Under Windows 7

I like to use Cygwin for having a bash shell on a windows machine. In combination with Console2 you have a powerful command-line tool for windows. I’d like to describe how to install Cygwin and Console2 under windows 7 (I think this instruction works on Windows XP, too) and how to embed Cygwin in Console2. I used for Cygwin version 1.7.17-1 32bit and for Console2 version 2.00b148-Beta_32bit.

Cygwin Installation

  1. Download setup.exe.
  2. Double click on setup.exe starts the installation.
  3. Follow the set up instruction. As installation location I use c:\cygwin.
  4. Go to c:\cygwin and run Cygwin.bat for setting up Cygwin user home etc.

Console2 Installation

  1. Download zip file.
  2. Unzip it into installation location.
  3. Start Console2 with a double click on Console2.exe.

How to embed Cygwin in Console2

  1. Open Console2.
  2. Go to Edit -> Settings.
  3. Go to  Tab
  4. In field title insert for example bash. It is the name of the first tab in Console2.
  5. In field Shell you have to insert C:\cygwin\bin\bash.exe –login -i (Don’t forget c:\cygwin is your installation folder).
  6. In field Startup dir you can insert C:\cygwin\home\user.name. This folder is used at every Console2 start.

Links

  1. Cygwin Homepage
  2. Console2 Homepage
  3. Good short feature overview of Cygwin on the Wikipedia page