1,安裝nginx
sudo apt-get install nginx
啟動nginx
service nginx start 啟動
service nginx stop 停止
service nginx reload 重啟
service nginx restart 重新開始
service nginx status 狀態
也可以用另外的方法啟動
systemctl start nginx
systemctl start nginx.service
systemctl stop nginx
systemctl reload nginx
systemctl restart nginx
systemctl status nginx
PS:自己測試報錯,希望有人能解決,報錯如下
System has not been booted with systemd as init system (PID 1). Can't operate.
2,啟動nginx后
看下自己的端口,ifconfig拿到ip測試下
在htm5頁面上輸入自己的ip,端口默認是80
1,nginx默認開始頁面只想 /var/www/html文件下的頁面