Getting started - Sailer-io/Backend GitHub Wiki

Sailer Backend

Installation

The installation guide is for Debian 9.

First of all, add php7.1

sudo apt-get install apt-transport-https lsb-release ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
sudo apt-get update

Then, install git, apache and php

sudo apt-get install -y apache php7.2-sqlite php7.2 php7.2-mysql php7.2-mbstring php7.2-json php7.2-ctype php7.2-xml php7.2-tokenizer php7.2-zip php7.2-json mysql-server

Clone the project

sudo git clone [email protected]:Lelenaic/teamdsi-fludia.git /var/www/sailer

Configure apache

In /etc/apache2/sites-available/sailer.conf let's add : (Obviously, replace ServerName by another domain)

<VirtualHost *:80>
        ServerName beta.sailer.io

        DocumentRoot /var/www/sailer/public

        ErrorLog ${APACHE_LOG_DIR}/sailer.error.log
        CustomLog ${APACHE_LOG_DIR}/sailer.access.log combined

        <Directory /var/www/sailer/>
                AllowOverride All
        </Directory>
</VirtualHost>

Enable the rewrite mode, the website and restart apache :

sudo a2enmod rewrite && a2ensite sailer && sudo service apache2 restart

Prepare Laravel

cd /var/www/sailer
wget -q http://getcomposer.org/composer.phar
php composer.phar install --no-dev --optimize-autoloader
cp .env.example .env
php artisan key:generate

Edit the .env file

Replace APP_ENV=local by APP_ENV=staging or APP_ENV=production if you're in production.

Replace APP_DEBUG=true by APP_DEBUG=false if you want to hide errors.

Replace database part by yours, example:

DB_DATABASE=sailer
DB_USERNAME=sailer
DB_PASSWORD=sailer

You can use SQLITE if you don't want to use MySQL.

Then, create the collections:

php artisan migrate:fresh

If you want to set the demo data:

php artisan db:seed

Finally, don't forget to correct permissions:

sudo chown -R www-data:www-data /var/www/sailer
⚠️ **GitHub.com Fallback** ⚠️