Notices: This section not yet converted to new layout. Download stats are rolling back out.

This is not the latest version of Apache Tomcat available.

Apache Tomcat

8.0.21

There are no package test results for this package

There are versions of this package awaiting moderation . See the Version History section below.

This package was approved by moderator ferventcoder on 6/3/2015.

Tomcat is a Application Server. It is possible to run Web application ARchive (WAR) files using Tomcat. Apache Tomcat requires a JDK in order to run.

Optional installation commands:

Issue -packageparameters '"/InstallLocation=C:\Path\to\installationdirectory"' to overwrite the default installation directory, e.g. choco install tomcat -packageparameters '"/InstallLocation=C:\temp"' extracts the package in C:\temp.

Bugs and Features:

Create an issue or comment to an existing one - https://github.com/030/chocolateyautomatic/issues

To install Apache Tomcat, run the following command from the command line or from PowerShell:

C:\> choco install tomcat --version 8.0.21

To upgrade Apache Tomcat, run the following command from the command line or from PowerShell:

C:\> choco upgrade tomcat --version 8.0.21

Files

Hide
  • tools\chocolateyInstall.ps1 Show
    $packageName = 'tomcat'
    $32BitUrl = 'http://apache.hippo.nl/tomcat/tomcat-8/v8.0.21/bin/apache-tomcat-8.0.21-windows-x86.zip'
    $64BitUrl = 'http://apache.hippo.nl/tomcat/tomcat-8/v8.0.21/bin/apache-tomcat-8.0.21-windows-x64.zip'
    $global:installLocation = Get-BinRoot
    $checksum = '6c3ff8e6128e27a458efefd15f95e2f3'
    $checksumType = 'md5'
    $checksum64 = '78ddba575fe96bf06dadea4c3d2aae94'
    $checksumType64 = 'md5'
    $availablePort = '8080'
    $serviceName = 'tomcat'
    
    if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent }
    . "$PSScriptRoot\OverwriteParameters.ps1"
    . "$PSScriptRoot\Install-Service.ps1"
    
    OverwriteParameters
    
    Install-ChocolateyZipPackage "$packageName" "$32BitUrl" "$global:installLocation" "$64BitUrl" -checksum "$checksum" -checksumType "$checksumType" -checksum64 "$checksum64" -checksumType64 "$checksumType64"
    
    $catalinaHome = "$global:installLocation\apache-tomcat-8.0.21"
    $createServiceCommand = "${catalinaHome}\bin\service.bat install $packageName"
    
    Install-ChocolateyEnvironmentVariable 'CATALINA_HOME' "$catalinaHome"
    
    Install-Service $packageName $serviceName $createServiceCommand $availablePort
  • tools\chocolateyUninstall.ps1 Show
    $packageName = 'tomcat'
    
    if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent }
    . "$PSScriptRoot\Install-Service.ps1"
    . "$PSScriptRoot\Uninstall-ZipPackage.ps1"
    
    Uninstall-Service "$packageName"
    
    Uninstall-ZipPackage "$packageName"
  • tools\Install-Service.ps1 Show
    function Install-Service {
        <#
        .SYNOPSIS
        Installs a service
    
        .DESCRIPTION
        This will install a service
    
        .PARAMETER PackageName
        The name of the package for whom the service will be installed.
    
        .PARAMETER ServiceName
        The name of service which will be used to install and start the service.
    
        .PARAMETER CreateServiceCommand
        The command which installs the service.
    
        .PARAMETER AvailablePort (OPTIONAL)
            The port which needs to be available in order to start the service.
    
            .EXAMPLE
            Install-Service 'PACKAGE_NAME' 'SERVICE_NAME' 'INSTALL_COMMAND' 'PORT'
            Install-Service "dcm4chee" "DCM4CHEE" "nssm install DCM4CHEE `"java`" -jar `"%DCM4CHEE_HOME%/bin/run.jar"`" "8090"
            Install-Service "postgresqlzip" "PostgreSQL" "pg_ctl register -N `"PostgreSQL`" -U `"LocalSystem`" -w" "5432"
            Install-Service "apacheds" "ApacheDS" "nssm install ApacheDS `"java`" -jar `"%APACHEDS_HOME%/lib/apacheds-service-${version}.jar`" `"%APACHEDS_HOME%/instances/default`"" "10389"
            Install-Service "test" "test" "nssm install test `"$testDirectory\testService.bat`""
    
            .OUTPUTS
            None
    
            .NOTES
            This helper reduces the number of lines one would have to write to install a service to 1 line.
            This method has error handling built into it.
    
            .LINK
            UnInstall-Service
            Get-ServiceExistence
    #>
            param(
                [string] $packageName,
                [string] $serviceName,
                [string] $createServiceCommand,
                [int] $availablePort
            )
            Write-debug "Running 'Install-Service' for $packageName with serviceName:`'$serviceName`', createServiceCommand: `'$createServiceCommand`', availablePort: `'$availablePort`' ";
    
        if (!$packageName) {
            Write-ChocolateyFailure "Install-Service" "Missing PackageName input parameter."
            return
            }
    
        if (!$serviceName) {
            Write-ChocolateyFailure "Install-Service" "Missing ServiceName input parameter."
            return
            }
    
        if (!$createServiceCommand) {
            Write-ChocolateyFailure "Install-Service" "Missing CreateServiceCommand input parameter."
            return
            }
    
            UnInstall-Service -serviceName "$serviceName"
    
        if ($availablePort -and (Get-StatePort)) {
            Write-ChocolateyFailure "Install-Service" "$availablePort is in LISTENING state and not available."
            return
            }
    
        try {
            Write-Host "$packageName service will be installed"
            iex $createServiceCommand
        } catch {
        Write-ChocolateyFailure "Install-Service" "The createServiceCommand is incorrect: '$_'."
        return
    }
    
    if (Get-ServiceExistence) {
            Write-Host "$packageName service will be started"
    
            for ($i=0;$i -lt 12; $i++) {
                $serviceStatus = Get-Service -Name $serviceName
    
                                 start-service $serviceName
    
                if (($serviceStatus.Status -eq "running") -and (Get-StatePort)) {
                    Write-Host "$packageName service has been started"
                    return
                } else {
                    Write-Host "$packageName service cannot be started. Attempt $i to start the service."
                }
    
                if ($i -eq 11) {
                    Write-ChocolateyFailure "Install-Service" "service $serviceName cannot be started."
                    return
                    }
    
                    Start-Sleep -s 10
                }
        } else {
            Write-ChocolateyFailure "Install-Service" "service $serviceName does not exist."
            return
            }
        }
    
    function Get-ServiceExistence {
        param(
            [string] $serviceName = $serviceName
        )
        Get-WmiObject -Class Win32_Service -Filter "Name='$serviceName'"
    }
    
    function Uninstall-Service {
        param(
            [string] $serviceName = $serviceName
        )
        $service = Get-ServiceExistence -serviceName $serviceName
    
        if ($service) {
            Write-Host "$serviceName service already exists and will be removed"
            stop-service $serviceName
            $service.delete()
        }
    }
    
    function Get-StatePort {
        return Get-NetTCPConnection -State Listen | Where-Object {$_.LocalAddress -match "::|0.0.0.0" -and $_.LocalPort -eq "$availablePort"}
    }
  • tools\OverwriteParameters.ps1 Show
    function OverwriteParameters {
    	$arguments = @{};
    	$packageParameters = $env:chocolateyPackageParameters;
    
    	if($packageParameters) {
    		$MATCH_PATTERN = "/([a-zA-Z]+)=(.*)(`")"
    		$PARAMATER_NAME_INDEX = 1
    		$VALUE_INDEX = 2
    		
    		if($packageParameters -match $MATCH_PATTERN){
    			$results = $packageParameters | Select-String $MATCH_PATTERN -AllMatches 
    			
    			$results.matches | % { 
    			$arguments.Add(
    				$_.Groups[$PARAMATER_NAME_INDEX].Value.Trim(),
    				$_.Groups[$VALUE_INDEX].Value.Trim()) 
    			}
    		}     
    		
    		if($arguments.ContainsKey("InstallLocation")) {
    			$global:installLocation = $arguments["InstallLocation"];
    			
    			Write-Host "Value variable installLocation changed to $global:installLocation"
    		}
    	}	
    }
  • tools\Uninstall-ZipPackage.ps1 Show
    function Uninstall-ZipPackage {
    param(
      [string] $packageName
    )
    	if(!$packageName) {
    		Write-ChocolateyFailure "Uninstall-ZipPackage" "Missing PackageName input parameter."
    		return
    	}
    	
    	ChildItem "$env:ChocolateyInstall\lib\${packageName}.*" -Recurse -Filter "${packageName}Install.zip.txt" | 
    	ForEach-Object{ $installLocation = (Get-Content $_.FullName | Select-Object -First 1);
    		if (("$installLocation" -match "${packageName}|apache-tomcat") -and (Test-Path -Path "$installLocation")) {
    			Write-Host "Uninstalling by removing directory $installLocation";
    			Remove-Item -Recurse -Force "$installLocation"
    		}
    	}
    }

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

Package Maintainer(s)

Software Author(s)

  • Apache Software Foundation

Tags

Release Notes

http://tomcat.apache.org/

Version History

Version Downloads Last updated Status
Apache Tomcat 9.0.24 5 Sunday, August 18, 2019 submitted
Apache Tomcat 9.0.21 1048 Saturday, June 8, 2019 approved
Apache Tomcat 9.0.20 795 Tuesday, May 14, 2019 approved
Apache Tomcat 9.0.19 485 Tuesday, April 30, 2019 approved
Apache Tomcat 9.0.0-rc 623 Friday, March 31, 2017 exempted
Apache Tomcat 8.5.12 26979 Friday, March 31, 2017 approved
Apache Tomcat 8.0.33 39571 Saturday, May 28, 2016 approved
Show More

Discussion for the Apache Tomcat Package

Ground rules:

  • This discussion is only about Apache Tomcat and the Apache Tomcat package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Apache Tomcat, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus
Chocolatey.org uses cookies to enhance the user experience of the site.
Ok