diff options
Diffstat (limited to 'server/sonar-docs/src/pages/setup')
-rw-r--r-- | server/sonar-docs/src/pages/setup/get-started-2-minutes.md | 21 | ||||
-rw-r--r-- | server/sonar-docs/src/pages/setup/install-cluster.md | 9 | ||||
-rw-r--r-- | server/sonar-docs/src/pages/setup/install-plugin.md | 35 | ||||
-rw-r--r-- | server/sonar-docs/src/pages/setup/install-server.md | 9 | ||||
-rw-r--r-- | server/sonar-docs/src/pages/setup/operate-server.md | 127 | ||||
-rw-r--r-- | server/sonar-docs/src/pages/setup/overview.md | 19 | ||||
-rw-r--r-- | server/sonar-docs/src/pages/setup/troubleshooting.md | 43 | ||||
-rw-r--r-- | server/sonar-docs/src/pages/setup/upgrade-notes.md | 121 | ||||
-rw-r--r-- | server/sonar-docs/src/pages/setup/upgrading.md | 60 |
9 files changed, 444 insertions, 0 deletions
diff --git a/server/sonar-docs/src/pages/setup/get-started-2-minutes.md b/server/sonar-docs/src/pages/setup/get-started-2-minutes.md new file mode 100644 index 00000000000..48ab6729798 --- /dev/null +++ b/server/sonar-docs/src/pages/setup/get-started-2-minutes.md @@ -0,0 +1,21 @@ +--- +title: Get Started in Two Minutes Guide +url: /setup/get-started-2-minutes/ +--- + +<!-- sonarqube --> +1. Unzip - let's say in "C:\sonarqube" or "/etc/sonarqube", the SonarQube distribution once it's downloaded. ([Download Page](https://www.sonarqube.org/)) + +2. Start the SonarQube Server: + +``` +# On Windows, execute: +C:\sonarqube\bin\windows-x86-xx\StartSonar.bat + +# On other operating systems, execute: +/etc/sonarqube/bin/[OS]/sonar.sh console +``` + +3. Log in to [http://localhost:9000](http://localhost:9000) with System Administrator credentials (admin/admin) and follow the tutorial to analyze your first project. + +<!-- /sonarqube --> diff --git a/server/sonar-docs/src/pages/setup/install-cluster.md b/server/sonar-docs/src/pages/setup/install-cluster.md new file mode 100644 index 00000000000..469f277abb4 --- /dev/null +++ b/server/sonar-docs/src/pages/setup/install-cluster.md @@ -0,0 +1,9 @@ +--- +title: Running SonarQube as a Cluster +url: /setup/install-cluster/ +--- + +<!-- sonarqube --> + + +<!-- /sonarqube --> diff --git a/server/sonar-docs/src/pages/setup/install-plugin.md b/server/sonar-docs/src/pages/setup/install-plugin.md new file mode 100644 index 00000000000..96538e249fd --- /dev/null +++ b/server/sonar-docs/src/pages/setup/install-plugin.md @@ -0,0 +1,35 @@ +--- +title: Install a Plugin +url: /setup/install-plugin/ +--- + +<!-- sonarqube --> +There are two options to install a plugin into SonarQube: + +- Marketplace - Installs plugins automatically, from the SonarQube UI. +- Manual Installation - You'll use this method if your SonarQube instance doesn't have access to the Internet. + +## Marketplace + +If you have access to the Internet and you are connected with a SonarQube user having the Global Permission "Administer System", you can go to Administration > Marketplace. + +- Find the plugin you want to install +- Click on Install and wait for the download to be processed + +Once download is complete, a "Restart" button will be available to restart your instance. + +See Marketplace for more details on how to configure your SonarQube Server to connect to the Internet. + +## Manual Installation + +In the page dedicated to the plugin you want to install (ex: for Python: SonarPython, click on the "Download" link of the version compatible with your SonarQube version. + +Put the downloaded jar in `$SONARQUBE_HOME/extensions/plugins`, removing any previous versions of the same plugins. + +Once done, you will need to restart your SonarQube Server. + +### License + +If you installed a Commercial Edition, you will need to set the License Key in Administration > Configuration > License Manager before being able to use it. + +<!-- /sonarqube --> diff --git a/server/sonar-docs/src/pages/setup/install-server.md b/server/sonar-docs/src/pages/setup/install-server.md new file mode 100644 index 00000000000..8893ebef965 --- /dev/null +++ b/server/sonar-docs/src/pages/setup/install-server.md @@ -0,0 +1,9 @@ +--- +title: Installing the Server +url: /setup/install-server/ +--- + +<!-- sonarqube --> + + +<!-- /sonarqube --> diff --git a/server/sonar-docs/src/pages/setup/operate-server.md b/server/sonar-docs/src/pages/setup/operate-server.md new file mode 100644 index 00000000000..44830b6b280 --- /dev/null +++ b/server/sonar-docs/src/pages/setup/operate-server.md @@ -0,0 +1,127 @@ +--- +title: Operate the Server +url: /setup/operate-server/ +--- + +<!-- sonarqube --> + +## Running SonarQube as a Service on Windows + +### Install/uninstall NT service (may have to run these files via Run As Administrator): + +``` +%SONARQUBE_HOME%/bin/windows-x86-32/InstallNTService.bat +%SONARQUBE_HOME%/bin/windows-x86-32/UninstallNTService.bat +``` + +### Start/stop the service: + +``` +%SONARQUBE_HOME%/bin/windows-x86-32/StartNTService.bat +%SONARQUBE_HOME%/bin/windows-x86-32/StopNTService.bat +``` + +## Running SonarQube as a Service on Linux + +The following has been tested on Ubuntu 8.10 and CentOS 6.2. + +Create the file /etc/init.d/sonar with this content: + +``` +#!/bin/sh +# +# rc file for SonarQube +# +# chkconfig: 345 96 10 +# description: SonarQube system (www.sonarsource.org) +# +### BEGIN INIT INFO +# Provides: sonar +# Required-Start: $network +# Required-Stop: $network +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Short-Description: SonarQube system (www.sonarsource.org) +# Description: SonarQube system (www.sonarsource.org) +### END INIT INFO + +/usr/bin/sonar $* +``` + +Register SonarQube at boot time (Ubuntu, 32 bit): + +``` +sudo ln -s $SONAR_HOME/bin/linux-x86-32/sonar.sh /usr/bin/sonar +sudo chmod 755 /etc/init.d/sonar +sudo update-rc.d sonar defaults +``` + +Register SonarQube at boot time (RedHat, CentOS, 64 bit): + +``` +sudo ln -s $SONAR_HOME/bin/linux-x86-64/sonar.sh /usr/bin/sonar +sudo chmod 755 /etc/init.d/sonar +sudo chkconfig --add sonar +``` + +## Securing the Server Behind a Proxy + +This section helps you configure the SonarQube Server if you want to run it behind a proxy. This can be done for security concerns or to consolidate multiple disparate applications. + +### Server Configuration + +To run the SonarQube server over HTTPS, you must build a standard reverse proxy infrastructure. + +The reverse proxy must be configured to set the value "X_FORWARDED_PROTO: https" in each HTTP request header. Without this property, redirection initiated by the SonarQube server will fall back on HTTP. + +### Using an Apache Proxy + +We assume that you've already installed Apache 2 with module mod_proxy, that SonarQube is running and available on http://private_sonar_host:sonar_port/ and that you want to configure a Virtual Host for www.public_sonar.com. + +At this point, edit the HTTPd configuration file for the www.public_sonar.com virtual host. Include the following to expose SonarQube via mod_proxy at http://www.public_sonar.com/: + +``` +ProxyRequests Off +ProxyPreserveHost On +<VirtualHost *:80> + ServerName www.public_sonar.com + ServerAdmin admin@somecompany.com + ProxyPass / http://private_sonar_host:sonar_port/ + ProxyPassReverse / http://www.public_sonar.com/ + ErrorLog logs/somecompany/sonar/error.log + CustomLog logs/somecompany/sonar/access.log common +</VirtualHost> +``` + +Apache configuration is going to vary based on your own application's requirements and the way you intend to expose SonarQube to the outside world. If you need more details about Apache HTTPd and mod_proxy, please see [http://httpd.apache.org](http://httpd.apache.org). + +### Using Nginx + +We assume that you've already installed Nginx, that you are using a Virtual Host for www.somecompany.com and that SonarQube is running and available on http://sonarhost:sonarport/. + +At this point, edit the Nginx configuration file. Include the following to expose SonarQube at http://www.somecompany.com/: + +``` +# the server directive is nginx's virtual host directive +server { + # port to listen on. Can also be set to an IP:PORT + listen 80; + + # sets the domain[s] that this vhost server requests for + server_name www.somecompany.com; + + location / { + proxy_pass http://sonarhost:sonarport; + } +} +``` + +Nginx configuration will vary based on your own application's requirements and the way you intend to expose SonarQube to the outside world. If you need more details about Nginx, please see [https://www.nginx.com/resources/admin-guide/reverse-proxy/](https://www.nginx.com/resources/admin-guide/reverse-proxy/). + +Note that you may need to increase the max URL length since SonarQube requests can have URLs longer than 2048. + +### Using IIS + +Please see: [http://blog.jessehouwing.nl/2016/02/configure-ssl-for-sonarqube-on-windows.html](http://blog.jessehouwing.nl/2016/02/configure-ssl-for-sonarqube-on-windows.html) + +<!-- /sonarqube --> diff --git a/server/sonar-docs/src/pages/setup/overview.md b/server/sonar-docs/src/pages/setup/overview.md new file mode 100644 index 00000000000..ecb0a53b0be --- /dev/null +++ b/server/sonar-docs/src/pages/setup/overview.md @@ -0,0 +1,19 @@ +--- +title: Overview +url: /setup/overview/ +--- + +<!-- sonarqube --> +## Get Started in Two Minutes +To give the SonarQube Platform a quick try, follow the [Get Started in Two Minutes Guide](/setup/get-started-2-minutes/). + +## Install a Production Instance +To install a production instance, read the Requirements, and then follow the Installation Guide. + +## After the Installation +After your server is up and running, you'll need to install one or more [SonarQube Scanners](https://docs.sonarqube.org/display/SCAN) on the machines where analysis will be performed. + +## Upgrade your Production Instance +To upgrade your production instance, read the Upgrade Guide and the relevant, version-specific upgrade notes. + +<!-- /sonarqube --> diff --git a/server/sonar-docs/src/pages/setup/troubleshooting.md b/server/sonar-docs/src/pages/setup/troubleshooting.md new file mode 100644 index 00000000000..2c849fbb91b --- /dev/null +++ b/server/sonar-docs/src/pages/setup/troubleshooting.md @@ -0,0 +1,43 @@ +--- +title: Troubleshooting +url: /setup/troubleshooting/ +--- + +<!-- sonarqube --> + +## Checking the logs + +If you're having trouble starting your server for the first time (or any subsequent time!) the first thing to do is check your server logs. You'll find them in `$SONARQUBE_HOME/logs`: + +* sonar.log - Log for the main process. Holds general information about startup and shutdown. You'll get overall status here but not details. Look to the other logs for that. +* web.log - Information about initial connection to the database, database migration and reindexing, and the processing of HTTP requests. This includes database and search engine logs related to those requests. +* ce.log - Information about background task processing and the database and search engine logs related to those tasks. +* es.log - Ops information from the search engine, such as Elasticsearch startup, health status changes, cluster-, node- and index-level operations, etc. + +## Understanding the logs + +When there's an error, you'll very often find a stacktrace in the logs. If you're not familiar stacktraces, they can be intimidatingly tall walls of incomprehensible text. As a sample, here's a fairly short one: + +``` +java.lang.IllegalStateException: Unable to blame file **/**/foo.java + at org.sonarsource.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:128) + at org.sonarsource.scm.git.JGitBlameCommand.access$000(JGitBlameCommand.java:44) + at org.sonarsource.scm.git.JGitBlameCommand$1.call(JGitBlameCommand.java:112) + at org.sonarsource.scm.git.JGitBlameCommand$1.call(JGitBlameCommand.java:109) + at java.util.concurrent.FutureTask.run(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) + at java.lang.Thread.run(Unknown Source) +Caused by: java.lang.NullPointerException + at org.eclipse.jgit.treewalk.filter.PathFilter.create(PathFilter.java:77) + at org.eclipse.jgit.blame.BlameGenerator.<init>(BlameGenerator.java:161) + at org.eclipse.jgit.api.BlameCommand.call(BlameCommand.java:203) + at org.sonarsource.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:126) + ... 7 more +``` + +Unless you wrote the code that produced this error, you really only care about: +* the first line, which ought to have a human-readable message after the colon. In this case, it's Unable to blame file `**/**/foo.java` +* and any line that starts with `Caused by:`. There are often several `Caused by` lines, and indentation makes them easy to find as you scroll through the error. Be sure to read each of these lines. Very often one of them - the last one or next to last one - contains the real problem. + +<!-- /sonarqube --> diff --git a/server/sonar-docs/src/pages/setup/upgrade-notes.md b/server/sonar-docs/src/pages/setup/upgrade-notes.md new file mode 100644 index 00000000000..6bf5e88c047 --- /dev/null +++ b/server/sonar-docs/src/pages/setup/upgrade-notes.md @@ -0,0 +1,121 @@ +--- +title: Release Upgrade Notes +url: /setup/upgrade-notes/ +--- + +<!-- sonarqube --> + +## Release 7.3 Upgrade Notes + +### New "Administer Security Hotspots" Permission +During the upgrade, the new "Administer Security Hotspots" permission is granted to all users/groups who already have the "Administer Issues" permission. + +### Expanded Compute Engine Logs +Starting with this version, Compute Engine logs will be more verbose. These logs are rotated automatically, but on a daily basis, not based on file size. + +### PostgreSQL < 9.3 No Longer Supported +SonarQube 7.3+ only supports PostgreSQL 9.3 to 10. SonarQube will not start if you are using a lower version of PostgreSQL. + +### Some 3rd-party Plugins Incompatible +APIs deprecated before SonarQube 5.6 are dropped in this version, making some third-party plugins incompatible. It is always advised to check plugin compatibility in the Plugin Version Matrix with each new upgrade, and more so for this version. + + + + +## Release 7.2 Upgrade Notes + +### License Incompatibility +Users coming from 6.7.5 must not upgrade to this version. Your license will be incompatible. Instead, if you seek an upgrade to an intermediate version before the next L.T.S. version, you must start from 7.3 or higher. + +### Pull Request Analysis +Pull Requests are now a first class citizen feature in SonarQube for Developer, Enterprise and Data Center Edition users. + +If you are using GitHub, you need to be sure to NOT have the GitHub Plugin in your SONARQUBE_HOME/extensions/plugins directory. + +### New Edition Packaging +SonarSource Commercial Editions are now distributed individually, so you directly get the features and functionalities that match your needs. This means that upgrade/downgrade from one edition to another is no longer possible within the SonarQube Marketplace. In order to use a different edition you must download its dedicated package, and have a license ready for using that edition. + +### Deprecated Features +SonarQube 7.2 is the last version supporting PostgreSQL < 9.3. Starting from SonarQube 7.3 the minimal supported version of PostgreSQL will be 9.3: SONAR-10668 + +### Dropped Features +None + + + + +## Release 7.1 Upgrade Notes + +### License Incompatibility + +Users coming from 6.7.5 must not upgrade to this version. Your license will be incompatible. Instead, if you seek an upgrade to an intermediate version before the next L.T.S. version, you must start from 7.3 or higher. + +### Live Portfolios + +Portfolio measures are now updated without having to explicitly trigger recalculation. As a result, the "views" scanner task no longer has any effect, and will fail with a clear error message. + +### Deprecated Features + +Support for MySQL is deprecated for all editions below Data Center Edition (see below). + +### Dropped Features + +- Support for MySQL in Data Center Edition. +- The "accessors" metric, which was deprecated in SonarQube 5.0. + + + + +## Release 7.1 Upgrade Notes + +### License incompatibility + +Users coming from 6.7.5 must not upgrade to this version. Your license will be incompatible. Instead, if you seek an upgrade to an intermediate version before the next L.T.S. version, you must start from 7.3 or higher. + +### Measures: Live Update + +Project measures, including the Quality Gate status, are computed without having to trigger another code scan when issue changes may impact them. + +### Built-In Read-Only Quality Gate + +In order to make clear the default, minimum and recommended criteria Quality Gates, the "Sonar way" Quality Gate is now read-only, and the default if one is not already set. It may be updated automatically at each upgrade of SonarQube. + +### Deprecated Features + +None + +### Dropped Features + +It's no longer possible to unset the default Quality Gate. + + + + +## Release 6.7.5 Upgrade Notes + +### Commercial Edition Must Be Upgraded + +Because a new server identifier will be generated at upgrade to this version, startup will fail unless you upgrade your commercial edition to the latest compatible version. I.E. don't just copy over your edition plugins from one instance to the next, but make sure to download the latest edition bundle. + +### SonarLint Must Be Upgraded + +Analyzers provided as part of a commercial package will be disabled in old versions of SonarLint. SonarLint users must upgrade to the latest available version: + +- SonarLint for Eclipse: 3.3+. +- SonarLint for IntelliJ: 3.1+ + +### Multi-Version Upgrade + +Don't forget to read all the intermediate upgrade notes if you're upgrading more than a single version. + + + + +## Release 6.7 Upgrade Notes + +### Drop of Issues Report + +The deprecated Issues Report feature has been removed. + + +<!-- /sonarqube --> diff --git a/server/sonar-docs/src/pages/setup/upgrading.md b/server/sonar-docs/src/pages/setup/upgrading.md new file mode 100644 index 00000000000..fb8a816960d --- /dev/null +++ b/server/sonar-docs/src/pages/setup/upgrading.md @@ -0,0 +1,60 @@ +--- +title: Upgrading +url: /setup/upgrading/ +--- + +<!-- sonarqube --> +Upgrading across multiple versions is handled automatically. However, if in your migration path you have an LTS version, you must first migrate to this LTS and then migrate to your target version. + +Example 1 : 5.1 -> 7.0, migration path is 5.1 -> 5.6.7 LTS -> 6.7.x LTS -> 7.0 +Example 2 : 6.2 -> 6.7, migration path is 6.2 -> 6.7.x LTS (where x is the latest patch available for 6.7 - you don't need to install all the intermediary patches, just take the latest) + +## How to Upgrade? + +This is a generic upgrade guide, please read carefully the Upgrade Notes of your target version and of each intermediate version, if any (below). + +![](/images/info.svg) Planning to Upgrade to a Commercial Editions? +If you are targetting to move to 6.7 LTS and to install a commercial Edition, please read this [documentation](https://docs.sonarqube.org/display/SONARQUBE67/SonarSource+Editions). + +Before you start, backup your SonarQube Database. Upgrade problems are rare, but you'll want the backup if anything does happen. + +1. Download and unzip the SonarQube distribution of your edition in a fresh directory, let's say `$NEW_SONARQUBE_HOME` +2. Manually install the non-default plugins that are compatible with your version of SonarQube. Use the Compatibility Matrix to ensure that the versions you install are compatible with your server version. Note that the most recent versions of all SonarSource code analyzers available in your edition are installed by default. Simply copying plugins from the old server to the new is not recommended; incompatible or duplicate plugins could cause startup errors. +3. Update the contents of `sonar.properties` and `wrapper.conf` files (in `$NEW_SONARQUBE_HOME/conf`) with the settings of the related files in the `$OLD_SONARQUBE_HOME/conf` directory (web server URL, database, ldap settings, etc.). Do not copy-paste the old files. +If you are using the Oracle DB, copy its JDBC driver into `$NEW_SONARQUBE_HOME/extensions/jdbc-driver/oracle` +4. Stop your old SonarQube Server +5. Start your new SonarQube Server +6. Browse to `http://yourSonarQubeServerURL/setup` and follow the setup instructions +7. Analyze your projects (and compute your Views|Portofolios|Application if you own the Enterprise Edition product) to get fresh data + +## Anything Else? + +### Oracle Clean-up + +Starting with 6.6, there's an additional step you may want to perform if you're using Oracle. On Oracle the database columns to be dropped are now marked as UNUSED and are not physically dropped anymore. To reclaim disk space, Oracle administrators must drop these unused columns manually. The SQL request is `ALTER TABLE foo DROP UNUSED COLUMNS`. The relevant tables are listed in the system table `all_unused_col_tabs`. + +### Additional Database Maintenance + +Refreshing your database's statistics and rebuilding your database's indices are recommended once the technical upgrade is done (just before the very last step). + +For PostgreSQL, that means executing `VACUUM FULL`. According to the PostgreSQL documentation: + +``` +In normal PostgreSQL operation, tuples that are deleted or obsoleted by an update are not physically removed from their table; they remain present until a VACUUM is done. +``` + +### Scanner Update + +When upgrading SonarQube, you should also make sure you’re using the latest versions of the SonarQube scanners to take advantage of features and fixes on the scanner side. Please check the documentation pages of the Scanners you use for the most recent version compatible with SonarQube and your build tools. + +### SonarQube as a Linux or Windows Service + +If you use external configuration, such as a script or Windows Service to control your server, you'll need to update it to point to `$NEW_SONARQUBE_HOME`. + +In case you used the InstallNTService.bat to install SonarQube as a Windows Service, run the $OLD_SONARQUBE_HOME/bin/.../UninstallNTService.bat before running the InstallNTService.bat of the $NEW_SONARQUBE_HOME. + +## Release Upgrade Notes + +Usually SonarQube releases come with some specific recommendations for upgrading from the previous version. You should read the upgrade notes for each version between your current version and the target version. To upgrade from a version not listed in [Release Upgrade Notes](/setup/upgrade-notes/), see [Documentation for Previous Versions](https://docs.sonarqube.org/display/SONARNEXT/Documentation+for+previous+versions). + +<!-- /sonarqube --> |