Specifying Tomcat ports in IntelliJ IDEA to use multiple tomcat servers

Source from: http://www.altuure.com/2008/11/12/tomcat-port-configuration/

Edit the server.xml:

<Server port="${tomcat.init.port}1" shutdown="SHUTDOWN">

<Service name="Catalina">
<Connector port="${tomcat.init.port}2" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="${tomcat.init.port}3"/>
<Connector port="${tomcat.init.port}3" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"/>
<Connector port="${tomcat.init.port}4" protocol="AJP/1.3" redirectPort="${tomcat.init.port}3"/>

</Service>
</Server>

Run it like this:

CATALINA_OPTS=-Dtomcat.init.port=908
 ./startup.sh

so you will have

SHUTDOWN:9081
 HTTP:9082
 HTTPS:9083
 AJP:9084

my dev batch file

C:\DevTools\cmd.bat

@echo off
@set CATALINA_HOME=C:\servers\apache-tomcat-5.5.27
@set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16
@set M2_HOME=C:\DevTools\java\apache-maven-2.2.1
@set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m
@set TOMCAT_HOME=%CATALINA_HOME%
@set VIM=C:\DevTools\vim
@set COMSPEC=%SystemRoot%\system32\cmd.exe
@set HOME=C:\Documents and Settings\SG0208743
@set RUBY_HOME=C:\DevTools\ruby-1.8.7

@rem =======================
@rem local path
@rem =======================
@set

PATH=C:\DevTools\gnuwin32\bin;C:\DevTools\MinGW\bin;%RUBY_HOME%\bin;%M2_HOME%\bin;%JAVA_HOME%\bin;C:\DevTools\Sysint

ernalsSuite;C:\DevTools\vim;C:\DevTools\eText\cmd;C:\DevTools\cygwin\usr\local\narwhal\bin;

@rem =======================
@rem git
@rem =======================
@set git_install_root=C:\DevTools\git-1.7.1
@set PLINK_PROTOCOL=ssh
@setlocal
@set path=%PATH%;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;
@if “%HOME%”==”” @set HOME=%USERPROFILE%
@cd %HOME%

@rem =======================
@rem global path
@rem =======================
@set PATH=%PATH%;C:\DevTools\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Program Files\CollabNet\Subversion

Client;C:\DevTools\MySQL\MySQL Server 5.0\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;

@rem =======================
@rem start command process
@rem =======================
@start C:\DevTools\cygwin\bin\mintty.exe %COMSPEC%

A hack for mintty to use as Windows command console cmd

If you’re like me, vain in changing the Windows command console (cmd.exe) and if you like the functionality and look and feel of mintty (cygwin), here’s how to change the look and feel of cmd.exe:

  1. Install Cygwin with Shells -> Mintty included.
  2. start <cygwin directory>/bin/mintty %COMSPEC%

Start is a windows command for spawning new applications.

<cygwin directory>/bin/mintty is the application you want to start.

%COMSPEC% is the parameter for mintty.  Windows will substitue this to cmd.exe.  Well you can call it directly using “start <cygwin directory>/bin/mintty cmd.exe”

Example screehshot:

Hope this helps