Initial Installation - SonarSoftware/customer_portal GitHub Wiki

Getting Started

First, you'll need a Linux server to run the customer portal on. We currently support Ubuntu 16.04 x64. You can download Ubuntu here or host it online (we recommend Digital Ocean!)

If you are installing Ubuntu on a new server, do not select the options to preinstall Apache, a database server, or any other component other than OpenSSH. The predefined configurations for many of these applications conflict with the requirements of the Sonar portal, and the installation script will set these up for you automatically.

Once the server is up and running, either continue the follow the directions or contact us at [email protected] and we'd be happy to configure it for you.

A note on hosting

If you're hosting this online, it's likely that your server does not have any swap memory setup. If you've selected a server with a low amount of RAM (1-2G), or even if you've picked more, it can be worthwhile setting up a swap partition to make sure you don't run into any out of memory errors. Your swap file size should be, at minimum, be equal to the amount of physical RAM on the server. It should be, at maximum, equal to 2x the amount of physical RAM on the server. A good rule of thumb is to just start by making it equal to the amount of available RAM, increasing to double the RAM if you run into out of memory errors. If you run into out of memory errors after moving to 2x the amount of RAM, you should increase the amount of RAM on your server rather than increasing swap.

To setup swap, run the following commands as root (or by putting 'sudo' in front of each command):

  • /usr/bin/fallocate -l 4G /swapfile where 4G is equal to the size of the swap file in gigabytes.
  • /bin/chmod 600 /swapfile
  • /sbin/mkswap /swapfile
  • /sbin/swapon /swapfile
  • echo "/swapfile none swap sw 0 0" >> /etc/fstab
  • /sbin/sysctl vm.swappiness=10
  • echo "vm.swappiness=10" >> /etc/sysctl.conf
  • /sbin/sysctl vm.vfs_cache_pressure=50
  • echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.conf

Initial Installation

Once your server is up and running, perform the following steps to prepare it for install. First, SSH into your new server using an SSH client like PuTTy and then issue the following command as root:

apt-get -y update && apt-get -y upgrade && apt-get -y install php php-zip git unzip

We're now ready to begin the install. First, let's pick a place to download the files. Your home directory is fine (you can type cd ~/ to change to your home directory.) Once you're there, type wget https://github.com/SonarSoftware/customer_portal/archive/master.zip and then unzip master.zip.

Now it's time to begin the install. Run chmod +x customer_portal-master/install.sh and then customer_portal-master/install.sh and the portal installer will run through the installation process.

Once the installation is completed, move on to configuring your portal.