從http://www.sonarqube.org/downloads/下載安裝文件mysql
本文安裝在centos下。linux
一、解壓sonarqube-5.1.zip,上傳到服務器中。web
二、修改執行權限sql
# 進入運行目錄 cd /usr/local/sonarqube-5.1/bin/linux-x86-64/ # 修改權限 chmod +x /usr/local/sonarqube-5.1/bin/linux-x86-64/sonar.sh chmod +x /usr/local/sonarqube-5.1/bin/linux-x86-64/wrapper
三、加入到系統環境變量shell
vi /etc/profile export PATH=$PATH:/usr/local/sonarqube-5.1/bin/linux-x86-64/ # 使環境變量生效 source /etc/profile
四、配置sonar與數據庫的鏈接(會自動建立表等)數據庫
vi /usr/local/sonarqube-5.1/conf/sonar.properties # 編輯jdbc的用戶名和 sonar.jdbc.username=root sonar.jdbc.password=123456 # 配置mysql #----- MySQL 5.x # Only InnoDB storage engine is supported (not myISAM). # Only the bundled driver is supported. sonar.jdbc.url=jdbc:mysql://192.168.1.56:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance # 配置web sonar.web.host=192.168.1.19 sonar.web.port=8080 sonar.web.context=/sonar
五、啓動服務centos
sonar.sh start
六、訪問服務器
http://192.168.1.19:8080/sonarapp