Install SonarQube code scanning tool on CentOS
One, install JDK
1. JDK is the operating environment of SonarQube. From the documentation, Documentation | SonarQube Docs https://docs.sonarqube.org/7.9/, you can see that you need Java11 or higher.
2. After downloading Java11 from Oracle's official website , upload it to Server
3. Run commands on the server
rpm -ivh 文件名.rpm
- Use the following command to verify the successful installation of the Java environment
Second, install SonarQube
- Download on SonarQube official website at: https://www.sonarqube.org/
- After local decompression, upload the folder to the server
- New sonar user
useradd sonar
- Recursively empower the SonarQube program folder
chmod 777 SonarQube文件夹名称 -R
chgrp 777 SonarQube文件夹名称 -R
- Enter the directory /sonarqube-8.6.1.40680/bin/linux-x86-64
- Switch to the sonar user and run the sonar.sh file in the directory
- Open port 9000
firewall-cmd --zone=public --add-port=9000/tcp --permanent # 开放9000端口
- Use a browser to access SonarQube, IP address: 9000, login account and password are both admin, you need to modify the initial password after logging in