This document contains information how you can install this application to local or dedicated server - without using docker.
Use your favorite IDE and get checkout from GitHub or just use following command
git clone https://github.com/tarlepp/symfony-flex-backend.git
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.
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
Next phase is to install all needed dependencies. This you can do with following command, in your project folder:
composer install
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
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.
You need to run following command to make all necessary checks.
./vendor/bin/requirements-checker
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.
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
To initialize database you need to run following commands:
./bin/console doctrine:database:create
./bin/console doctrine:migrations:migrate