一、安装Nginx
sudo apt-get install nginx
二、启动Nginx服务
sudo systemctl start nginx
-
开机自动启动nginx 服务
-
sudo systemctl enable nginx
-
关闭开机自动启动nginx 服务
-
sudo systemctl disable nginx
-
打开浏览器, 在地址栏输入127.0.0.1 or localhost, 出现Nginx 经典网页即表示成功。 . 也可以用Nginx 命令去测试
-
sudo nginx -t
-
查看端口
-
sudo lsof -i:80