Files
shell-scripts/1-代理Xray/9-伪装网站/在线安装nginx.sh
2025-01-20 16:38:08 +08:00

38 lines
1013 B
Bash

#!/bin/bash
sudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
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
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
| sudo tee /etc/apt/preferences.d/99nginx
sudo apt update
sudo apt install -y nginx
mkdir -p /var/www/html/
mv dist.zip /var/www/html/
cd /var/www/html/
unzip dist.zip
chown -R www-data:www-data /var/www/html/
chmod -R 755 /var/www/html/
systemctl restart nginx
systemctl enable nginx
systemctl restart xray
systemctl enable xray
journalctl -u nginx -n 100 -f
journalctl -u xray -n 100 -f