[[email protected] ~]# cd /usr/local/src/
[[email protected] src]# wget http://nginx.org/download/nginx-1.10.2.tar.gz
[[email protected] src]# tar zxvf nginx-1.10.2.tar.gz
[[email protected] src]# cd nginx-1.10.2/
[[email protected] nginx-1.10.2]# ./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre
checking for PCRE library in /usr/include/pcre/ ... not found
编译完成后,提示 pcre 不存在
[[email protected] nginx-1.10.2]# yum install -y pcre-devel #安装即可
再次重新配置即可。
[[email protected] nginx-1.10.2]# echo $?
0(每配置或编译要用此命令检查)
[[email protected] nginx]# make
[[email protected] nginx]# make install
[[email protected] nginx-1.10.2]# cd /usr/local/nginx/
[[email protected] nginx]# ls # 查看到nginx 文件夹下生了四个目录
conf html logs sbin
[[email protected] nginx]# ls sbin/nginx #这是一个可执行文件
sbin/nginx
[[email protected] nginx]# /usr/local/nginx/sbin/nginx #启动 nginx
LNMP之 nginx 安装&启动