Tomcat Without Apache

 

Windows Service How-To

  1. Tomcat Without Apache Download
  2. Tomcat Load Balancing Without Apache
  3. Tomcat Without Apache License
  4. Tomcat Without Apache File

Table of Contents

Apache Tomcat is a tool in the Web Servers category of a tech stack. Apache Tomcat is an open source tool with 5.3K GitHub stars and 3.6K GitHub forks. Here’s a link to Apache Tomcat 's open source repository on GitHub.

Tomcat service application

Tomcat9 is a service application for running Tomcat 9 as a Windows service.

Tomcat monitor application

Tomcat9w is a GUI application for monitoring and configuring Tomcat services.

The available command line options are:

  1. As of Tomcat 5.5, Apache's Java Commons Logging (JCL) technology is used throughout Tomcat. JCL is a lightweight API for Java applications that allows hierarchical logging to be supported across all log levels, independent of logging implementation.
  2. The Apache Tomcat Project is proud to announce the release of version 10.0.5 of Apache Tomcat. This release implements specifications that are part of the Jakarta EE 9 platform. Applications that run on Tomcat 9 and earlier will not run on Tomcat 10 without changes.
  3. Tomcat is a web server of its own, so a separate web server like Apache is not required. You probably will want to change Tomcat's port though, since it defaults to 8080 and web sites are usually on port 80. I think people generally put Apache in front of Tomcat so they can do things like: Have one website have several Tomcat instances behind it.
//ES//Edit service configurationThis is the default operation. It is called if the no option is provided but the executable is renamed to servicenameW.exe
//MS//Monitor servicePut the icon in the system tray

Command line arguments

Each command line directive is in the form of //XX//ServiceName

The available command line options are:

//TS//Run the service as console applicationThis is the default operation. It is called if the no option is provided. The ServiceName is the name of the executable without exe suffix, meaning Tomcat9
//RS//Run the serviceCalled only from ServiceManager
//SS//Stop the service
//US//Update service parameters
//IS//Install service
//DS//Delete serviceStops the service if running
Download apache tomcat server

Command line parameters

Each command line parameter is prefixed with --. If the command line parameter is prefixed with ++ then it's value will be appended to the existing option. If the environment variable with the same name as command line parameter but prefixed with PR_ exists it will take precedence. For example:

Tomcat load balancing without apache

is equivalent to providing

as command line parameter.

ParameterNameDefaultDescription
--DescriptionService name description (maximum 1024 characters)
--DisplayNameServiceNameService display name
--Installprocrun.exe //RS//ServiceNameInstall image
--StartupmanualService startup mode can be either auto or manual
--DependsOnList of services that this service depend on. Dependent services are separated using either # or ; characters
--EnvironmentList of environment variables that will be provided to the service in the form key=value. They are separated using either # or ; characters. If you need to use either the # or ; character within a value then the entire value must be enclosed inside single quotes.
--UserUser account used for running executable. It is used only for StartMode java or exe and enables running applications as service under account without LogonAsService privilege.
--PasswordPassword for user account set by --User parameter
--JavaHomeJAVA_HOMESet a different JAVA_HOME than defined by JAVA_HOME environment variable
--JvmautoUse either auto (i.e. find the JVM from the Windows registry) or specify the full path to the jvm.dll. You can use the environment variable expansion here.
--JvmOptions-XrsList of options in the form of -D or -X that will be passed to the JVM. The options are separated using either # or ; characters. If you need to embed either # or ; characters, put them inside single quotes. (Not used in exe mode.)
--JvmOptions9List of options in the form of -D or -X that will be passed to the JVM when running on Java 9 or later. The options are separated using either # or ; characters. If you need to embed either # or ; characters, put them inside single quotes. (Not used in exe mode.)
--ClasspathSet the Java classpath. (Not used in exe mode.)
--JvmMsInitial memory pool size in MB. (Not used in exe mode.)
--JvmMxMaximum memory pool size in MB. (Not used in exe mode.)
--JvmSsThread stack size in KB. (Not used in exe mode.)
--StartModeOne of jvm, Java or exe. The modes are:
  • jvm - start Java in-process. Depends on jvm.dll, see --Jvm.
  • Java - same as exe, but automatically uses the default Java executable, i.e. %JAVA_HOME%binjava.exe. Make sure JAVA_HOME is set correctly, or use --JavaHome to provide the correct location. If neither is set, procrun will try to find the default JDK (not JRE) from the Windows registry.
  • exe - run the image as a separate process
--StartImageExecutable that will be run. Only applies to exe mode.
--StartPathWorking path for the start image executable.
--StartClassMainClass that contains the startup method. Applies to the jvm and Java modes. (Not used in exe mode.)
--StartMethodmainMethod name if differs then main
--StartParamsList of parameters that will be passed to either StartImage or StartClass. Parameters are separated using either # or ; character.
--StopModeOne of jvm, Java or exe. See --StartMode for further details.
--StopImageExecutable that will be run on Stop service signal. Only applies to exe mode.
--StopPathWorking path for the stop image executable. Does not apply to jvm mode.
--StopClassMainClass that will be used on Stop service signal. Applies to the jvm and Java modes.
--StopMethodmainMethod name if differs then main
--StopParamsList of parameters that will be passed to either StopImage or StopClass. Parameters are separated using either # or ; character.
--StopTimeoutNo TimeoutDefines the timeout in seconds that procrun waits for service to exit gracefully.
--LogPath%SystemRoot%System32LogFilesApacheDefines the path for logging. Creates the directory if necessary.
--LogPrefixcommons-daemonDefines the service log filename prefix. The log file is created in the LogPath directory with .YEAR-MONTH-DAY.log suffix
--LogLevelInfoDefines the logging level and can be either Error, Info, Warn or Debug. (Case insensitive).
--StdOutputRedirected stdout filename. If named auto then file is created inside LogPath with the name service-stdout.YEAR-MONTH-DAY.log.
--StdErrorRedirected stderr filename. If named auto then file is created inside LogPath with the name service-stderr.YEAR-MONTH-DAY.log.
--PidFileDefines the file name for storing the running process id. Actual file is created in the LogPath directory

Installing services

The safest way to manually install the service is to use the providedservice.bat script. Administrator privileges are required to run thisscript. If necessary, you can use the /user switch to specifya user to use for the installation of the service.

NOTE: If User Account Control (UAC) is enabled you will beasked for additional privileges when 'Tomcat9.exe' is launched bythe script.
If you want to pass additional options to service installer asPR_* environment variables, you have to either configure themglobally in OS, or launch the program that sets them with elevated privileges(e.g. right-click on cmd.exe and select 'Run as administrator'; on Windows 8(or later) or Windows Server 2012 (or later), you can open an elevated commandprompt for the current directory from the Explorerby clicking on the 'File' menu bar). See issue 56143 for details.

There is a 2nd optional parameter that lets you specify the name of theservice, as displayed in Windows services.

When installing the service with a non-default name,tomcat9.exe and tomcat9w.exe may be renamed tomatch the chosen service name. To do this, use the --renameoption.

If using tomcat9.exe, you need to use the //IS// parameter.

Updating services

To update the service parameters, you need to use the //US// parameter.

If you gave the service an optional name, you need to specify it like this:

Removing services

To remove the service, you need to use the //DS// parameter.
If the service is running it will be stopped and then deleted.

Tomcat Without Apache Download

If you gave the service an optional name, you need to specify it like this:

Debugging services

To run the service in console mode, you need to use the //TS// parameter.The service shutdown can be initiated by pressing CTRL+C orCTRL+BREAK.If you rename the tomcat9.exe to testservice.exe then you can just execute thetestservice.exe and this command mode will be executed by default.

Multiple Instances

Tomcat supports installation of multiple instances. You can have a singleinstallation of Tomcat with multiple instances running on different IP/portcombinations, or multiple Tomcat versions, each running one or more instances ondifferent IP/ports.

Each instance folder will need the following structure:

  • conf
  • logs
  • temp
  • webapps
  • work

At a minimum, conf should contain a copy of the following files fromCATALINA_HOMEconf. Any files not copied and edited, will be picked up bydefault from CATALINA_HOMEconf, i.e. CATALINA_BASEconf files override defaultsfrom CATALINA_HOMEconf.

  • server.xml
  • web.xml

You must edit CATALINA_BASEconfserver.xml to specify a unique IP/port for theinstance to listen on. Find the line that contains<Connector port='8080' ... and add an address attribute and/orupdate the port number so as to specify a unique IP/port combination.

To install an instance, first set the CATALINA_HOME environment variable to thename of the Tomcat installation directory. Then create a second environmentvariable CATALINA_BASE and point this to the instance folder. Then run'service.bat install' command specifying a service name.

To modify the service settings, you can run tomcat9w //ES//instance1.

For additional instances, create additional instance folder, update theCATALINA_BASE environment variable, and run the 'service.bat install' again.

Ranch Hand
posted 17 years ago
  • Optional 'thank-you' note:
Hello guys,
What are the benefits of using Apache web server in front of Tomcat in case all the content is DYNAMIC and all calls are thus forwarded to Tomcat?
Any Ideas? Should I just use Tomcat directly?
PS: Security is not a big concern.
Ranch Hand
posted 17 years ago
  • Optional 'thank-you' note:
Don't you use pictures or stylesheets?

Tomcat Load Balancing Without Apache

Ranch Hand
posted 17 years ago
  • Optional 'thank-you' note:
Nope, no static pictures at least (and fully dynamic accordig to users data) this is not for web apps, mobile app.
Ranch Hand
posted 17 years ago
  • Optional 'thank-you' note:

Tomcat Without Apache License

I really need apache because we use a security plugin (Baltimore SelectAccess) that works with apache and not with tomcat. So that's our reason. It is much easier to setup tomcat standalone, so I would do that until you find a reason to change.
Ranch Hand

Tomcat Without Apache File

posted 17 years ago
  • Optional 'thank-you' note:
Thanks Annekee
Right now I am thinking of using it to distribute the load across a tomcat Farm. If Apache can also be clustered without a separate load balancer (hardware/software based) then it is fine (My other question).
If it can not, and requires a load balancer anyway, then I will use the load balancer to distribute the load to tomcat directly.
Any other thoughts ?
[ February 16, 2004: Message edited by: Tonny Tssagovic ]