Server environment ready

Two days before the operation because of his sucker right out collapse of the server (using the delete command to warn you to be careful again !!!), fortunately database is backed up in advance! (Almost to form good habits !! cool !!) Well, no way can only be reset Ali cloud server back server environments deployed! !

Here the record about some of the pit I encountered! ! This article is only the most basic knowledge! ! Here started

 First talk about the server: system aliyun (debian9) Ali cloud console provides one-snapshot restore functionality, so that you can restore the server snapshot abnormal state on the server, but this requires you to manually generate a snapshot file, but I never done this operation, nothing snapshot area (I suggest that you must configure snapshots! preventive measures !!).

 Reset the system from the console, using local Xshell or other remote connection server software:

  We need to do a few steps

  1. Installation configuration environment variables jdk

  2. Install mariadb

  3. Install tomcat

  4. Project packed and some precautions

      ① First, go orcal official website to download jdk1.8 connection https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html current government has just made a bug on the 1.8 upgrade, it is recommended to use 191 or higher version, here choose 8u211

 

First create the directory / usr / local / java archive will be uploaded to the sub-directory, and then extract, edit the environment variables / etc / profile add JAVA_HOME end

    the JAVA_HOME = Export / usr / local / java / jdk1.8
         Export the CLASSPATH =:. $ the JAVA_HOME / lib / the tools.jar: $ the JAVA_HOME / lib / Dt.jar
         Export the PATH the PATH = $: $ the JAVA_HOME / bin
to check the installation results jdk java -version appear

Description jdk environment variable configuration is successful.

 ② Debian package has been provided mariaDb first to import warehouse keys with the following command and get mariaDB warehouse

  sudo apt install software-properties-common dirmngr

  sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

  sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.dotsrc.org/mariadb/repo/10.3/debian stretch main'

Installed by the following command

  sudo apt-get  update

  sudo apt-get install mariadb-server

The installation process will let you enter the root password to enter your password Wait for the installation to complete.

About mariadb First, it can access only local default file comment out going /etc/mysql/mariadb.conf.d/50-server.cnf

bind-address = 127.0.0.1 (preceded by #)

And then is set user permissions:

. Grant ALl PRIVILEGES ON * * To ' username' @ '%' IDENTIFIED BY 'password' WITH GRANT OPTION here gives you maximum user permissions do not propose to deal with the real situation regarding rights refer to https: // www. cnblogs.com/Csir/p/7889953.html

Used locally Navicate such as database management software, database connection is successful it means that you can remotely access! At this point the database installation is complete!

③ local tomcat uploaded to the server to download unzip

 Tomcat's bin directory to store execution ./startup.sh start tomcat execution ./shutdown.sh close

Special project deployment will be a lot of problems at this time to pay attention to the tomcat log file in the logs directory catalina.out equivalent compiler console detailed exception here will be reminded localhost-2019-0X-0X here most are single-day record of error log information can be found find and solve problems in both the log file! ! !

④ project uses jfinal frame if you want to understand this framework venue https://www.jfinal.com/

Special attention jfinal tomcat package to deploy to the outside is a must see https://my.oschina.net/jfinal/blog/353062

Configuring virtual path can help you avoid a lot of pit! ! !

Record two error information

1.Access denied for user 'XXX' @ 'localhost' cause failure of the database connection problems

  First, because when you do not have permission to check your permissions do not question what path is OK, then I suggest we must look at a user name and password (I was stuck in the password !! careless !!)

2. The system uses a two-dimensional code error NoclassdefFoundError: could not initialize class java.awt.imageBufferedImage error

  Solution: Simply start the TOMCAT parameters plus "-Djava.awt.headless = true \"
boot file is: \ bin \ catalina.sh  
added context is
 the else
    "$ _RUNJAVA" the JAVA_OPTS $ $ CATALINA_OPTS \
      -Djava.endorsed = .dirs "$ JAVA_ENDORSED_DIRS" -classpath "$ the CLASSPATH" \
      -Dcatalina.base = "$ CATALINA_BASE" \
      -Dcatalina.home = "$ CATALINA_HOME" \
      -Djava.io.tmpdir = "$ CATALINA_TMPDIR" \
      -Djava.awt .headless = true \ ********* add this line **************
      org.apache.catalina.startup.Bootstrap "$ @" Start \
      >> "$ CATALINA_BASE "/logs/catalina.out 2> &. 1 &

      IF [the -Z!" $ CATALINA_PID "]; the then
        echo $>!CATALINA_PID $
      Fi
  Fi

elif [ "$. 1" = "STOP"]; the then
applied when the attention position (stop position of the key flag)

Kick call it a day! !

 

Guess you like

Origin www.cnblogs.com/lemon-sky/p/11162975.html