Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

If you want to have your own server, you need to build a server. The server can be built in Linux or Windows. The mainstream servers are built in Linux.

Linux environment installation tutorial

To build a server, you must first have a Linux environment. VMware VM and centos image files are essential

VMware download address password: 77yb

Centos download address

Install VMware

After downloading, the next step of the idiot installation will be successful, as shown in the figure below:

Creating a VM

With VMware installed, it’s time to create a new virtual machine

You can choose either a typical installation or a custom installation, but we’ll choose a typical installation for convenience

Then import the downloaded centos image file

You need to select the disk size. The default is 20GB

Enter the centos installation page, select the first one, Install centos 7

Set the user name and password

Once installed, you are ready to enter the world of Linux

Setting up the Web Environment

If you need to deploy your application to Linux, you need to set up the Web environment after installing it. To set up the Web environment, you need JDK,mysql, and Tomcat

The three software download address: pan.baidu.com/s/1twEJsEVz… Password: 63 kw

You are advised to install the software in the CD /usr/local directory

mkdir jdk18.

mkdir tomcat

mkdir mysql
Copy the code

The created folder is shown in the figure below

J d K installation

First install the JDK, unpack the JDK installation package and enter commands to edit the profile file

Vim /etc/profile #set Java environment Java \_HOME= /usr/local/jdk1.7.0_71 CLASSPATH=.:$Java \_HOME/lib.tools.jar PATH=$JAVA\_HOME/bin:$PATH to the last line of the profile: wq save and exitCopy the code

Go to the CD /usr/local/jdk1.7.0_71/bin directory

Type the command

sudo yum install glibc.i686

source /etc/profile

 java -version
Copy the code

If this is displayed, the JDK configuration is successful

Install Tomcat

First decompress, then decompress

Then go to the bin directory of Tomcat

cd /usr/local/tomcat/bin

Start Tomcat

./startup.sh

Open port 8080

/sbin/iptables -I INPUT -p tcp –dport 8080 -j ACCEPT

Page access

Tomcat is installed successfully

Mysql installation

Tar -xvf mysql-5.7.17-1. El5.x86 \_64. RPM -bundle Run the RPM -ivh --force mysql-community-common-5.7.16-1.el6.x86\_64. RPM --nodeps (dependent packages) RPM -ivh command in sequence --force mysql-community-libs-5.7.16-1.el6.x86\_64. RPM --nodeps (jar package) RPM -ivh --force X86 \_64. RPM --nodeps (client) RPM -ivh --force Mysql-community-server-5.7.16-1.el6.x86 \_64. RPM --nodeps (server) Obtain the initial password vim /var/log/mysqld.log from the. Log fileCopy the code

The default password is shown in the red box. To change the password, run the following command:

mysql -u root -p

set password = password('root');
Copy the code

Setting password hint password is too easy

After MySQL5.6.6, the password strength verification plug-in validate_password is added, and the related parameter Settings are relatively strict.

The plugin will check whether the password is consistent with the current strength rules and reject the setting if it is not. The following statements and functions are affected: create user,grant,set password,password(), and old password.

The solution

  1. Check mysql global parameter Settings

The problem is related to the value of validate_password_policy in mysql. Take a look at some global parameters related to mSYQL passwords

`mysql> select @@validate_password_policy; ` `+----------------------------+` `| @@validate_password_policy |` `+----------------------------+` `| MEDIUM |` ` + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + ` ` 1 row in the set (0.00 SEC) ` ` mysql > SHOW VARIABLES LIKE 'validate_password %'; ` `+--------------------------------------+--------+` `| Variable_name | Value |` `+--------------------------------------+--------+` `| validate_password_dictionary_file | |` `| validate_password_length | 8 |` `| validate_password_mixed_case_count | 1 |` `| validate_password_number_count | 1 |` `|  validate_password_policy | MEDIUM |` `| validate_password_special_char_count | 1 |` ` + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- + ` ` six rows in the set (0.08 SEC) `Copy the code
  1. Parameter interpretation

    The dictionary file path used by the validate_password_dictionary_file plug-in to verify password strength. Validate_password_length Minimum password length. The default value is 8. The minimum value is as follows: validate_password_number_count + validate_password_special_char_count + (2 * validate_password_mixed_case_count) Validate_password_mixed_case_count Specifies the minimum number of lowercase and uppercase letters in a password. Validate_password_number_count Specifies the minimum number of digits in a password.

    Validate_password_policy Password strength check level. The value can be 0/LOW, 1/MEDIUM, or 2/STRONG. Performed Policy Tests 0 or LOW Length 1 or MEDIUM Length. numeric, lowercase/uppercase, and special characters 2 or STRONG Length; numeric, lowercase/uppercase, and special characters; The default value of dictionary file is 1 (MEDIUM), so the password you set at the beginning must be of length and must contain digits, lowercase or uppercase letters, and special characters.

    Validate_password_special_char_count Specifies the minimum number of special characters to be contained in a password.

  2. Perform operations

At this time to set a simple password can be passed

set password=password('123456'); Open Linux port for external access3306

/sbin/iptables -I INPUT -p tcp --dport 3306-j ACCEPT/etc/rc. D/init. D/iptables save - will change forever to MySQL character encoding firewall Settings. Type the command vi/etc/my CNF \ [the client \]default-character-set = utf8\ [mysqld\] character-set-server = utf8 collation-server = utf8\_general\_ci by default, mysql is safe from default. Remote access to mysql is not supported. Therefore, you need to set the remote access permission to mysql. After logging in to mysql, enter the following command: grant all PRIVILEGES on \*'root' @The '%' identified by '123456'; flush privileges; This way, you can connect using NavicatCopy the code

Tomcat,mysql and JDK have been installed and can be used locally as your own server. Of course, if you don’t want to install Linux locally, you can also buy a cloud server and build a Web environment according to the tutorial.

Full dry goods, write so much, give a praise, I do not learn to suffer wolong eggs, welcome to pay attention to me, learn together, grow up together