Skip to content

Instantly share code, notes, and snippets.

@raco
Created June 7, 2017 00:02
Show Gist options
  • Save raco/3c5dab6e707fbdec25a575b31f91e243 to your computer and use it in GitHub Desktop.
Save raco/3c5dab6e707fbdec25a575b31f91e243 to your computer and use it in GitHub Desktop.
Steps to deploy a laravel project

PASOS

  1. Crear el droplet

  2. Acceder por ssh

  3. Checkear las versiones 3.1 ps -ax | grep nginx

  4. Configurar nginx mkdir /var/www/laravel index.php location / { try_files $uri $uri/ /index.php?$query_string; } descomentamos el location php

  5. sudo apt install php7.0-mysql php7.0-fpm php7.0-mbstring php7.0-xml php7.0-curl php7.0-zip 5.1 Instalar composer

  6. Instalar mi repo cd /var mkdir repo && cd repo mkdir site.git && cd site.git git init --bare cd /var/repo/site.git/hooks sudo nano post-receive

#!/bin/sh git --work-tree=/var/www/laravel --git-dir=/var/repo/site.git checkout -f

sudo chmod +x post-receive

##LOCAL git remote add production ssh://root@YOUR-IP/var/repo/site.git git push production master

volviendo al server

cd /var/www/laravel && composer install --no-dev sudo nano /etc/php/7.0/fpm/php.ini ctrl+w cgi.fix_pathinfo descomentamos y le damos valor 0 sudo systemctl restart php7.0-fpm

Permisos a laravel

sudo chown -R :www-data /var/www/laravel && sudo chmod -R 775 /var/www/laravel/storage && sudo chmod -R 775 /var/www/laravel/bootstrap/cache

cd /var/www/laravel && cp .env.example .env nano .env php artisan key:generate php artisan config:cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment