日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux nginx 安装出错,Linux Nginx安装以及可能出现错误

發(fā)布時(shí)間:2025/3/11 linux 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux nginx 安装出错,Linux Nginx安装以及可能出现错误 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Linux Nginx安裝以及可能出現(xiàn)錯(cuò)誤

轉(zhuǎn)載請(qǐng)標(biāo)明出處?http://coderknock.com安裝過程

從?http://nginx.org/download/nginx-1.9.15.tar.gz下載nginx包(或者wget?http://nginx.org/download/nginx-1.9.15.tar.gz直接在Linux上用命令下載)

解壓并轉(zhuǎn)到目錄下

tar -zxvf nginx-1.9.15.tar.gz

cd nginx-1.9.15

設(shè)置一下配置信息 ./configure --prefix=/usr/local/nginx ,或者不執(zhí)行此步,直接默認(rèn)配置

編譯安裝

make

make install

make的過程是把各種語言寫的源碼文件,變成可執(zhí)行文件和各種庫文件;

make install是把這些編譯出來的可執(zhí)行文件和庫文件復(fù)制到合適的地方。

可能出現(xiàn)錯(cuò)誤在配置信息./configure --prefix=/usr/local/nginx 的時(shí),出現(xiàn)錯(cuò)誤:

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

解決方法:安裝pcre

yum -y install pcre pcre-devel

-y 是跳過所有需要手動(dòng)確認(rèn)的環(huán)節(jié)

缺少ssl錯(cuò)誤,錯(cuò)誤信息如下:

./configure: error: the HTTP cache module requires md5 functions

from OpenSSL library. You can either disable the module by using

--without-http-cache option, or install the OpenSSL library into the system,

or build the OpenSSL library statically from the source with nginx by using

--with-http_ssl_module --with-openssl= options.

解決方法:安裝openssl

yum -y install openssl openssl-devel

缺少編譯器,錯(cuò)誤信息如下:

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

解決方法:安裝gcc-c++

yum -y install gcc-c++ autoconf automake

autoconf是自動(dòng)配置,automake是自動(dòng)編譯

缺少zlib包,錯(cuò)誤信息如下:

./configure: error: the HTTP gzip module requires the zlib library.

You can either disable the module by using –without-http_gzip_module

option, or install the zlib library into the system, or build the zlib

library

statically from the source with nginx by using –with-zlib= option.

解決方法:安裝zlib

yum install -y zlib-devel

確實(shí)libxml2,錯(cuò)誤信息如下:

./configure: error: the HTTP XSLT module requires the libxml2/libxslt

libraries. You can either do not enable the module or install the libraries.

解決方法:

yum -y install libxml2 libxml2-dev

yum -y install libxslt-devel

http_image_filter_module是nginx提供的集成圖片處理模塊,需要gd-devel的支持,錯(cuò)誤信息如下:

./configure: error: the HTTP image filter module requires the GD library.

You can either do not enable the module or install the libraries.

解決方法:

yum -y install gd-devel

缺少ExtUtils,錯(cuò)誤信息如下:

./configure: error: perl module ExtUtils::Embed is required

解決方法:

yum -y install perl-devel perl-ExtUtils-Embed

缺少GeoIP,錯(cuò)誤信息如下:

./configure: error: the GeoIP module requires the GeoIP library.

You can either do not enable the module or install the library.

解決方法:

yum -y install GeoIP GeoIP-devel GeoIP-data

安裝完成后啟動(dòng)安裝成功后 /usr/local/nginx 目錄下如下

fastcgi.conf koi-win nginx.conf.default

fastcgi.conf.default logs scgi_params

fastcgi_params mime.types scgi_params.default

fastcgi_params.default mime.types.default uwsgi_params

html nginx uwsgi_params.default

koi-utf nginx.conf win-utf

啟動(dòng)

確保系統(tǒng)的 80 端口沒被其他程序占用,運(yùn)行/usr/local/nginx/nginx 命令來啟動(dòng) Nginx,

netstat -ano|grep 80

如果查不到結(jié)果后執(zhí)行,有結(jié)果則忽略此步驟(ubuntu下必須用sudo啟動(dòng),不然只能在前臺(tái)運(yùn)行)

sudo /usr/local/nginx/nginx

打開瀏覽器訪問此機(jī)器的 IP,如果瀏覽器出現(xiàn) Welcome to nginx! 則表示 Nginx 已經(jīng)安裝并運(yùn)行成功。

總結(jié)

以上是生活随笔為你收集整理的linux nginx 安装出错,Linux Nginx安装以及可能出现错误的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。