為什麼Nginx伺服器無法啟動?

為什麼Nginx伺服器無法啟動?

我是 nginx 伺服器的新手。我使用以下命令在 Ubuntu 作業系統上安裝了 nginx

sudo apt-get install nginx

然後嘗試使用以下命令啟動 nginx Web 伺服器

 sudo service nginx start

然後嘗試透過輸入 url http://http://192.168.1.120/(我的 IP 位址)在我的 Web 瀏覽器上開啟 nginx Web 伺服器。

但這顯示的是空白頁。我不知道我的程式有什麼錯誤,有人可以幫我解決這個問題嗎?

nginx  -t 

顯示一些錯誤如下:

[alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2016/09/09 12:01:37 [warn] 9035#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2016/09/09 12:01:37 [emerg] 9035#0: open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed

相關內容