# 14. Deploiement Symfony ## Creer le site dans ISPConfig 1. DNS A `` -> `` (ou zone DNS dediee) 2. Site web ISPConfig : `` (SSL, LE, PHP-FPM, HTTPS redirect) 3. Creer base de donnees dans ISPConfig ## Apache Directives pour Symfony Dans l'onglet Options du site : ```apache DocumentRoot /var/www//web/public /web/public> AllowOverride All Require all granted FallbackResource /index.php ``` ## Lien symbolique ```bash ln -s /var/www/clients/clientX/webY/web /var/www/ ``` ## Permissions ```bash # Identifier le proprietaire ls -la /var/www// | head -5 # Noter webX:clientY # Ajouter votre user au groupe client usermod -a -G clientY # Donner l'acces groupe chmod 750 /var/www/clients/clientX/webY/web # ACL pour acces complet apt install acl setfacl -R -m u::rwx /var/www/clients/clientX/webY/web setfacl -R -d -m u::rwx /var/www/clients/clientX/webY/web ``` > **Important :** Apres connexion SSH, executer `newgrp clientY` pour activer le groupe. ## Cloner le projet ```bash git clone git@github.com:.git /tmp/ cp -r /tmp//. /var/www/clients/clientX/webY/web/ chown -R webX:clientY /var/www/clients/clientX/webY/web/ rm -rf /tmp/ ``` ## Installer les dependances ```bash cd /var/www/ composer install ``` ## Configuration .env ```bash # Base de donnees DATABASE_URL="mysql://:@localhost:3306/" # Mail (Postfix local) MAILER_DSN=smtp://127.0.0.1:25?auto_tls=false ``` ## Migrations ```bash php bin/console doctrine:migrations:migrate --no-interaction ``` ## Cache ```bash php bin/console cache:clear ```