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
server | |
{ | |
# Listen | |
listen 80; | |
listen [::]:80; | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
# Directory & Server Naming | |
server_name exapmle.com www.exapmle.com; |
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
server | |
{ | |
listen 12008; | |
listen [::]:12008; | |
server_name exapmle.com; | |
# HTTP to HTTPS redirection | |
if ($scheme != "https") | |
{ | |
return 301 https://$host$request_uri; |
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
server | |
{ | |
# Listen | |
listen 80; | |
listen [::]:80; | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
# Directory & Server Naming | |
server_name subdomain.example.com; |
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
upstream fastcgi_backend | |
{ | |
server unix:/run/php/php7.2-fpm.sock; | |
} | |
server | |
{ | |
listen 80; | |
listen [::]:80; | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; |
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
sudo apt-get update && sudo apt-get upgrade -y | |
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh && chmod +x shadowsocksR.sh | |
./shadowsocksR.sh 2>&1 | tee shadowsocksR.log | |
nano /etc/shadowsocks.json | |
{ | |
"server":"0.0.0.0", | |
"server_ipv6":"[::]", | |
"port_password": { | |
"1001": "user1", |
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
server | |
{ | |
# Listen | |
listen 80; | |
listen [::]:80; | |
#listen 443 ssl http2; | |
#listen [::]:443 ssl http2; | |
# Directory & Server Naming | |
root /var/www/yourdomain.com; |
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
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list | |
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 | |
sudo add-apt-repository "deb [arch=amd64,arm64,ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu $(lsb_release -cs) main" | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo add-apt-repository ppa:certbot/certbot -y | |
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y | |
sudo apt-get install openjdk-11-jre openjdk-11-jdk elasticsearch | |
sudo apt install wget curl zip unzip nginx-full mariadb-server python-certbot-nginx php7.4-fpm php7.4-common php7.4-mysql php7.4-gmp php7.4-curl php7.4-intl php7.4-mbstring php7.4-xmlrpc php7.4-gd php7.4-xml php7.4-cli php7.4-zip php7.4-soap php7.4-bcmath -y |
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
## MariaDB Source | |
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 | |
sudo add-apt-repository "deb [arch=amd64,arm64,ppc64el] http://mariadb.mirror.liquidtelecom.com/repo/10.4/ubuntu $(lsb_release -cs) main" | |
## PHP, Nginx and Lets Encrypt Source | |
nginx=stable | |
add-apt-repository ppa:nginx/$nginx | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo add-apt-repository ppa:certbot/certbot -y |
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
# blog post: https://echorand.me/nginx-and-geoip2.html | |
worker_processes auto; | |
daemon off; | |
error_log /dev/stdout warn; | |
include /etc/nginx/modules/*.conf; | |
load_module modules/ngx_http_geoip2_module.so; | |
events { | |
} |
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
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y | |
## For Regular Linux Server/PC | |
sudo apt install software-properties-common && sudo apt install linux-headers-$(uname -r) | |
## Raspberry Pi | |
sudo apt install raspberrypi-kernel-headers libelf-dev libmnl-dev build-essential git -y | |
## Install WireGuard and WireGuard Tools | |
sudo apt install wireguard wireguard-tools resolvconf -y | |
wg genkey | sudo tee /etc/wireguard/privatekey | wg pubkey | sudo tee /etc/wireguard/publickey |