Tomcat is a web server software based on java language. This article mainly introduces how to configure java environment on centos7.5 and install tomcat
1. Install the Java environment:
Visit orcal official website to download the JDK rpm package: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
After the download is complete, execute: rpm -ivh jdk-8u161-linux-x64.rpm
to install, it will be installed in the /usr/java directory by default
After the installation is complete, modify the /etc/profile file and add java environment variables:
export JAVA_HOME=/usr/java/jdk1.8.0_161/export CLASSPATH=.:JAVAHOME/jre/lib/rt.jar:JAVA_HOME/lib/dt.jar:JAVAHOME/lib/tools.jarexportPATH=PATH:
Execute after adding: source /etc/profile to make the configuration effective
Execute: java -version
to verify whether the configuration is successful, the following interface appears, indicating that the configuration is successful
2. Install Tomcat
Visit the official apache website and download the tomcat source package: https://tomcat.apache.org/download-80.cgi
When downloading, be sure to select the source package in Binary Distributions
After downloading, unzip, copy the contents of the unzipped directory to /usr/local/tomcat (/usr/local/tomcat directory needs to be created manually)
tar -xf apache-tomcat-8.5.38.tar.gz
mkdir /usr/local/tomcat8
mv apache-tomcat-8.5.38/* /usr/local/tomcat8/
cd /usr/local/tomcat8/bin
. /startup.sh
So far tomcat has been installed successfully, visit to test:
to sum up
The above is the entire content of this article. I hope that the content of this article has a certain reference value for your study or work. Thank you for your support to ZaLou.Cn. If you want to know more about it, please check the related links below
Recommended Posts