+1 on Forge. Definitely worth the money. That said, I have made myself a "to do list" for setting up nginx, ubuntu 16, mysql etc... I've used it successfully about 5 times but I still make slight adjustments from time to time. Enjoy!
LEMP Laravel 5.3
Install Notes
Install Ubuntu 16 (with a usb key on whatever hardware, this varies wildly but ive gotten a NUC and a giant SuperMicro working on the same usb key so...)
Hostname = <computer name>
Username = <user name>
(this is run on your remote computer to access the server from...i use a macbook, so i just open the terminal. i installed ssh-copy-id through homebrew i think, but if you're on windows...ssh is a pain)
ssh-copy-id <user name>@<ip>
(still not sure which order these three should go in lol)
sudo apt-get dist-upgrade
sudo apt-get upgrade
sudo apt-get update
sudo reboot
sudo apt install openssh-server openssh-client
sudo pico /etc/ssh/sshd_config
(change) PasswordAuthentication no
(default) PubkeyAuthentication yes
(default) ChallengeResponseAuthentication no
(uncomment) AuthorizedKeysFile %h/.ssh/authorized_keys
sudo systemctl reload sshd
ssh-keygen -t rsa -b 4096
sudo apt-get install nginx
sudo systemctl enable nginx
sudo apt install mysql-server mysql-client
sudo mysql_secure_installation
mysql -u root -p
CREATE DATABASE <database name>;
GRANT ALL ON <database name>.* TO '<new user>' IDENTIFIED BY '<new password>';
exit
sudo apt-get install php git unzip zip curl php-curl php-mcrypt php-mbstring php-gettext php-mysql
sudo phpenmod mcrypt
sudo phpenmod mbstring
sudo apt install redis-server redis-tools
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo pico /etc/php/7.0/fpm/pool.d/www.conf
;listen = /run/php/php7.0-fpm.sock
listen = 127.0.0.1:9000
user = <user name>
group = <user name>
sudo pico /etc/nginx/sites-available/default
sudo systemctl restart nginx
INSTALL .ENV FILE INTO BASE PROJECT FOLDER
php artisan migrate
php artisan db:seed
php artisan storage:link
*********** NGINX DEFAULT SITES-AVAILABLE ***********
server {
listen 80;
server_name <IP>; # IP of location
root /home/<project-name>/public;
index index.php index.html index.htm;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/optimize-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}