Ali deploy the Web project to the cloud server

surroundings:

项目开发环境:win10,idea2018,tomcat-9.0.12
部署环境:Linux(Centos 7.7 64位),MySql 5.5,tomcat

Specific steps:

The project deployed for personal blog (Lite version) to offer the program source code .

  • Linux configuration (JDK, tomcat, mysql)

    • Tools used in the project are local configuration or installation required on the server

    • JDK
      1. Download the official JDK rpm package
        command:# wget https://javadl.oracle.com/webapps/download/AutoDL?<br/>BundleId=240717_5b13a193868b4bf28bcb45c792fce896 -O jdk.rpm
      2. JDK installation
        command: # rpm -ivh jdk.rpm(Note: Install the package operation requires root privileges)
      3. Verify successful installation
        command: # java -version
        The output is:
        Here Insert Picture Description
    • tomcat-9.0.12
      1. Download Tomcat archive:
        command:# wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.47/bin/apache-tomcat8.5.47.zip -O apache-tomcat-8.5.47.zip
      2. Unzip Tomcat
        command:# unzip apache-tomcat-8.5.47.zip
      3. Modify executable permissions
        command:
        # cd apache-tomcat-8.5.47/bin
        # chmod +x *.sh
      4. Start Tomcat
        command: # sh bin/startup.sh
        The results are shown:Here Insert Picture Description
      5. Verify that the startup success
        have here are three ways to verify (to choose one):
        (1) method to see if there is tomcat process
        # ps aux | grep tomcat
        results: Here Insert Picture Description
        whether (2) Method 2 port 8080 is bound to see
        # netstat -anp | grep 8080
        results shown: Here Insert Picture Description
        (3 ) method 3 using the command to access the default demo curl
        # curl 127.0.0.1:8080
        results are shown (only a portion of the screenshot):Here Insert Picture Description
      6. Local Tomcat default browser to visit the page: you can see the page Here Insert Picture Description
        Note: You need to turn on "security group" function server before the local browser to access the page
        (1) into the security group: a cloud server management console → → instance management
        Here Insert Picture Description
        (2) examples of this group → security configuration rules
        Here Insert Picture Description
        (3) click to add the security group rules Here Insert Picture Description
        (4) fill out the need to add a port number and an authorization object (click on the "teach me to set" reference documents to fill in) completed, click to confirm after it has finished you will see in "the direction" of their own security group just added Here Insert Picture Description
        (5) can now access the browser to tomcat on your own server, the link is: HTTP: // public network ip: 8080
        (Note : be sure to start the tomcat come visit, be sure accessed through its own public ip, using their own modified port number after the port number if there is no access to modify the default is 8080, modified)
    • MySql: CentOS yum install by MariaDB 7 steps in this article in great detail, refer to the installation
  • Creating project-related databases and tables in mysql

    • Table can be created and operated by a command line
    • Navicat mysql database can also connect remote server
      to add port 3306 by the same security group 8080 port security method of adding the above-mentioned group (1)
      (2) mysql database on the server in the user table corresponding to the user into the Host field %, sql statement as follows: update user set Host='%' where User='root';
      (3) after the above configuration is connected to try navicat, attention is connected to the host server public network ip ip
  • Modify the configuration file in the local project

    • tomcat path in the project file should be changed to tomcat server installed in its own path
    • File access link tomcat of the public network ip ip instead of the server
  • The project is packaged as war package

  • deploy

    • The war package copied to the webapps directory of tomcat server, tomcat will automatically extract deployment (Note: If the previous deployed prior to this project, you need to delete the relevant package)
    • It remote server connection using putty, putty upload and download files is slightly different method:
      (. 1) included in the installation package putty dedicated uploading and downloading tool: pscp, psftp (if not also the ability to download)
      (2) herein to psftp for example:
      Upload: find putty in the installation directory of the machine, found in the directory psftp.exe double-click operation
      (3) enter the command: open 自己的服务器公网ip
      you will be prompted to log in after (4) inputs, as usual, like remote login, enter your user name and password Sign in to
      (5) after a successful login will be displayed: Remote working directory is / root, meaning the current directory for the root,
      (6) to a target directory to copy a file to be stored: cd 目标目录路径after the command will prompt the current directory again
      (7) to be copied into the local file directory: lcd 源拷贝文件目录路径after command execution will prompt the current directory where local
      (8) copies of realization: put 文件全名.文件格式after command execution is displayed: local: the full filename => remote: target path
  • After the deployment is complete you can access through a browser project

    Link ip address Note Access project for the public network server ip

Guess you like

Origin blog.51cto.com/14233363/2479652
Recommended