- Install LEMP stack
- Overwrite
/etc/nginx/nginx.conf
# /etc/nginx/nginx.conf
user www-data;
What is UFW? | |
UFW, or uncomplicated firewall, is a frontend for managing firewall rules in Arch Linux, Debian or Ubuntu. UFW is used through the command line (although it has GUIs available), and aims to make firewall configuration easy (or, uncomplicated). | |
sudo apt-get update && sudo apt-get upgrade | |
#Install UFW | |
sudo apt-get install ufw | |
#Use UFW to Manage Firewall Rules. Set Default Rules | |
sudo ufw default allow outgoing |
#!/bin/bash | |
################################### | |
# Usage: sudo ./installer.sh [os] # | |
################################### | |
OS=$1; | |
UBUNTU="ubuntu"; | |
############# |
#!/bin/sh | |
# UFW blocks for China, Korea, Malaysia, Phillipines, Singapore, Thailand and Vietnam netblocks | |
# Based on http://www.wizcrafts.net/chinese-iptables-blocklist.html | |
# Cambodia (KH) | |
ufw deny from 114.134.184.0/21 to any port 22 | |
# Chinese (CN) IP addresses follow: | |
ufw deny from 1.192.0.0/13 to any port 22 | |
ufw deny from 1.202.0.0/15 to any port 22 |
#!/bin/sh | |
# UFW blocks for Asian countries except Japan | |
# Based on http://www.wizcrafts.net/chinese-iptables-blocklist.html | |
# https://www.ip2location.com/free/visitor-blocker | |
# Cambodia (KH) | |
ufw deny from 114.134.184.0/21 | |
# Chinese (CN) IP addresses follow: | |
ufw deny from 1.68.0.0/14 | |
ufw deny from 1.80.0.0/13 |
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
#!/bin/sh | |
# ufw script | |
# | |
ufw disable | |
ufw --force reset | |
NET_PRIVATE_ADDR=(10.0.0.0/8 172.16.0.0/12 192.168.0.0/16) | |
for i in ${NET_PRIVATE_ADDR[@]}; do ufw allow from $i to any app 'SSH'; done | |
for i in ${NET_PRIVATE_ADDR[@]}; do ufw allow from $i to any app 'WWW Full'; done |
- https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-18-04 | |
How to Install MongoDB on Ubuntu 18.04 | |
Step 1 — Installing MongoDB | |
sudo apt update | |
sudo apt install -y mongodb | |
Step 2 — Checking the Service and Database |