在 Debian 上启动 nginx 通常有以下几种方式,取决于你是通过 apt 安装还是源码编译安装。
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
如果你是手动 make && make install 安装的:
sudo /usr/local/nginx/sbin/nginx
sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/nginx -s reload
curl http://localhost
或浏览器访问:
http://服务器IP
看到 Welcome to nginx! 即成功。
sudo lsof -i:80
sudo nginx -t
如果你是 Docker / Debian 最小化系统 / 特定版本,可以告诉我,我可以给你更精确的命令。