tomcat
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tomcat [2020/06/11 21:08] – k2patel | tomcat [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 45: | Line 45: | ||
</ | </ | ||
</ | </ | ||
+ | |||
+ | ==== RHEL 8 / Tomcat 9==== | ||
+ | |||
+ | === Install Packages === | ||
+ | <code bash> | ||
+ | dnf install java-1.8.0-openjdk-devel tar apr-util-devel apr-util-openssl gcc openssl-devel | ||
+ | </ | ||
+ | |||
+ | === Create User === | ||
+ | <code bash> | ||
+ | groupadd --system tomcat -g 91 # with group id 91 | ||
+ | useradd -u 91 -d / | ||
+ | </ | ||
+ | |||
+ | === Download Tomcat Package === | ||
+ | <code bash> | ||
+ | export TOM_VERSION=" | ||
+ | wget " | ||
+ | </ | ||
+ | |||
+ | === Extract Package === | ||
+ | <code bash> | ||
+ | tar -xvf apache-tomcat-${TOM_VERSION}.tar.gz -C /usr/share/ | ||
+ | ln -s / | ||
+ | </ | ||
+ | |||
+ | === Set Ownership === | ||
+ | <code bash> | ||
+ | chown -R tomcat: | ||
+ | chown -R tomcat: | ||
+ | </ | ||
+ | |||
+ | === Systemd service === | ||
+ | <code bash | / | ||
+ | [Unit] | ||
+ | Description=Tomcat Server | ||
+ | After=syslog.target network.target | ||
+ | |||
+ | [Service] | ||
+ | Type=forking | ||
+ | User=tomcat | ||
+ | Group=tomcat | ||
+ | |||
+ | Environment=JAVA_HOME=/ | ||
+ | Environment=' | ||
+ | Environment=CATALINA_HOME=/ | ||
+ | Environment=CATALINA_BASE=/ | ||
+ | Environment=CATALINA_PID=/ | ||
+ | Environment=' | ||
+ | ExecStart=/ | ||
+ | ExecStop=/ | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | |||
+ | === Backup / Remove examples === | ||
+ | <code bash> | ||
+ | cp -Rp / | ||
+ | rm -rf / | ||
+ | </ | ||
+ | |||
+ | === Set User === | ||
+ | <code xml | tomcat-users.xml> | ||
+ | <role rolename=" | ||
+ | <role rolename=" | ||
+ | <role rolename=" | ||
+ | <role rolename=" | ||
+ | <role rolename=" | ||
+ | <user username=" | ||
+ | </ | ||
+ | |||
+ | === Tomcat Native === | ||
+ | <code bash> | ||
+ | cd / | ||
+ | tar -xvf tomcat-native.tar.gz | ||
+ | cd tomcat-native-1.2.24-src/ | ||
+ | ./configure --with-java-home=/ | ||
+ | make && make install | ||
+ | </ | ||
+ | |||
+ | <code bash | / | ||
+ | LD_LIBRARY_PATH=$LD_LIBRARY_PATH: | ||
+ | export LD_LIBRARY_PATH | ||
+ | </ | ||
+ | |||
+ | :!: Set SSL[[tomcat# | ||
+ | :?: Set Auto redirect if needed [[tomcat# | ||
+ | |||
+ | === Start Service === | ||
+ | <code bash> | ||
+ | systemctl daemon-reload | ||
+ | systemctl enable tomcat | ||
+ | systemctl start tomcat | ||
+ | </ | ||
+ | |||
+ | === Firewall === | ||
+ | <code bash> | ||
+ | firewall-cmd --permanent --add-port=8080/ | ||
+ | firewall-cmd --permanent --add-port=8443/ | ||
+ | firewall-cmd --reload | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ |
tomcat.1591909688.txt.gz · Last modified: 2020/08/10 02:30 (external edit)