Build a tomcat server and deploy the project under Linux7.4

1. Deploy jdk environment [operating system: centos7.4 64-bit, jdk version: jdk1.8]

1)下载jdk包
  官网下载地址:https://www.oracle.com/cn/java/technologies/javase/javase-jdk8-downloads.html
  
2) 解压压缩包,这里我放在了/softWare/java_environment/目录下
  [root@lemon java_environment]# tar -xzvf jdk-8u141-linux-x64.tar.gz
  
3)配置java环境变量,在文件【/etc/profile】末尾添加以下内容
  export JAVA_HOME=/softWare/java_environment/jdk.1.8.0_141
  export JRE_HOME=${
    
    JAVA_HOME}/jre
  export CLASSPATH=.:${
    
    JAVA_HOME}/lib:${
    
    JER_HOME}/lib
  export PATH=${
    
    JAVA_HOME}/bin:$PATH

4) 保存文件退出后,输入命令使得配置生效
  source /etc/profile5
  
5) 验证结果正确性,配置正确
[root@lemon jdk1.8.0_141]# java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

2. Download the Tomcat resource package

Official website download address, the 8.0 version deployed this time: [http://tomcat.apache.org/download-80.cgi]

3. Download the package in tar.gz format here. Unzip the compressed package.
Insert picture description here
4. Enter the bin directory under the tomcat directory with the cd command, and execute the command ./startup.sh to start Tomcat, and
Tomcat started appears as shown in the figure below.
Insert picture description here
5. Browser Access tomcat address: http://virtual machine ip address: 8080
Insert picture description here
6. Modify the default port of tomcat access
    1) Enter the conf folder under the tomcat installation directory and edit the server.xml file. Modify the value of the port field to what you want, save and exit.
Insert picture description here
    2) Restart the tomcat service
    3) Use port 8088 to successfully access
Insert picture description here
7. Deploy the project to tomcat

1) Copy the project war package to the [tomcat installation directory/webapps] path
2) Copy the database and other configuration files in the project to the [tomcat installation directory/conf] path, pay attention to whether the database information configuration in the configuration file is configured Correct
3) Start tomcat

Guess you like

Origin blog.csdn.net/weixin_43161762/article/details/113738105