2022-05-19 Linux下啟動(dòng)和關(guān)閉nginx命令, Linux防火墻關(guān)閉方法

linux 下面啟動(dòng)nginx 和關(guān)閉nginx, 查看linux 開放的所有端口netstat -ntpl,重啟服務(wù)命令 :service network restart

1 進(jìn)入到安裝的目錄里面 whereis nginx

image.png

2. 進(jìn)入該路徑:cd /usr/local/nginx/sbin

3 啟動(dòng)nginx 命令: ./nginx 出現(xiàn)下面啟動(dòng)成功

image.png

4 查看nginx 的狀態(tài) ps -ef | grep nginx 出現(xiàn)master 則啟動(dòng)成功

image.png

5 關(guān)閉nginx 命令 kill -9 8725(進(jìn)程號(hào) 上面的) 則關(guān)閉nginx

6. 停止 nginx 命令: ./nginx -s stop

7.重啟nginx命令:./nginx -s reload

http://t.zoukankan.com/aimei-p-12859102.html

請(qǐng)注意關(guān)閉防火墻才能訪問

https://blog.csdn.net/u013603364/article/details/95992487

關(guān)閉防火墻:
1、查看狀態(tài):systemctl status firewalld


image.png

2、關(guān)閉: systemctl stop firewalld(只執(zhí)行這個(gè),重啟后不行,還必須執(zhí)行systemclt disable firewalld)


image.png

1.1、查看selinux狀態(tài):getenforce

2.2、關(guān)閉:編輯文件 /etc/selinux/config,將selinux的值改成disable,然后重啟生效(reboot)

3.1、查看iptables狀態(tài):systemctl status iptables

3.2、centos7 默認(rèn)是使用firewalld作為防火墻,iptables是關(guān)閉狀態(tài),,若執(zhí)行chkconfig iptables off命令(永久關(guān)閉)


啟動(dòng)了NGINX,關(guān)閉了防火墻,然后在瀏覽器中輸入IP才能訪問頁面

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容