ubuntu 安裝nginx


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文件下的頁面

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM