Centos7安裝nginx

下載、安裝

  • 依次執行下列命令:python

    `
    cd /usr/local/src/
    
    wget http://nginx.org/download/nginx-nginx-1.10.1.tar.gz
    
    tar zxvf nginx-1.10.1.tar.gz -C /usr/local
    
    cd /usr/local/nginx-1.10.1/
    
    ./configure
    
    `
  • 問題:

./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-httprewritemodule option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre= optionnginx

安裝依賴

$ yum install gcc-c++
$ yum install pcre pcre-devel
$ yum install zlib zlib-devel
$ yum install openssl openssl--devel c++

再次安裝nginx

cd /usr/local/nginx-1.10.1/ ./configure make && make installpython2.7

測試是否可用

cd /usr/local/nginx/sbin ./nginx測試

  • 若是出現以下問題: ` nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind()ui

    `spa

  • 查看80端口占用狀況

netstat -ntpl pkill -9 nginx 再次啓動./nginxcode

  • 也有多是防火牆的問題,查看ip是否能夠ping通,端口是否開放

升級python後致使yum不可用

vi /usr/bin/yumip

修改python頭部python爲python2.7.5ssl

相關文章
相關標籤/搜索