Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
# Ubuntu 18.04 LTS Server Setup for Laravel | |
# Login as root user | |
sudo su - | |
# Update list of available packages | |
apt update |
server { | |
listen 80; | |
server_name app.rehanmanzoor.me; | |
charset utf-8; | |
client_max_body_size 1M; | |
location / { | |
proxy_pass http://127.0.0.1:8001; | |
proxy_http_version 1.1; |
Laravel 8.x, Horizon 5.x, Redis 6.x
Parepare application
http://yourapp.com/horizon
inactive
on dashbaordInstall redis-server
/**! | |
* Google Analytics Event Tracking | |
* Note: Assuming that tracking code already exists on the page | |
* Require jQuery 1.x or 2.x | |
* Supports: Classic and Universal Google Analytics | |
* @version 2.1.0 | |
* @license MIT | |
* @author ankur | |
*/ |
######################################################################## | |
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019 | |
# ---------------------------------------------------------------------- | |
# @Author: Andreas Hecht | |
# @Author URI: https://andreas-hecht.com | |
# License: GNU General Public License v2 or later | |
# License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
######################################################################## | |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
/* | |
******************************************************************************** | |
Golang - Asterisk and Ampersand Cheatsheet | |
******************************************************************************** | |
Also available at: https://play.golang.org/p/lNpnS9j1ma | |
Allowed: | |
-------- | |
p := Person{"Steve", 28} stores the value |
(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy
And Update the new password
This is a basic collection of things I do when setting up a new headless ubuntu machine as a webserver. Following the steps below should give you a reasonable secure server with HTTP/2 support (including ALPN in chrome) and the fast NGINX server. I am happy to add things so leave a comment.
After creating the server (droplet on DigitalOcean) log in with