1. 程式人生 > 實用技巧 >CentOS7桌面版安裝nginx常見問題

CentOS7桌面版安裝nginx常見問題

<h1>編譯安裝nginx報錯 checking for C compiler ... not found

##編譯安裝在執行./configure步驟報錯,是因為缺少環境變數

checking for C compiler … not found

./configure: error: C compiler cc is not found

###解決辦法

yum -y install gcc
yum -y install gcc-c++

##./configure: error: the HTTP rewrite module requires the PCRE library.

You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=option.

###解決辦法

yum -y install openssl openssl-devel

#安裝執行之後本地瀏覽器輸入ip無法訪問

##解決辦法

//永久關閉防火牆
檢視防火牆狀態:systemctl status firewalld.service

如上圖:防火牆執行狀態

執行關閉命令:systemctl stop firewalld.service

再次執行檢視防火牆命令:systemctl status firewalld.service

如下圖所示表示防火牆已經關閉

執行開機禁用防火牆自啟命令 :systemctl disable firewalld.service

完成

============================================================

關於防火牆的其他命令:

啟動:systemctl start firewalld.service

防火牆隨系統開啟啟動 :systemctl enable firewalld.service