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.git2. 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 in the
Symfony file permissions documentation.
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 var4. Dependencies installation ᐞ
Next phase is to install all needed dependencies. This you can do with following command, in your project folder:
composer install5. 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-keys6. 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-checkerWeb-server environment ᐞ
Open terminal and go to project root directory and run following command to start standalone server.
./bin/console server:startOpen 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 rewrite7. Database ᐞ
To initialize database you need to run following commands:
./bin/console doctrine:database:create
./bin/console doctrine:migrations:migrate