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 主站蜘蛛池模板: 广昌县| 旌德县| 定结县| 惠东县| 灵武市| 冕宁县| 尉犁县| 章丘市| 秦皇岛市| 鄂托克前旗| 民和| 灯塔市| 常熟市| 滨州市| 屏山县| 湟中县| 玉树县| 定西市| 科技| 鄂托克旗| 敖汉旗| 昭觉县| 定日县| 遂川县| 芷江| 江陵县| 海林市| 吴旗县| 清苑县| 定远县| 蓬安县| 梁河县| 西平县| 文昌市| 保靖县| 安乡县| 孝义市| 湖南省| 饶阳县| 襄城县| 宣汉县|