Nginx
此内容尚不支持你的语言。
install nginx
Section titled “install nginx”https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-22-04
# debian# 首先,更新本地软件包索引,以确保您能够访问最新的软件包列表sudo apt updatesudo apt upgrade -y# 安装 nginxsudo apt install nginx -y# 检查 nginx 版本nginx -v# 如果没有, 可能在 /usr/sbin 通常只对 root/sudo 可见sudo nginx -v# orsudo /usr/sbin/nginx -v# 检查安装状态dpkg -l | grep nginx检查 web 服务器
Section titled “检查 web 服务器”systemctl status nginx# 通过访问服务器的 IP 地址来查看 Nginx 的默认登录页面## 查看公网ipcurl -4 icanhazip.com## 访问 http://<公网ip>配置 Nginx
Section titled “配置 Nginx”ls /etc/nginx/sites-enabled/# 编辑配置文件sudo nano /etc/nginx/sites-enabled/default# 测试配置文件是否正确sudo nginx -t# 重载 Nginxsudo systemctl reload nginx# 开机自启(如果还没)sudo systemctl enable nginx