3e6c9b46e8
Add gm2 dependency and rename env_install.log to env_install.sh for easy one-click installation on the host machine
54 lines
1.9 KiB
Bash
54 lines
1.9 KiB
Bash
sudo apt install -y certbot python3-certbot-nginx ssl-cert
|
|
sudo apt-get install -y vim coturn
|
|
|
|
sudo apt-get install -y redis-server
|
|
|
|
sudo apt-get install -y curl
|
|
|
|
sudo apt install -y ca-certificates gnupg && sudo mkdir -p /etc/apt/keyrings
|
|
|
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
|
|
|
export NODE_MAJOR=20
|
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
|
|
|
|
sudo apt-get update
|
|
sudo apt install -y nodejs
|
|
sudo npm install -g pnpm pm2
|
|
|
|
# Install Nginx (with HTTP/3 support, Ubuntu example)
|
|
# Reference: https://nginx.org/en/linux_packages.html#Ubuntu
|
|
|
|
# 1. **Install prerequisites:**
|
|
|
|
sudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
|
|
|
|
# 2. **Import Nginx signing key:**
|
|
|
|
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
|
|
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
|
|
|
|
# 3. **Verify the key:**
|
|
|
|
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
|
|
# Expected fingerprint: 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
|
|
|
|
# 4. **Set up the apt repository for stable Nginx packages:**
|
|
|
|
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
|
|
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
|
|
| sudo tee /etc/apt/sources.list.d/nginx.list
|
|
|
|
# 5. **Set up repository pinning:**
|
|
|
|
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
|
|
| sudo tee /etc/apt/preferences.d/99nginx
|
|
|
|
# 6. **Install Nginx:**
|
|
|
|
sudo apt update
|
|
sudo apt install -y nginx
|
|
|
|
sudo apt-get clean autoclean
|
|
sudo apt-get autoremove --yes
|
|
sudo rm -rf /var/lib/{apt,cache,log}/ && sudo rm -rf /tmp/* |