Install JDK, Tomcat and MySQL on Tencent Cloud Server (local reference)

1. Install JDK

  1. Download jdk (download tar.gz format)
    http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

You need to log in to download now, you can use the link I shared on Baidu Netdisk
: https://pan.baidu.com/s/163wwuhnCrcX5qs25l6tBNg
Extraction code: b301
insert image description here
2. Create a new java file under /usr, (I use xftp Upload the compressed package)
insert image description here
3. Then decompress the installation package by entering the following command in Xshell (note that the version number may be different, just modify it to the previously downloaded version)

   tar-zxvf  jdk-8u231-linux-x64.tar.gz

Configure JDK environment variables

  1. Enter the text editing state, the cursor goes to the end of the last line of the file

i enter edit mode

  1. Insert the following code in the last line
export JAVA_HOME=/usr/Java/jdk1.8.0_181
export CLASSPATH=.:${
    
    JAVA_HOME}/jre/lib/rt.jar:${
    
    JAVA_HOME}/lib/dt.jar:${
    
    JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${
    
    JAVA_HOME}/bin
  1. Press the esc key to switch to the command mode, enter: wq to save the file and exit;

  2. Environment variables take effect and check

./etc/profile
java -version

insert image description here

2. Install Tomcat (download tar.gz format)

  1. Official website download: https://tomcat.apache.org/download-80.cgi

Baidu Netdisk has shared
the link: https://pan.baidu.com/s/1OOmE9BerIDuZnMIRbFdUrQ
Extraction code: 3osh
insert image description here
2. Upload to the server /usr/java via Xftp (if it is local Linux, you can directly copy it to the corresponding directory )
insert image description here

  1. Enter the following command in Xshell to decompress the installation package (note that the version number may be different, just modify it to the previously downloaded version)

tar -zxvf apache-tomcat-9.0.30.tar.gz

  1. start tomcat

    1. After decompression, enter the following command to enter the bin directory of Tomcat

      cd /usr/java/apache-tomcat-9.0.30/bin

      Note your folder name
      insert image description here

    2. start tomcat

      ./startup.sh
      

    insert image description here

3. MySQL installation

1. Install MySQL

  1. MySQL depends on libaio, so install libaio first

    	yum   install libaio
    
  2. Check if MySQL is installed

     yum list installed | grep mysql
    

    Uninstall if already installed

    yum -y remove mysql-libs.x86_64
    
  3. Download MySQL Yum Repository

    wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
    
  4. Add MySQL Yum Repository to your system repository list, execute

    yum localinstall mysql-community-release-el7-5.noarch.rpm
    

    You need to enter y to continue, and the prompt "complete!" indicates that the source is added successfully.

  5. Select the MySQL version to start

    yum repolist all | grep mysql (查看mysql报告列表)
    

    View the current MySQL version started

    yum repolist enabled | grep mysql
    
  6. Install MySQL via yum

    yum install mysql-community-server
    
  7. Start or shut down MySQL

    1. Start MySQL Server

      systemctl start mysqld
      
    2. View MySQL Server status

      systemctl status mysqld
      
    3. Shut down MySQL Server

      systemctl stop mysqld
      
    4. Restart MySQL Server

      systemctl restart mysqld
      

Guess you like

Origin blog.csdn.net/weixin_38746118/article/details/103809710