国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > Nginx > 正文

配置完Nginx后無法訪問新的Server虛擬機?

2024-08-30 12:23:33
字體:
來源:轉載
供稿:網(wǎng)友
   配置完 Nginx 兩個虛擬機后,客戶端能夠訪問原始的Server ,新增加的 Server 虛擬機 不能夠訪問,出現(xiàn)403的報錯,解決方法如下:
1. 查看報錯日志
[root@linuxidc nginx]# cat logs/error.log 
2017/06/15 04:00:57 [error] 6702#0: *14 "/root/html/index.html" is forbidden (13: Permission denied), client: 10.219.24.1, server: www.linuxidc.com, request: "GET / HTTP/1.1", host: "www.linuxidc.com"
[root@linuxidc logs]# date
Thu Jun 15 04:01:27 CST 2017
2. 檢查權限
[root@linuxidc ~]# ll
drwxr-xr-x. 2 root root 4096 Jun 15 03:59 html
[root@linuxidc html]# ll
total 8
-rw-r--r--. 1 root root 537 Jun 15 03:59 50x.html
-rw-r--r--. 1 root root 616 Jun 15 03:51 index.html
說明:發(fā)現(xiàn)目錄權限沒有問題。
3. 檢查nginx啟動進程
[root@linuxidc logs]# ps anx|grep nginx
6546 ? Ss 0:00 nginx: master process ./sbin/nginx
6702 ? S 0:00 nginx: worker process
6726 pts/1 S+ 0:00 grep nginx
說明:發(fā)現(xiàn)nginx的work process是nobody的
4. 修改 nginx.conf 文件
打開nginx.conf文件所在的目錄,查看文件的屬性 (root root)
[root@linuxidc nginx]# ll
drwxr-xr-x. 2 root root 4096 Jun 15 04:08 conf
在nginx.conf文件的第一行加上 user root root;
[root@linuxidc nginx]# cat conf/nginx.conf
user root root;
5. 重新 reload nginx進程
[root@linuxidc nginx]# ./sbin/nginx -s reload
6. 再次訪問,成功!


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 达尔| 鄱阳县| 叙永县| 南部县| 石阡县| 遂昌县| 甘肃省| 军事| 乌拉特后旗| 宿松县| 雅江县| 红桥区| 龙游县| 保德县| 津南区| 盐山县| 长治市| 东城区| 宝鸡市| 张家界市| 巴林左旗| 申扎县| 白城市| 澄城县| 武强县| 松江区| 汶川县| 珠海市| 平南县| 监利县| 赤水市| 乐山市| 资源县| 内乡县| 鄂尔多斯市| 抚顺市| 威海市| 潼关县| 南充市| 南充市| 通渭县|