码迷,mamicode.com
首页 > 其他好文 > 详细

LNMP之 nginx 安装&启动

时间:2016-11-03 03:11:09      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:nginx 安装


[root@LNMP ~]# cd /usr/local/src/


[root@LNMP src]# wget http://nginx.org/download/nginx-1.10.2.tar.gz


[root@LNMP src]# tar zxvf nginx-1.10.2.tar.gz 


[root@LNMP src]# cd nginx-1.10.2/


[root@LNMP 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 不存在


[root@LNMP nginx-1.10.2]# yum install -y pcre-devel  #安装即可

再次重新配置即可。

[root@LNMP nginx-1.10.2]# echo $?

0(每配置或编译要用此命令检查)

[root@LNMP nginx]# make 

[root@LNMP nginx]# make install


[root@LNMP nginx-1.10.2]# cd /usr/local/nginx/

[root@LNMP nginx]# ls   # 查看到nginx 文件夹下生了四个目录

conf  html  logs  sbin


[root@LNMP nginx]# ls sbin/nginx   #这是一个可执行文件

sbin/nginx

[root@LNMP nginx]# /usr/local/nginx/sbin/nginx  #启动 nginx 

本文出自 “CBO#Boy_Linux之路” 博客,请务必保留此出处http://20151213start.blog.51cto.com/9472657/1868705

LNMP之 nginx 安装&启动

标签:nginx 安装

原文地址:http://20151213start.blog.51cto.com/9472657/1868705

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!