zoukankan      html  css  js  c++  java
  • sonar之安装篇

    sonar 是一个很好的质量度量平台,安装方式有很多种。下面我教大家使用j2ee 容器的方式安装,我们使用tomcat

    1.准备:

    1.1 环境redhat linux
    1.2 下载sonar 从http://www.sonarsource.org/
    1.3  安装mysql,一般系统自带的就可以,直接使用service mysql start 即可启动
    1.4  需要jdk1.6 的版本
    1.5 下载tomcat,从tomcat.apache.org,版本6.0 系列

    2. 安装

    2.1首先建一个目录:mkdir /soft

    2.2 cp sonar$version.zip /soft

    2.3 cp tomcat$version.zip /soft

    2.4 解压sonar 和tomcat 使用unzip 命令

    2.5 cd /soft/sonar$vesion

    2.6 修改 conf/sonar.properties 如下 

    1. # The schema must be created first.
    2. sonar.jdbc.username:                       sonar
    3. sonar.jdbc.password:                       sonar
    4. #----- MySQL 5.x/6.x
    5. # Comment the embedded database and uncomment the following line to 
    6. use MySQL
    7. sonar.jdbc.url:                            jdbc:mysql://localhost:3306/sonar?user=sonar&password=sonar&useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
    8. # Optional properties
    9. sonar.jdbc.driverClassName:                com.mysql.jdbc.Driver
    10. sonar.jdbc.validationQuery:                select 1

     

    2.7 在mysql 里创建数据库sonar,及其使用sonar,sonar 用户名和密码访问授权操作,命令如下: 

    1. mysql
    2. mysql>create database sonar;
    3. mysql>grant all on *.* to sonar@'localhost' identified by 'sonar';
    4. mysql>grant all on *.* to sonar@'%' identified by 'sonar';
    5. mysql>flush privileges;

     

    2.8 build sonar 的war 包,修改文件 /soft/sonar$version/war/sonar-server/WEB-INF/classes/sonar-war.properties
    SONAR_HOME=/soft/sonar$version (即sonar 的解压目录)
    cd /soft/sonar$version/war
    sh ./build-war.sh

    2.9 复制 sonar.war 到tomcat/webapps/

    2.10 修改tomcat 参数,修改$tomcat_home/bin/catalina.sh, 添加如下
    CATALINA_OPTS="-Xmx1024m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -XX:MaxPermSize=256m"

    2.11 启动tomcat,cd $tomcat_home/bin; sh ./startup.sh

    3. 访问sonar:htt://localhost:8080/sonar ,使用admin,admin 即可登录

     

    更多资料关注:www.kootest.com ;技术交流群:182526995

  • 相关阅读:
    DB2高可用hadr搭建参数配置
    redis一主两从搭建
    hdu 1064 Financial Management(超级大水题)
    hdu 1009 FatMouse' Trade(贪心水题)
    文件选择性加密解密
    uva 10405 Longest Common Subsequence(最长公共子序列)
    UVa 111 History Grading (最长公共子序列)
    hdu 2550 百步穿杨(大水题)
    UVa 10066 The Twin Towers(LCS水题)
    ASP.NET学习参考站点
  • 原文地址:https://www.cnblogs.com/kootest/p/4088088.html
Copyright © 2011-2022 走看看