Ubuntu22.04下安装nginx只需通过命令:
sudo apt install nginx
安装好后,可以通过如下命令进行检查:
nginx -v
启动nginx服务:
sudo systemctl start nginx
停止nginx服务:
sudo systemctl stop nginx
重启nginx服务:
sudo systemctl restart nginx
重新加载nginx配置文件:
sudo systemctl reload nginx
查看nginx状态:
sudo systemctl status nginx
启动nginx服务后,可以打开浏览器访问127.0.0.1,会有一个默认的web页面: