Build a Java environment (JDK + Tomcat + MySQL)

First, the project environment:

  • Development environment
  • Production Environment
  • test environment
    • Hardware environment:
      • web server: cpu: intel i7,8G memory, 1T Kingston solid state drive, Gigabit LAN
      • Database server: cpu: intel i7,8G memory, 1T Kingston solid state drive, Gigabit LAN
    • Software Environment: (Java)
      • JDK1.8 + Tomcat8.0 + MySQL5.7/Oracle11g

Second, the installation JDK1.8

1. Download and upload it to the / opt / soft directory
2. Extract: tar -zxvf the JDK-8u221-Linux-x64.tar.gz
3. Configure JDK environment variables
to edit the file: vi / etc / profile
at the last to join the cursor :( defined in the end, press the keyboard "O" editor)
Export JAVA_HOME = / opt / Soft / jdk1.8.0_221
Export JAVA_BIN = $ JAVA_HOME / bin
Export JAVA_LIB = $ JAVA_HOME / lib
Export the CLASSPATH =:. $ JAVA_LIB / tools.jar: $ JAVA_LIB / dt.jar
Export the PATH = $ JAVA_BIN: $ the PATH
4. let environment variables to take effect
Source / etc / Profile
5. verify whether the installation was successful jdk
java -version

Third, the installation Tomcat8.5

1. Download, upload https://tomcat.apache.org/
2. unpack: tar the Apache-tomcat-8.5.47.tar.gz -zxvf
3. action must know the four folders
bin: start and stop tomcat service. (Startup.sh and shutdown.sh)
conf: change the port information of tomcat. (Server.xml) The default port is: 8080
logs: log file
webapps: store the project file. (Java project ends with the .war)
4. Start tomcat service
SH startup.sh
5. access tomcat default item in the browser, tomcat determine whether the installation was successful
http://192.168.1.82:8080

Fourth, the installation MySQL database

1, download and upload to / opt / soft directory
https://www.mysql.com/

2, extract: tar -xvf mysql-5.7.27-1.e17.x86_64.rpm-bundle.tar

3, empty linux comes with the database
to see if there are older versions of the database:
RPM -qa | grep MySQL
RPM -qa | grep MariaDB

Remove the existing database :( uninstalling this package will also uninstall dependent packages together)

yum -y remove mariadb-libs-5.5.56-2.e17.x86_64

4, Community Edition server installation package mysql:
mysql-Community Community-Server-5.7.27-1.el7.x86_64.rpm

5 found necessary dependencies. Therefore install dependencies
1, install perl dependencies: yum -y install perl
here with perl package 27 is mounted. 3 contains dependencies

2. Installation mysql-community-common dependencies
rpm -ivh mysql-community-common- 5.7.27-1.el7.x86_64.rpm

3. Install mysql-community-client dependencies
rpm -ivh mysql-community-client- 5.7.27-1.el7.x86_64.rpm

发现这个包依赖于:mysql-community-libs。所以先装mysql-community-libs包。
安装mysql-community-libs库包:
rpm -ivh mysql-community-libs-5.7.27-1.el7.x86_64.rpm 

4. install mysql-community-client dependencies:
RPM -ivh mysql-community-client-5.7.27-1.el7.x86_64.rpm

5. Install mysql community server package again:
RPM -ivh mysql-Community Community-the Common-5.7.27-1.el7.x86_64.rpm

6. Verify that mysql is installed successfully. (Not being given instructions to start successfully)
to start MySQL service: systemctl start mysqld.service

5, configuration JAVA project

Items comprising: package (.war) + packet (.sql)
. 1, the program is uploaded to .war webapps directory under tomcat
2, the data import .sql Navicat
. 3, the service start tomcat
SH the startup.sh
. 4, modify the project file for the database connection. So that the project connected to the database.
The default path: /opt/soft/apache-tomcat-8.5.47/webapps/test/WEB-INF/classes
Review:
database server IP address:
database name: myroot
remote connection user name: myroot
remote user password: 123456

Guess you like

Origin www.cnblogs.com/TD1900/p/11775371.html