Professional Documents
Culture Documents
Instalando Tomcat 9 en Rhel 8
Instalando Tomcat 9 en Rhel 8
export VER="9.0.64"
wget https://archive.apache.org/dist/tomcat/tomcat-9/v${VER}/bin/apache-
tomcat-${VER}.tar.gz
Extract downloaded file with tar.
bin: contains
the binaries and scripts (e.g startup.sh and shutdown.sh f
or Unixes and Mac OS X).
logs: contains Tomcat’s log files. You may need to check for
error messages here.
[Unit]
Description=Tomcat
After=syslog.target network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=JAVA_HOME=/usr/lib/jvm/jre-openjdk
Environment='JAVA_OPTS=-Djava.awt.headless=true'
Environment=CATALINA_HOME=/usr/share/tomcat
Environment=CATALINA_BASE=/usr/share/tomcat
Environment=CATALINA_PID=/usr/share/tomcat/temp/tomcat.pid
ExecStart=/usr/share/tomcat/bin/catalina.sh start
ExecStop=/usr/share/tomcat/bin/catalina.sh stop
[Install]
WantedBy=multi-user.target
Update CATALINA_OPTS values with your memory limits for Tomcat
service.
● tomcat.service - Tomcat
Active: active (running) since Sat 2018-12-29 11:18:44 EAT; 29s ago
Process: 31508 ExecStart=/usr/share/tomcat/bin/catalina.sh start (code=exited,
status=0/SUCCESS)
To this point, you have done a great work of installing and configuring
Tomcat. The missing piece is configuration of users which are used to
access Tomcat web management interface.
Edit the users configuration file:
sudo vi /usr/share/tomcat/conf/tomcat-users.xml
Add below line before </tomcat-users>
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<VirtualHost *:80>
ServerAdmin root@localhost
ProxyPreserveHost On
</VirtualHost>
tomcat.example.com should be value of your tomcat server name.
<VirtualHost *:80>
ServerName example.com
ProxyRequests Off
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/
</VirtualHost>
Configure SELinux for Apache to access Tomcat.
sudo setsebool -P httpd_can_network_connect 1