Apache Tomcat ®
Content
Tomcat 10 Software Downloads
Welcome to the Apache Tomcat ® 10.x software download page. This page provides download links for obtaining the latest version of Tomcat 10.0.x software, as well as links to the archives of older releases.
Unsure which version you need? Specification versions implemented, minimum Java version required and lots more useful information may be found on the ‘which version?’ page.
Users of Tomcat 10 onwards should be aware that, as a result of the move from Java EE to Jakarta EE as part of the transfer of Java EE to the Eclipse Foundation, the primary package for all implemented APIs has changed from javax.* to jakarta.* . This will almost certainly require code changes to enable applications to migrate from Tomcat 9 and earlier to Tomcat 10 and later. A migration tool is under development to aid this process.
Quick Navigation
Release Integrity
You must verify the integrity of the downloaded files. We provide OpenPGP signatures for every release file. This signature should be matched against the KEYS file which contains the OpenPGP keys of Tomcat’s Release Managers. We also provide SHA-512 checksums for every release file. After you download the file, you should calculate a checksum for your download, and make sure it is the same as ours.
Mirrors
You are currently using https://apache-mirror.rbc.ru/pub/apache/. If you encounter a problem with this mirror, please select another mirror. If all mirrors are failing, there are backup mirrors (at the end of the mirrors list) that should be available.
Please see the README file for packaging information. It explains what every distribution contains.
Apache Tomcat 10
Tomcat Setup
Table of Contents
Introduction
There are several ways to set up Tomcat for running on different platforms. The main documentation for this is a file called RUNNING.txt. We encourage you to refer to that file if the information below does not answer some of your questions.
Windows
Installing Tomcat on Windows can be done easily using the Windows installer. Its interface and functionality is similar to other wizard based installers, with only a few items of interest.
- Installation as a service: Tomcat will be installed as a Windows service no matter what setting is selected. Using the checkbox on the component page sets the service as «auto» startup, so that Tomcat is automatically started when Windows starts. For optimal security, the service should be run as a separate user, with reduced permissions (see the Windows Services administration tool and its documentation).
- Java location: The installer will provide a default JRE to use to run the service. The installer uses the registry to determine the base path of a Java 8 or later JRE, including the JRE installed as part of the full JDK. When running on a 64-bit operating system, the installer will first look for a 64-bit JRE and only look for a 32-bit JRE if a 64-bit JRE is not found. If a JRE cannot be found when running on a 64-bit operating system, the installer will look for a 64-bit JDK. Finally, if a JRE or JDK has not been found, the installer will try to use the JAVA_HOME environment variable. It is not mandatory to use the default JRE detected by the installer. Any installed Java 8 or later JRE (32-bit or 64-bit) may be used.
- Tray icon: When Tomcat is run as a service, there will not be any tray icon present when Tomcat is running. Note that when choosing to run Tomcat at the end of installation, the tray icon will be used even if Tomcat was installed as a service.
- Defaults: The defaults used by the installer may be overridden by use of the /C= command line argument. The configuration file uses the format name=value with each pair on a separate line. The names of the available configuration options are:
- JavaHome
- TomcatPortShutdown
- TomcatPortHttp
- TomcatMenuEntriesEnable
- TomcatShortcutAllUsers
- TomcatServiceDefaultName
- TomcatServiceName
- TomcatServiceFileName
- TomcatServiceManagerFileName
- TomcatAdminEnable
- TomcatAdminUsername
- TomcatAdminPassword
- TomcatAdminRoles
By using /C=. along with /S and /D= it is possible to perform fully configured unattended installs of Apache Tomcat.
- Refer to the Windows Service How-To for information on how to manage Tomcat as a Windows service.
The installer will create shortcuts allowing starting and configuring Tomcat. It is important to note that the Tomcat administration web application can only be used when Tomcat is running.
Unix daemon
Tomcat can be run as a daemon using the jsvc tool from the commons-daemon project. Source tarballs for jsvc are included with the Tomcat binaries, and need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a JDK.
Before running the script, the JAVA_HOME environment variable should be set to the base path of the JDK. Alternately, when calling the ./configure script, the path of the JDK may be specified using the —with-java parameter, such as ./configure —with-java=/usr/java .
Using the following commands should result in a compiled jsvc binary, located in the $CATALINA_HOME/bin folder. This assumes that GNU TAR is used, and that CATALINA_HOME is an environment variable pointing to the base path of the Tomcat installation.
Please note that you should use the GNU make (gmake) instead of the native BSD make on FreeBSD systems.
Tomcat can then be run as a daemon using the following commands.
When running on Java 9 you will need to additionally specify the following when starting jsvc to avoid warnings on shutdown.
You may also need to specify -jvm server if the JVM defaults to using a server VM rather than a client VM. This has been observed on OSX.
jsvc has other useful parameters, such as -user which causes it to switch to another user after the daemon initialization is complete. This allows, for example, running Tomcat as a non privileged user while still being able to use privileged ports. Note that if you use this option and start Tomcat as root, you’ll need to disable the org.apache.catalina.security.SecurityListener check that prevents Tomcat starting when running as root.
jsvc —help will return the full jsvc usage information. In particular, the -debug option is useful to debug issues running jsvc.
Apache Tomcat 8
Tomcat Setup
Table of Contents
Introduction
There are several ways to set up Tomcat for running on different platforms. The main documentation for this is a file called RUNNING.txt. We encourage you to refer to that file if the information below does not answer some of your questions.
Windows
Installing Tomcat on Windows can be done easily using the Windows installer. Its interface and functionality is similar to other wizard based installers, with only a few items of interest.
- Installation as a service: Tomcat will be installed as a Windows service no matter what setting is selected. Using the checkbox on the component page sets the service as «auto» startup, so that Tomcat is automatically started when Windows starts. For optimal security, the service should be run as a separate user, with reduced permissions (see the Windows Services administration tool and its documentation).
- Java location: The installer will provide a default JRE to use to run the service. The installer uses the registry to determine the base path of a Java 7 or later JRE, including the JRE installed as part of the full JDK. When running on a 64-bit operating system, the installer will first look for a 64-bit JRE and only look for a 32-bit JRE if a 64-bit JRE is not found. If a JRE cannot be found when running on a 64-bit operating system, the installer will look for a 64-bit JDK. Finally, if a JRE or JDK has not been found, the installer will try to use the JAVA_HOME environment variable. It is not mandatory to use the default JRE detected by the installer. Any installed Java 7 or later JRE (32-bit or 64-bit) may be used.
- Tray icon: When Tomcat is run as a service, there will not be any tray icon present when Tomcat is running. Note that when choosing to run Tomcat at the end of installation, the tray icon will be used even if Tomcat was installed as a service.
- Defaults: The defaults used by the installer may be overridden by use of the /C= command line argument. The configuration file uses the format name=value with each pair on a separate line. The names of the available configuration options are:
- JavaHome
- TomcatPortShutdown
- TomcatPortHttp
- TomcatMenuEntriesEnable
- TomcatShortcutAllUsers
- TomcatServiceDefaultName
- TomcatServiceName
- TomcatServiceFileName
- TomcatServiceManagerFileName
- TomcatAdminEnable
- TomcatAdminUsername
- TomcatAdminPassword
- TomcatAdminRoles
By using /C=. along with /S and /D= it is possible to perform fully configured unattended installs of Apache Tomcat.
- Refer to the Windows Service How-To for information on how to manage Tomcat as a Windows service.
The installer will create shortcuts allowing starting and configuring Tomcat. It is important to note that the Tomcat administration web application can only be used when Tomcat is running.
Unix daemon
Tomcat can be run as a daemon using the jsvc tool from the commons-daemon project. Source tarballs for jsvc are included with the Tomcat binaries, and need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a JDK.
Before running the script, the JAVA_HOME environment variable should be set to the base path of the JDK. Alternately, when calling the ./configure script, the path of the JDK may be specified using the —with-java parameter, such as ./configure —with-java=/usr/java .
Using the following commands should result in a compiled jsvc binary, located in the $CATALINA_HOME/bin folder. This assumes that GNU TAR is used, and that CATALINA_HOME is an environment variable pointing to the base path of the Tomcat installation.
Please note that you should use the GNU make (gmake) instead of the native BSD make on FreeBSD systems.
Tomcat can then be run as a daemon using the following commands.
When running on Java 9 you will need to additionally specify the following when starting jsvc to avoid warnings on shutdown.
You may also need to specify -jvm server if the JVM defaults to using a server VM rather than a client VM. This has been observed on OSX.
jsvc has other useful parameters, such as -user which causes it to switch to another user after the daemon initialization is complete. This allows, for example, running Tomcat as a non privileged user while still being able to use privileged ports. Note that if you use this option and start Tomcat as root, you’ll need to disable the org.apache.catalina.security.SecurityListener check that prevents Tomcat starting when running as root.
jsvc —help will return the full jsvc usage information. In particular, the -debug option is useful to debug issues running jsvc.
tomcat – коротко для windows
С сайта http://tomcat.apache.org сохраняем zip-архив, и распаковываем его в папку с путём без пробелов и всяких сложных символов, например, «E:\tomcat\apache-tomcat-8.0.15».
Скачиваем последнюю версию JDK с сайта оракл https://www.oracle.com и ставим её тоже в папку с названием без пробелов (если так не сделать, и установить в папку X:\Program Files\. , то затем, когда мы будем править батник, нам придётся неявно указывать имя папки, это не очень хорошо, почему- будет видно дальше.
Открываем «e:\tomcat\apache-tomcat-8.0.15\bin\». Видим много батников и sh сценариев.
Открываем «catalina.bat». Там видим много закомментированных строк с переменными окружения, которые должны быть объявлены, или которые можно объявлять, а можно и нет.
Те переменные, которые должны быть объявлены — это
- set CATALINA_HOME=»e:\tomcat\apache-tomcat-8.0.15″
- set JAVA_HOME=»e:\ProgramFiles\Java\jre1.8.0_25″
причём желательно это сделать в отдельном файле с именем setenv.bat, для этого просто в текстовом редакторе вбиваем эти две строки и сохраняем файл с таким именем в «e:\tomcat\apache-tomcat-8.0.15\bin\»
Примечание: если папка с установленным jre содержит пробелы, то имя должно состоять из максимум шести первых букв реального названия папки, и если такое сочетание по алфавиту в диске первое, то
1, если второе, то
Например, название папки, внутри которой находится jre, “C:\Program Files\JRE”, а кроме того есть папка «C:\places\», тогда вторая строчка в setenv.bat будет
1\Java\jre1.8.0_25″, или
set JAVA_HOME=»e:\P
Естественно, это не очень хорошо, особенно когда у вас две папки “Program Files” и «Program Files (x86)». В таком случае, чтобы проименовать правильно папку с JRE, придётся поэкспериментировать
Пробуем запустить, для этого из текущей директории запускаем cmd.exe, в нём запускаем startup.bat . Это нам даст контроль над тем что происходит. Если всё пошло хорошо, то запустится окно Java-приложения в режиме консоли, в котором после запуска будет написано время старта, если же что-то пошло не так, например, папки в setenv.bat указаны неверно, мы увидим сообщения об ошибках.
Если глобальные переменные сконфигурированы верно, и запустилось окно java – консоли, но какие-то настройки сделаны неверно, то ошибки можно посмотреть в папке «e:\tomcat\apache-tomcat-8.0.15\logs\».
Если пункт 4 выполнен полностью успешно, то в окне браузера можно набрать 127.0.0.1:8080 и в окне будет окно tomcat сервера.
Но если мы захотим войти в настройки Host Manager, и т. д., то нас попросят ввыести логин и пароль. Взять их негде, но в папке conf есть файл tomcat-users.xml, который, если открыть, то сначала кажется правильным, но роли и пользователи там взяты в комментарий . Да и роли, и пользователи там явно неверные. Итак, что же делать.
Для ответа на вопрос, какие роли должны быть, и каких пользоватей назначать, чтобы войти в админку, на страничке 127.0.0.1:8080. Например, про роли manager можно узнать на страничке ttp://127.0.0.1:8080/docs/manager-howto.html, и вместо одного пользователя admin, как было раньше, теперь есть два пользователя: admin-gui и admin-script.
Более подробно про работу с паролями здесь http://127.0.0.1:8080/docs/realm-howto.html
Итак, открываем файл conf\tomcat-user.xml и добавляем там после закомментированного блока с логинами и паролями
Таким образом, мы получим пользователя superadmin с паролем pass.
Tеперь при помощи скриптов shutdown.bat и startup.bat перезапускаем сервер, и можем войти в админку.
можно ещё создать в админке ссылку на хост (Это то же самое, что мы сейчас сделали).
При создании новых записей в hosts для win8, сначала копируем файл в другую папку, там правим, и затем пишем обратно. После этого рестарт компьютера или сервера не нужен.