Skip to content

Instantly share code, notes, and snippets.

@masiur
Last active February 15, 2018 16:16
Show Gist options
  • Select an option

  • Save masiur/c7c178ee2fac892cea950c9b361ce26e to your computer and use it in GitHub Desktop.

Select an option

Save masiur/c7c178ee2fac892cea950c9b361ce26e to your computer and use it in GitHub Desktop.
Laravel App Host On LEMP Server
sudo mkdir -p /var/www/html/domain_name
sudo mkdir -p /var/www/html/beta.swayiltd.com
sudo chown -R $USER:$USER /var/www/html/beta.swayiltd.com
cd /var/www/html/beta.swayiltd.com
git clone https://github.com/masiur/sway.git && cd sway && composer update
sudo cp .env.example .env && nano .env
php artisan migrate --seed
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
sudo nano /etc/nginx/sites-available/beta.swayiltd.com

server {
    listen 80;
    listen [::]:80;

    root www/html/beta.swayiltd.com/sway/public;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name beta.swayiltd.com www.beta.swayiltd.com;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    
    location ~ \.php$ {
          include snippets/fastcgi-php.conf;
          fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }

    location ~ /\.ht {
            deny all;
    }


}

sudo ln -s /etc/nginx/sites-available/beta.swayiltd.com /etc/nginx/sites-enabled/

sudo systemctl reload nginx
sudo systemctl restart nginx
cd /var/www/html/beta.swayiltd.com/sway
sudo chmod -R 777 storage && sudo chmod -R 777 public && sudo chmod -R 777 bootstrap/cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment