Skip to content

Latest commit

 

History

History
136 lines (94 loc) · 4.26 KB

INSTALLATION_WITHOUT_DOCKER.md

File metadata and controls

136 lines (94 loc) · 4.26 KB

What is this?

This document contains information how you can install this application to local or dedicated server - without using docker.

Table of Contents

Requirements

Installation

1. Clone repository

Use your favorite IDE and get checkout from GitHub or just use following command

git clone https://github.com/tarlepp/symfony-flex-backend.git

2. Configuration

By default application will use .env file for configuration. You can add your own local file as in .env.local and override necessary values there.

Secrets and related settings are by default in ./secrets directory. By default application will use ./secrets/application.json configuration file.

You can override this by adding ./secrets/application._identifier_.json and after that creating a .env.local file and use that file in there.

Note that this same works also if you're using Docker environment for dev.

3. File permissions

Next thing is to make sure that application var directory has correct permissions. Instructions for that you can find here.

I really recommend that you use ACL option in your development environment.

You can make necessary permission changes with following commands:

mkdir var
HTTPDUSER=`ps axo user,comm | \
    grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | \
    grep -v root | head -1 | cut -d\  -f1`
setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var
setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var

4. Dependencies installation

Next phase is to install all needed dependencies. This you can do with following command, in your project folder:

composer install

5. Create JWT auth keys

Application uses JWT to authenticate users, so we need to create public and private keys to sign those. You can create new keys with following command.

make generate-jwt-keys

6. Environment checks

To check that your environment is ready for this application. You need to make two checks; one for CLI environment and another for your web-server environment.

CLI environment

You need to run following command to make all necessary checks.

./vendor/bin/requirements-checker

Web-server environment

Open terminal and go to project root directory and run following command to start standalone server.

./bin/console server:start

Open your favorite browser with http://127.0.0.1:8000/check.php url and check it for any errors.

Apache

To get JWT authorization headers to work correctly you need to make sure that your Apache config has mod_rewrite enabled. This you can do with following command:

sudo a2enmod rewrite

7. Database

To initialize database you need to run following commands:

./bin/console doctrine:database:create
./bin/console doctrine:migrations:migrate

Back to resources index - Back to main README.md