gogoWebsite

Linux installation development tools

Updated to 18 days ago

Linux installation development tools

1. Install jdk

First of all, Baidu Netdisk searched to download the linux version of jdk, which is fast and the official website download is slow.

1. Check whether jdk has been installed before
	 rpm -qa|grep java
    2. Query the corresponding installation folder
     whereis java
    3. Create a java directory under /usr/ directory.
	 mkdir /usr/local/java
     cd /usr/local/java
    4. Place the downloaded file in the /usr/local/java/ directory.
    5. Unzip JDK
     tar -zxvf
    6. Set environment variables
	 Modify vi /etc/profile
    Add the following content to the profile file and save:
	 set java environment
	 JAVA_HOME=/usr/local/java/jdk1.8.0_151
	 JRE_HOME=/usr/local/java/jdk1.8.0_151/jre
	 CLASS_PATH=.:$JAVA_HOME/lib/:$JAVA_HOME/lib/:$JRE_HOME/lib
	 PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
	 export JAVA_HOME JRE_HOME CLASS_PATH PATH
   Note: Among them, JAVA_HOME and JRE_HOME are configured according to your actual installation path and JDK version.
 Let the modification take effect:
   source /etc/profile
   7. Test
   java -version
 #jar run
 nohup java -jar >& (note that the & symbol is particularly important and runs for background)
 #Query all jar packages in linux
 ps aux | grep jar
 jps -lvm
 ps aux | grep

 #View the executed java process and kill
   ps -ef |grep java
   kill -9 process number
 #Query the corresponding file location based on a certain file (find from the current current one)
 find ./ -name ""
 #Query from the usr directory
 find /usr/ -name ""

2. Install mysql

Baidu Netdisk search to download the linux version of mysql

1. Query whether mysql has been installed
 rpm -qa | grep mysql
 2. Query the corresponding installation folder
 whereis mysql
 3. Uninstall the installation package
 Use rpm –ev
 mysql-community-client-5.7.22-1.el7.x86_64.rpm mysql-community-libs-5.7.22-1.el7.x86_64.rpm
 mysql-community-common-5.7.22-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.22-1.el7.x86_64.rpm
 mysql-community-devel-5.7.22-1.el7.x86_64.rpm mysql-community-minimal-debuginfo-5.7.22-1.el7.x86_64.rpm
 mysql-community-embedded-5.7.22-1.el7.x86_64.rpm mysql-community-server-5.7.22-1.el7.x86_64.rpm
 mysql-community-embedded-compat-5.7.22-1.el7.x86_64.rpm mysql-community-server-minimal-5.7.22-1.el7.x86_64.rpm
 mysql-community-embedded-devel-5.7.22-1.el7.x86_64.rpm mysql-community-test-5.7.22-1.el7.x86_64.rpm
 4. Delete the file directory
 [root@localhost /]# rm -rf /var/lib/mysql/
 [root@localhost /]# rm -rf /etc/
 [root@localhost /]# rm /usr/
 [root@localhost /]# rm -rf /usr/bin/mysql*
 5. Check again whether the uninstallation is complete
 rpm -qa | grep -i mysql
 or find / -name mysql

 Install mysql link
 6. Place the downloaded mysql file in /usr/local/mysql directory and decompress (using xftp transmission)
 tar -vxf mysql-5.7.22-1.el7.x86_64.
 7. Install the following packages
 rpm -ivh mysql-community-common-5.7.22-1.el7.x86_64.rpm
 rpm -ivh mysql-community-libs-5.7.22-1.el7.x86_64.rpm
 rpm -ivh mysql-community-client-5.7.22-1.el7.x86_64.rpm
 rpm -ivh mysql-community-server-5.7.22-1.el7.x86_64.rpm (If you cannot install it directly, add --nodeps --force)
 8. Check whether the installation is successful
 rpm -qa|grep mysql
 9. Complete the initialization of mysql database
 Enter the initialization command: mysqld --initialize (If you lack numactl, download it yum -y install numactl)
 10. Set mysql permissions (mysql service may not be started without setting)
 chown mysql:mysql -R /var/lib/mysql
 11. Initialize MySQL command:
 mysqld --initialize
 12. Start Mysql:
 systemctl start mysqld
 13. Set up the power-on self-start:
 systemctl enable mysqld
 14. Check the MySQL running status:
 systemctl status mysqld
 The basic settings of the change of login password:
 #15.1 View the initialization password
  cat /var/log/ |grep password
 #15.2 Login
 mysql -uroot -p
 #15.3 Set password
 mysql> set password=password('123456');
 #If an error is reported, it is too simple to declare the password to change the password length
 mysql> set global validate_password_policy=0; //Change password level
 mysql> set global validate_password_length=4; //Change the minimum length of the password
 16. Set up remote connection
 #Add a firewall to open 3306 port
 firewall-cmd --zone=public --add-port=3306/tcp --permanent;
 systemctl restart
 firewall-cmd --reload
 #Set up remote access connection
 mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
 #Username: Authorized user (root)
 #ip address: Released ip address (@ represents all)
 #Password: Set the connection password (123456)
 mysql> flush privileges;// Make the command take effect

 You can use DataGrip connection to test the following

3. Install tomcat

Installing tomcat under linux requires downloading the linux version of tomcat package on the official website of tomcat
Downloaded versionapache-tomcat-8.5.======>corresponding to jdk8
Create a tomcat directory in the /home/usr/ directory to store our download package (upload it to the tomcat directory through xftp)

Enter the corresponding tomcat directory of Linux to decompress the compressed package

1. Decompress the compressed package
    tar -xvf apache-tomcat-8.5.
 2. Delete the installation package file
 rm -rf apache-tomcat-8.5.
   2.1 Configuration environment
   #vim /etc/profile
   Add content
   CATALINA_HOME=/home/usr/tomcat/apache-tomcat-8.5.73
   CATALINA_BASE=/home/usr/tomcat/apache-tomcat-8.5.73
   export CATALINA_HOME CATALINA_BASE
   #Exit edit input command soure /etc/profile to make it take effect
 3. Enter the directory where the startup script is located
 cd apache-tomcat-8.5./bin/
 4. Start tomcat
 sh ./
 5. Close tomcat
    sh ./
 6. Permanently open the port
   firewall-cmd --zone=public --add-port=8080/tcp --permanent
 7. Restart
   systemctl restart
 8. Reload
   firewall-cmd --reload

Deploy the project
Enter vscode to package the project npm run build and finally generate a dist folder. Copy the files in the dist folder to the webapps/ROOT folder under the installed tomcat. After tomcat starts, scan the ROOT directory under webapps by default.

Port occupation>1. End port 2. Modify the configuration file under conf

lsof -i Port Number #Use -i:port to display network information related to the specified port
 Isof -i:8080
COMMAND      PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
docker-pr 154965 root    4u  IPv6 1093930      0t0  TCP *:webcache (LISTEN)
End the process
 kill -9 154965