Sonar Qube 설치
java 1.8
1 2 3 4 5 6 7 8 9 10 11 12 |
tar xf jdk-8u121-linux-x64.tar.gz mv jdk1.8.0_121 /usr/lib/jvm ln -s /usr/lib/jvm/jdk1.8.0_121 /usr/lib/jvm/java echo "##################################################################################" >> /etc/profile echo "# $WORK_DATE " >> /etc/profile echo "# add environment variable " >> /etc/profile echo "##################################################################################" >> /etc/profile echo "JAVA_HOME=/usr/lib/jvm/java" >> /etc/profile echo "export JAVA_HOME" >> /etc/profile echo "PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile source /etc/profile java -version |
nginx install
1 |
yum install nginx |
vi /etc/nginx/nginx.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/conf.d/*.conf; } |
vi /etc/nginx/conf.d/virtual.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
server { listen 80; server_name localhost; client_max_body_size 200M; location / { proxy_pass http://admin-was; proxy_set_header Accept-Encoding ""; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; } location /sonarqube { proxy_pass http://sonarqube; proxy_set_header Accept-Encoding ""; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; } } upstream admin-was{ ip_hash; server 10.0.0.40:8080; } upstream sonarqube{ ip_hash; server 10.0.0.40:9003; } |
mysql 5.6 install
1 |
apt-get install mysql-server |
create database
1 2 |
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_bin; GRANT ALL PRIVILEGES ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonarPwd'; |
vi /etc/my.cnf
1 2 3 |
[mysqld] max_allowed_packet=1G innodb_log_file_size=128M |
sonarqube install
1 2 |
wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.7.zip unzip sonarqube-6.7.zip |
vi sonarqube-6.7/conf/sonar.properties
1 2 3 4 5 6 7 8 9 |
sonar.jdbc.username=sonar sonar.jdbc.password=sonarPwd sonar.jdbc.url=jdbc:mysql://10.0.0.100:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false&maxAllowedPacket=134217728 sonar.web.context=/sonarqube sonar.web.port=9003 sonar.ce.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError sonar.search.javaOpts=-Xms512m \ -Xmx512m \ -XX:+HeapDumpOnOutOfMemoryError |
sonarqube-6.7/bin/linux-x86-64/sonar.sh start
http://localhost/sonarqube 접속
프로젝트 생성
Administration → Project → Management 클릭
Language plugin 설치
Administration → Marketplace 클릭