Installation of Sonar requires but a few simple steps, though they can be rather obscure to many developers.
Connect to MySQL:
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
grant all privileges on sonar.* to 'sonar@localhost' identified by 'sonar';
flush privileges;
Easiest method, if you are on Ubuntu:
sudo vi /etc/apt/sources.list
- Then add the following line:
deb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/
sudo apt-get update
sudo apt-get install sonar
- You will then have to stop/start as above to edit the configuration, generally to change database config:
sudo vi /opt/sonar/conf/sonar.properties
Manual installation (and upgrade?) if you prefer to do things the hard way 🙂
- Download and unzip the release:
wget http://dist.sonar.codehaus.org/sonar-3.6.1.zip
unzip sonar-3.6.1.zip
sudo mv sonar-3.6.1 /opt/sonar
sudo rm -r /opt/sonar (to remove old link)
sudo ln -s /opt/sonar-3.6.1/ /opt/sonar
cd /opt/sonar/conf
vi sonar.properties
(uncomment lines for MySQL, comment out H2)
sudo cp /opt/sonar/bin/linux-x86-64/sonar.sh /etc/init.d/sonar
-
sudo vi /etc/init.d/sonar
add the following 2 lines:
SONAR_HOME=/opt/sonar
PLATFORM=linux-x86-64
change:
WRAPPER_CMD="${SONAR_HOME}/bin/${PLATFORM}/wrapper"
WRAPPER_CONF="${SONAR_HOME}/conf/wrapper.conf"
PIDDIR="/var/run"
sudo update-rc.d -f sonar remove
sudo chmod 755 /etc/init.d/sonar
sudo update-rc.d sonar defaults
/etc/init.d/sonar start
REFERENCES:
Upgrades can be a little odd, if you see the maintenance page at http://localhost:9000/maintenance, go to http://localhost:9000/setup and do the required steps.
REFERENCES: