- Apache Tomcat 7 Installation Guide on Linux
- Установка и базовая настройка Tomcat на Linux Ubuntu Server
- Подготовка системы
- Подготовка к установке
- Установка JAVA
- Создание пользователя
- Установка Tomcat
- Настройка автозапуска
- How to Install Tomcat 7 Server on Ubuntu, Debian and LinuxMint
- Step 1 – Verify JAVA
- Step 2 – Download Tomcat 7 Archive
- Step 3 – Setup Environment Variable
- Step 4 – Start Tomcat
- Step 5 – Access Tomcat
- Apache Tomcat ®
- Content
- Apache Tomcat
- 2021-10-06 Tomcat 8.6.72 Released
- 2021-10-01 Tomcat 9.0.54 Released
- 2021-10-01 Tomcat 10.0.12 Released
- 2021-10-01 Tomcat 10.1.0-M6 (alpha) Released
- 2021-09-01 Tomcat Native 1.2.31 Released
- 2021-05-07 Tomcat Migration Tool for Jakarta EE 1.0.0 Released
- 2020-03-06 Tomcat Connectors 1.2.48 Released
- 2015-03-17 Apache Standard Taglib 1.2.5 Released
- 2013-11-11 Tomcat Maven Plugin 2.2 Released
Apache Tomcat 7 Installation Guide on Linux
Geekflare is supported by our audience. We may earn affiliate commissions from buying links on this site.
Procedure to download & install Tomcat 7 on Linux environment
Tomcat installation is one of the most straightforward installations I have come across.
However, if you don’t know then don’t worry. You will learn how to install Tomcat 7 and get up and running in just 5 minutes.
In this article, I will explain how to download, install and ensure it’s up & running.
- Download the latest Tomcat7 version 7.0.62 from below link
- Transfer the downloaded zip file to your server where you wish to install tomcat.
In this example – I have transferred to /opt/
- unzip the transferred file apache-tomcat-7.0.62.zip
And then you will have a new folder
You may rename apache-tomcat-7.0.62 to tomcat but it’s entirely on you. This concluded tomcat installation is done and now will start to ensure installation is successful.
- Go to apache-tomcat-7.0.62/bin folder
- Execute startup.sh to start the tomcat
If you are getting permission denied while executing sh file then you need to change the permission to sh file as executable.
Источник
Установка и базовая настройка Tomcat на Linux Ubuntu Server
Tomcat на Ubuntu не устанавливается из репозитория (в отличие от некоторых других дистрибутивов Linux, например, CentOS). Поэтому в данной инструкции мы выполним ручную установку — развертывание дополнительных компонентов (Java), загрузку и распаковку пакета веб-сервера Tomcat, а также настройку его автоматического запуска в случае сбоя или после перезагрузки системы. На момент обновления инструкции использовался Tomcat версии 10 и Ubuntu 20.04.
Подготовка системы
Обновляем список пакетов в репозиториях:
Задаем имя серверу:
hostnamectl set-hostname server.dmosk.ru
* в данном примере мы зададим имя server.dmosk.ru.
Настраиваем часовой пояс, например:
timedatectl set-timezone Europe/Moscow
* где Europe/Moscow — московское время. Список всех возможных зон смотрим командой timedatectl list-timezones.
Устанавливаем сервис для автоматической синхронизации времени, а также разрешаем его автозапуск:
apt-get install chrony
systemctl enable chrony
Если мы используем брандмауэр, необходимо открыть порт 8080:
iptables -A INPUT -p tcp —dport 8080 -j ACCEPT
* 8080 — порт по умолчанию, на котором работает Tomcat. Если мы заходим поменять данный порт, то нужно будет открыть именно его.
Сохраняем правила — для этого устанавливаем утилиту iptables-persistent:
apt-get install iptables-persistent
Если в процессе установки мы отказались сохранять правила, выполняем команду:
Можно приступать к установке Java.
Подготовка к установке
Для работы веб-сервера нам необходимы Java и пользователь, под которым будет работать Tomcat.
Установка JAVA
Мы установим пакет openjdk. Для этого вводим команду:
apt-get install default-jdk
* будет установлена последняя версия, максимально совместимая с используемой версией операционной системы Ubuntu.
Если в системе окажется несколько версий java, выберем последнюю. Для этого вводим команду:
update-alternatives —config java
. и выбираем в списке соответствующий вариант.
Проверяем используемую версию java:
Мы должны увидеть что-то на подобие:
openjdk version «14.0.2» 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 14.0.2+12-Ubuntu-120.04, mixed mode, sharing)
Создание пользователя
Создаем пользователя командой:
useradd tomcat -U -s /bin/false -d /opt/tomcat -m
* в итоге будет создан пользователь tomcat со следующими опциями:
- -U — также будет создана группа с таким же именем, что и пользователь.
- -s /bin/false — запрещает пользователю интерактивный вход в систему.
- -d /opt/tomcat — указывает путь до домашней директории пользователя.
- -m — сразу создает домашнюю директорию пользователю.
Можно приступать к установке веб-сервера Apache Tomcat.
Установка Tomcat
Переходим на страницу официального сайта веб-сервера. В меню слева выбираем необходимую версию Tomcat:
* на момент обновления статьи, последняя версия была 10.
Копируем ссылку на архив tar.gz:
Используя скопированную ссылку, скачиваем архив на наш сервер:
Распаковываем содержимое архива в каталог /opt/tomcat:
tar zxvf apache-tomcat-*.tar.gz -C /opt/tomcat —strip-components 1
Готово. Можно запустить сервер командой:
Открываем браузер и переходим на страницу http:// :8080 — мы должны увидеть стартовую страницу Tomcat:
Наш сервер работает.
Посмотреть версию установленного программного обеспечения можно командой:
java -cp /opt/tomcat/lib/catalina.jar org.apache.catalina.util.ServerInfo
Мы должны увидеть что-то на подобие:
Server version: Apache Tomcat/10.0.2
Server built: Jan 28 2021 18:48:46 UTC
Server number: 10.0.2.0
OS Name: Linux
OS Version: 5.4.0-26-generic
Architecture: amd64
JVM Version: 14.0.2+12-Ubuntu-120.04
JVM Vendor: Private Build
Настройка автозапуска
Мы выполнили разовый запуск нашего веб-сервера, но, когда будет перезагружен компьютер, он не запустится. Чтобы это исправить, мы создадим юнит в systemd.
Для начала, остановим работу Tomcat:
Поменяем владельца для всех файлов в каталоге /opt/tomcat:
chown -R tomcat:tomcat /opt/tomcat
Создадим конфигурационный файл для нового юнита:
[Unit]
Description=Apache Tomcat Server
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=»JAVA_HOME=/usr/lib/jvm/default-java»
Environment=»JAVA_OPTS=-Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true»
Environment=»CATALINA_BASE=/opt/tomcat»
Environment=»CATALINA_HOME=/opt/tomcat»
Environment=»CATALINA_PID=/opt/tomcat/temp/tomcat.pid»
Environment=»CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC»
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
Restart=on-failure
RestartSec=10
* где обращаем внимание на:
- User/Group — пользователь и группа пользователя, от чьего имени будет работать сервис.
- Environment — переменные окружения. В нашем примере задается несколько для нормальной работы Java и Tomcat.
- ExecStart/ExecStop — пути к скриптам, которые запускают или останавливают работу службы веб-сервера.
- Restart/RestartSec — задают поведение сервиса при необходимости выполнить перезапуск. В нашем примере выполнять при сбое с интервалом в 10 секунд.
Из данных опций, возможно вам захочется поменять CATALINA_OPTS, например, задать другие значения для выделения памяти или указать определенный порт. Остальные опции можно оставить.
Перечитываем новый конфигурационный файл в systemd:
Источник
How to Install Tomcat 7 Server on Ubuntu, Debian and LinuxMint
Apache Tomcat is a opensource webserver product of Apache Foundation like Apache HTTP server. It is used for deploying Java Servlet and JSP applications. To deploy an application in Tomcat we can simply create a war file and deploy them. For more details about you can visit apache official site http://tomcat.apache.org/ .
This article will help you to install tomcat 7 on Ubuntu, Debian and LinuxMint systems.
Step 1 – Verify JAVA
First, we need to make sure that we have installed java on or system. JAVA is the first requirement of tomcat installation. Use the following command to check if you have java installed already on your system. Try to keep java up to date with the latest version.
In case you do not have java installed use link: Install JAVA 8 on Ubuntu
Step 2 – Download Tomcat 7 Archive
After configuring JAVA properly on your system, let’s download Apache tomcat archive file from Apache official site using http://tomcat.apache.org/download-70.cgi or use the following command to download Tomcat 7.0.68 from Apache server.
After competed download extract archive file in /opt directory. You may change this location as per your setup.
Step 3 – Setup Environment Variable
Before starting Tomcat, Configure environment variables by adding an entry in the
/.bashrc file, So that the system environment can set on system bootup with the following command.
Step 4 – Start Tomcat
After completing all the above configuration, Let’s use the below command to start Tomcat. There is no need to compile its source. Tomcat by default start on port 8080, So make sure no other application using the same port.
Step 5 – Access Tomcat
Tomcat server works on port 8080 default. Access tomcat on a web browser by connecting your server on port 8080.
Step 6 – Setup User Accounts
Finally we need to create user accounts to secure and access admin/manager pages. Edit conf/tomcat-users.xml file in your editor and paste inside tags.
Step 7 – Create Tomcat7 Init Script
Create a init file /etc/init.d/tomcat7 using following content.
Now execute following commands to set proper permissions and symbolic links for init script.
Источник
Apache Tomcat ®
Content
Apache Tomcat
The Apache Tomcat ® software is an open source implementation of the Jakarta Servlet, Jakarta Server Pages, Jakarta Expression Language, Jakarta WebSocket, Jakarta Annotations and Jakarta Authentication specifications. These specifications are part of the Jakarta EE platform.
The Jakarta EE platform is the evolution of the Java EE platform. Tomcat 10 and later implement specifications developed as part of Jakarta EE. Tomcat 9 and earlier implement specifications developed as part of Java EE.
The Apache Tomcat software is developed in an open and participatory environment and released under the Apache License version 2. The Apache Tomcat project is intended to be a collaboration of the best-of-breed developers from around the world. We invite you to participate in this open development project. To learn more about getting involved, click here.
Apache Tomcat software powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Some of these users and their stories are listed on the PoweredBy wiki page.
Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcat project logo are trademarks of the Apache Software Foundation.
2021-10-06 Tomcat 8.6.72 Released
The Apache Tomcat Project is proud to announce the release of version 8.5.72. of Apache Tomcat. This release implements specifications that are part of the Java EE 7 platform. The notable changes compared to 8.5.71 include:
- Further robustness improvements to HTTP/2 flow control window management
- Fix an issue that caused some Servlet non-blocking API reads of the HTTP request body to incorrectly use blocking IO
Full details of these changes, and all the other changes, are available in the Tomcat 8.5 changelog.
2021-10-01 Tomcat 9.0.54 Released
The Apache Tomcat Project is proud to announce the release of version 9.0.54 of Apache Tomcat. This release implements specifications that are part of the Java EE 8 platform. The notable changes compared to 9.0.53 include:
- Further robustness improvements to HTTP/2 flow control window management
- Improvements to the DataSourceUserDatabase
- Fix an issue that caused some Servlet non-blocking API reads of the HTTP request body to incorrectly use blocking IO
Full details of these changes, and all the other changes, are available in the Tomcat 9 changelog.
2021-10-01 Tomcat 10.0.12 Released
The Apache Tomcat Project is proud to announce the release of version 10.0.12 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. Java EE based applications designed for Tomcat 9 and earlier may be placed in the $CATALINA_BASE/webapps-javaee directory and Tomcat will automatically convert them to Jakarta EE and copy them to the webapps directory. This conversion is performed using the Apache Tomcat migration tool for Jakarta EE tool which is also available as a separate download for off-line use.
The notable changes in this release are:
- Further robustness improvements to HTTP/2 flow control window management.
- Improvements to the DataSourceUserDatabase.
- Fix an issue that caused some Servlet non-blocking API reads of the HTTP request body to incorrectly use blocking IO.
Full details of these changes, and all the other changes, are available in the Tomcat 10 changelog.
2021-10-01 Tomcat 10.1.0-M6 (alpha) Released
The Apache Tomcat Project is proud to announce the release of version 10.1.0-M6 of Apache Tomcat. This release is a milestone release and is targeted at Jakarta EE 10.
Applications that run on Tomcat 9 and earlier will not run on Tomcat 10 without changes. Java EE based applications designed for Tomcat 9 and earlier may be placed in the $CATALINA_BASE/webapps-javaee directory and Tomcat will automatically convert them to Jakarta EE and copy them to the webapps directory. This conversion is performed using the Apache Tomcat migration tool for Jakarta EE tool which is also available as a separate download for off-line use.
The notable changes in this release are:
- Servlet API updates for Servlet 6 including removal of all deprecated code, updated schemas and a new API for connection and request IDs.
- EL API updates for EL 5.0 including deprecation of the use of FeatureDescriptor, improvements to BeanELResolver and the addition of MethodReference.
- Further robustness improvements to HTTP/2 flow control window management
Full details of these changes, and all the other changes, are available in the Tomcat 10.1 (alpha) changelog.
2021-09-01 Tomcat Native 1.2.31 Released
The Apache Tomcat Project is proud to announce the release of version 1.2.31 of Tomcat Native. The notable changes since 1.2.30 include:
- Windows binaries built with OpenSSL 1.1.1l.
- Correct an issue when building with OpenSSl 3.0.0.
2021-05-07 Tomcat Migration Tool for Jakarta EE 1.0.0 Released
The Apache Tomcat Project is proud to announce the release of 1.0.0 of the Apache Tomcat Migration Tool for Jakarta EE. This release contains a number of bug fixes and improvements compared to version 0.2.0.
The notable changes in this release are:
- Further fixes to exclude javax.xml packages that are not part of Java EE from the migration.
- The class transformer now validates that the target classes in the Jakarta namespace exist in the runtime environment.
Full details of these changes, and all the other changes, are available in the changelog.
2020-03-06 Tomcat Connectors 1.2.48 Released
The Apache Tomcat Project is proud to announce the release of version 1.2.48 of Apache Tomcat Connectors. This version fixes a number of bugs found in previous releases.
2015-03-17 Apache Standard Taglib 1.2.5 Released
The Apache Tomcat Project is proud to announce the release of version 1.2.5 of the Standard Taglib. This tag library provides Apache’s implementation of the JSTL 1.2 specification.
Version 1.2.5 is a minor bug fix release reverting a change made in 1.2.1 where modified the HTTP method during POST operations, and fixing an issues that resulted in an AccessControlException during startup unless permission was granted to read the accessExternalEntity property.
Please see the Taglibs section for more details.
2013-11-11 Tomcat Maven Plugin 2.2 Released
The Apache Tomcat team is pleased to announce the release of Tomcat Maven Plugin 2.2. Changelog available here.
The Apache Tomcat Maven Plugin provides goals to manipulate WAR projects within the Apache Tomcat servlet container.
The binaries are available from Maven repositories. You should specify the version in your project’s plugin configuration:
Источник