Last active
August 29, 2015 14:12
-
-
Save santosoide/f97ab6bb3d2b9130892b to your computer and use it in GitHub Desktop.
Laravel Deploy on Digital Ocean using Guthub and dploy.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#init project | |
// membuat directory baru | |
``` | |
mkdir /var/www | |
mkdir /var/www/larapp | |
``` | |
// atau juga dengan cara seperti ini | |
```sudo mkdir -p /var/www/larapp``` | |
// generate authorized_key untuk koneksi dengan dploy.io | |
```nano ~/.ssh/authorized_keys``` | |
// pindah ke directory larapp | |
```cd /var/www/larapp``` | |
#configurasi php | |
// install yang diperlukan | |
```sudo apt-get update``` | |
// install php-cli | |
```sudo apt-get install php5-cli``` | |
// get composer | |
```curl -sS https://getcomposer.org/installer | php``` | |
// install Mcrypt | |
```sudo apt-get install php5-mcrypt``` | |
// config mcrypt | |
```sudo php5enmod mcrypt``` | |
// perintah untuk menjalankan composer install/update | |
```php composer.phar install``` | |
// install mysql | |
```sudo apt-get install mysql-server php5-mysql | |
sudo mysql_install_db | |
``` | |
// finish instalasi mysql_db | |
```sudo /usr/bin/mysql_secure_installation``` | |
#configurasi server | |
// konfigurasi php-fpm | |
```sudo nano /etc/php5/fpm/php.ini``` | |
// cari parameter dan value sbb, uncomment dan ubah valuenya dari 1 menjadi 0 | |
```cgi.fix_pathinfo=0``` | |
// restart php-fpm | |
```sudo service php5-fpm restart``` | |
#configurasi nginx server | |
// letak file config nginx | |
```sudo nano /etc/nginx/sites-available/default``` | |
// berikut configurasi server nginx dengan laravel | |
``` | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
root /var/www/larapp/public; | |
index index.php index.html index.htm; | |
server_name server_domain_or_IP; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location ~ \.php$ { | |
try_files $uri /index.php =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} | |
``` | |
// restart nginx | |
```sudo service nginx restart``` | |
// jangan lupa set permission | |
``` | |
chgrp -R www-data /var/www/larapp | |
chmod -R 775 /var/www/larapp/app/storage | |
``` | |
read the complete article on : | |
http://kodeinfo.com/post/deploying-laravel-on-digitalocean-using-github-and-dployio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment