Linux centos7環境下安裝Nginx的步驟詳解
1、 首先到Nginx官網下載Nginx安裝包
下載好后會見到類似下面的一份文件
創建nginx-src目錄并且去到nginx-src目錄里運行如下命令即可:
mkdir nginx-src && cd nginx-src
當然也可以在Linux底下運行以下命令進行下載Nginx安裝包
wget http://nginx.org/download/nginx-1.5.9.tar.gz
2、解壓nginx-1.5.9.tar.gz文件
tar -zxvf nginx-1.5.9.tar.gz
3、刪除安裝包文件命令
rm -f nginx-1.5.9.tar.gz
4、配置安裝運行命令
cd nginx-1.5.9/./configure --prefix=/usr/local/nginx
也許是提示缺包:
./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=<path> option.
安裝pcre-devel解決問題(需要有網絡下運行并且是超級管理員身份)
yum -y install pcre-develyum -y install openssl openssl-devel
要切換為root超級管理員身份: su
現在進行重新配置
./configure --prefix=/usr/local/nginx
如果重新配置也不成功這時需要安裝gcc
yum 主站蜘蛛池模板: 正镶白旗| 青阳县| 新干县| 梧州市| 邯郸市| 新竹县| 黑水县| 土默特右旗| 榆中县| 禄劝| 东辽县| 荃湾区| 望奎县| 梁山县| 三门峡市| 宝清县| 商南县| 安陆市| 东乡| 黑山县| 新龙县| 宝坻区| 宜宾县| 鞍山市| 象州县| 来安县| 文登市| 衡山县| 佛坪县| 景东| 称多县| 西城区| 张北县| 古交市| 延庆县| 临颍县| 景泰县| 嘉定区| 江山市| 鹤岗市| 二连浩特市|