introduce

Recently ali cloud offers a particularly large, the configuration of the same old users more than 1000, and the new user spends only 100 can be bought, used to learn better, but a lot of friend don’t know how to configure, also don’t know the MySQL installation which version, just write a simple tutorial, builds the foundation environment, in order to facilitate everybody bought directly, The original link puts the purchase address of Ali Cloud (you need to join the group to enjoy the discount, the original link has joined the group, directly enjoy the discount)

Install JDK and Tomcat

               

If you don’t know the user name and password, you can go to the console to check and change the password directly. For Linux, you can download the file directly with the wget command, upload the local file to the server with the Rz command, and download the file from the server to the local server with the sz command. Windows version can deploy FTP or directly through a remote connection to transfer files, Windows version no longer overview, put a small blog link, interested can go to see, small edition installed environment is CentOS7.3

https://blog.csdn.net/zzti_erlie/article/details/52886563

Download the JDK

CD /usr/libwget JDK address: tar -xvf JDK-8u191-linux-x64.tar.gzCopy the code

Configure system environment variables

The system level can also be configured at the user level

vim /etc/profileCopy the code

The JAVA_HOME directory is the installation directory. Go to the bin directory and add it to the end of the /etc/profile file

JAVA_HOME = / usr/lib/jdk1.8.0 _191PATH = $JAVA_HOME/bin: $PATHCLASSPATH = $JAVA_HOME/jre/lib/ext: $JAVA_HOME/lib/view jarexport PATH JAVA_HOME CLASSPATHCopy the code

If the profile is reloaded and the version number is displayed, the installation succeeds

source /etc/profilejava -versionCopy the code

Download Tomcat

CD ~wget Tomcat address (download one from the official website) tar -xvf apache-tomcat-8.5.34.tar.gzCopy the code

The ports of Ali Cloud need to be opened to the console, and the system only opens 3 ports by default

Open port 8080. If any port needs to be opened in the future, configure it here

XML in the conf directory and change the port to 80. Then you can directly view the tomcat home page through the IP address. If you want to display your own project, you can configure it without the overview. You can also name your own project ROOT and delete the original Tomcat ROOT project

<Connector port="80" protocol="HTTP/1.1"       connectionTimeout="20000"       redirectPort="8443" />Copy the code

Downloading Common Commands

Yum install LRZSZ yum install lsofCopy the code

MySQL installation

Check whether the MySQL server is installed

rpm -qa | grep mysqlCopy the code

Since most people are buying the 1 core 2G version, I recommend you install the 5.5 version first. 5.6, 5.7, 8.0 is not enough memory to play with

Download MySQLrpm package

yum install https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpmCopy the code

Set the installation version to 5.5 and open the following configuration file

vim /etc/yum.repos.d/mysql-community.repoCopy the code

Set mysQL55’s Enabled to 1 and mysQL57’s Enabled to 0

[mysql55 - community] name = MySQL 5.5 community Serverbaseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/7/$basearch/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm -gpg/RPM-GPG-KEY-mysqlCopy the code

See if it’s the version you want

[root@iZ2zef7763ohogr3qilvctZ ~] yum repolist enabled | grep mysqlmysql-connectors-community/x86_64 MySQL Connectors Community 65mysql-tools-community/x86_64 MySQL tools Community 69mysql55- Community /x86_64 MySQL 5.5 Community Server 41Copy the code

MySQL installation

yum install mysqlCopy the code

To start MySQL, you must download the mariadB-server package

yum install mariadb-server -ysystemctl start mysqldCopy the code

No password initially

Update mysql.user set password= password ('yourpassword') where user='root'; # update privileges flush PRIVILEGES;Copy the code

So the next time you log in, you have to log in like this

Mysql -u root -pCopy the code

Setting boot

systemctl enable mysqldsystemctl daemon-reloadCopy the code

Add remote accounts so they can be accessed through Navicat, etc

GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;Copy the code

Recommended reading

Thread pool implementation Principle -1

Three kinds of traversal implementation of binary tree

Talk about logging in

Java knowledge hall

A public account with dry goods