Deploy Laravel di Ubuntu Server 16.04

Muhammad Arji' S
Jul 25, 2017 · 2 min read

Untuk cara deploy web yang dibuat dengan framework laravel memang sedikit berbeda dengan yang dibuat dengan php extreme (native).

1. Siapkan LAMP server. cekidot->

2. Siapkan vhost. cekidot->

3. Install git dan kebutuhan laravel

4. Setting php.ini

sudo nano /etc/php/7.0/fpm/php.ini

cari ;cgi.fix_pathinfo=1

Hapus semicolon dan ganti jadi cgi.fix_pathinfo=0

source: https://devmarketer.io/learn/deploy-laravel-5-app-lemp-stack-ubuntu-nginx/

Kemudian restart php

sudo systemctl restart php7.0-fpm

5. clone project laravel dari repo git

git clone https://github.com/wkwksama/laravel-ku.git

Jangan lupa setting vhost arahkan ke /directory/project/laravel-ku/public

6. Jalankan composer

cd /directory/project/laravel-ku
composer install --no-dev

perintah --no-dev biar yang diinstall dependancy selain keperluan development.

7. Setting Laravel Permission

sudo chown -R :www-data /directory/project/laravel-ku
sudo chmod -R 775 /directory/project/laravel-ku/storage

Pastikan mendapatkan pesan error seperti itu hehehe

next,

sudo chmod -R 775 /directory/project/laravel-ku/bootstrap/cache

8. Buat Database

Bisa dengan menggunakan phpmyadmin

9. Setting Laravel .env

cp .env.example
nano .env

Sesuaikan settingan env. beberapa yang perlu diperhatikan

APP_ENV=production
APP_DEBUG=false

jalankan key generate

php artisan key:generate

10. Config Timezone

ada di file config/app.php

11. Buat cache file config

php artisan config:cache

12. Migrate Database

php artisan migrate

13. Mantab

wkwksama

a day bat

Muhammad Arji' S

Written by

the day bat

wkwksama

wkwksama

a day bat

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade