wget
tar zxvf nginx-1.0.11.tar.gz
./configure
make
make install
安裝的時候出現錯誤如下:
解決方法,安裝pcre包,**如下:
wget
tar zxvf pcre-8.37.tar.gz
./configure
make
make install
然後再去安裝 nginx,重複第一步,結果如下,說明安裝好了:
接著啟動nginx報錯如下:
./nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: no such file or directory
通過這個命令檢視:ldd $(which /usr/local/nginx/sbin/nginx)
結果如下顯示:
linux-vdso.so.1 => (0x00007fffa89fe000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc08b3c3000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fc08b18a000)
libpcre.so.1 => not found
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fc08adae000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fc08ab97000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc08a7cd000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc08b5fa000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc08a5c9000)
解決方法:新增軟鏈結, ln -s /usr/local/lib/libpcre.so.1 /lib/x86_64-linux-gnu/libpcre.so.1
最後啟動nginx,沒有報錯,啟動成功。
nginx的安裝與配置
1 nginx 4 nginx的安裝 linux centos7 2 安裝相關依賴和庫檔案 yum y install gcc gcc c autoconf automake gcc gcc c 的庫檔案 yum y install pcre pcre devel 安裝nginx依賴包 yum y ...
Nginx 的安裝與配置
linux centos 7.3 64位 nginx nginx 1.13.1 安裝目錄 usr local 3 openssl 若需要支援 https 協議 yum y install openssl yum y install openssl devel 1 解壓安裝包 tar z xv f n...
nginx安裝與配置
1 安裝前,需要安裝的軟體包 yum y install gcc gcc c autoconf automake yum y install zlib zlib devel openssl openssl devel pcre pcre devel 2 安裝nginx 3 啟動與停止nginx 啟動...