Connecting from Windows: http://www.techrepublic.com/blog/the-enterprise-cloud/connect-to-amazon-ec2-with-a-private-key-using-putty-and-pageant/
Connecting from Linux: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
To install MySQL, run the following command from a terminal prompt:
sudo apt-get install mysql-server
During the installation process you will be prompted to enter a password for the MySQL root user.
username / password : root / root
Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running:
sudo netstat -tap | grep mysql
When you run this command, you should see the following line or something similar:
tcp 0 0 localhost:mysql *:* LISTEN 2759/mysqld
If the server is not running correctly, you can type the following command to start it:
sudo service mysql restart
If you would like to change the MySQL root password, in a terminal enter:
sudo dpkg-reconfigure mysql-server-5.5
The MySQL daemon will be stopped, and you will be prompted to enter a new password.
-
Create an empty schema and a sonarqube user. Grant this sonarqube user permissions to create, update and delete objects for this schema. The charset of the database has to be set to "UTF-8" and the language (database and user) to "English".
-
create and edit a script file create_database.sql
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE USER ‘sonar’ IDENTIFIED BY ‘sonar'; GRANT ALL ON sonar.* TO ‘sonar’@’%’ IDENTIFIED BY ‘sonar'; GRANT ALL ON sonar.* TO ‘sonar’@’localhost’ IDENTIFIED BY ‘sonar'; FLUSH PRIVILEGES;
-
To run the script:
sudo mysql -u root -p < create_database.sql
-
To verify the user has been created:
SELECT User FROM mysql.user;
you should see user with name 'sonar' -
To verify the database has been created:
show databases;
you should see database with name 'sonar'
-
-
Set buffer pool size to 50-80% of your computer's memory. Add the following to my.cnf and then restart mysql.
innodb_buffer_pool_size = 4096M
innodb_buffer_pool_instances = 4
-
give at least 15Mb to the query_cache_size parameter
mysql> SET GLOBAL query_cache_size =67108864;
mysql> SHOW VARIABLES LIKE 'query_cache_size';
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
- You will be prompted to accept the Oracle License Agreement.
- Automatic set up of Java 8 environment variables:
sudo apt-get install oracle-java8-set-default
- Check Java installation:
java -version
- Add the relevant source entry in your /etc/apt/sources.list
sudo vim /etc/apt/sources.list
then press o then pastedeb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/
into the new line. press ESC then write:wq!
then press ENTER
sudo apt-get update
sudo apt-get install sonar
- You may get the following warning: 'The following packages cannot be authenticated!'. Enter y to continue with the installation.
- ensure user is created "Adding new user 'sonar' (UID 107) with group 'nogroup'"
- set sonar user password.
sudo passwd sonar
-
cd /opt/sonar/conf
-
sudo vi sonar.properties
-
Comment out the embedded database H2 lines if needed.
-
Uncomment the lines for the relevant database. Example below. Change server hostname or port if required.
#----- MySQL 5.x sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
-
Add/edit the following properties:
sonar.jdbc.username=sonar sonar.jdbc.password=sonar"
-
sudo vi /opt/sonar/conf/sonar.properties
sonar.web.context=/sonar sonar.web.port=80
- For starting the server
sudo /opt/sonar/bin/linux-x86-64/sonar.sh start
- For stopping the server
sudo /opt/sonar/bin/linux-x86-64/sonar.sh stop
tail -f /opt/sonar/logs/sonar.log
ps -ef | grep sonar
-
wget http://stingray.cyber.net.pk/pub/apache/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz
-
tar -zxf apache-maven-3.2.3-bin.tar.gz
-
sudo mv apache-maven-3.2.3 /usr/local/
-
Create a symbolic link to /usr/bin using the following command
sudo ln -s /usr/local/apache-maven-3.2.3/bin/mvn /usr/bin/mvn
-
Set up environment variables
-
Create a script:
sudo vim /etc/profile.d/mvn.sh
-
Add the following commands to the script:
export M2_HOME=/usr/local/apache-maven-3.2.3 export M2=$M2_HOME/bin export PATH=$M2:$PATH
-
sudo chmod 755 mvn.sh
-
-
Edit $M2_HOME/conf/settings.xml
<settings> <profiles> <profile> <id>sonar</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <!-- Example for MySQL--> <sonar.jdbc.url> jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8 </sonar.jdbc.url> <sonar.jdbc.username>sonar</sonar.jdbc.username> <sonar.jdbc.password>sonar</sonar.jdbc.password> <!-- Optional URL to server. Default value is http://localhost:9000 --> <sonar.host.url> http://myserver </sonar.host.url> </properties> </profile> </profiles> </settings>
great thanks!