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

centos6.5 Nginx安装

时间:2018-01-17 11:20:24      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:注释   配置   ash   mha   自启动   class   www   --   shel   


// 安装需要用到的东西,先准备好 yum install -y make cmake gcc gcc-c++ autoconf automake libpng-devel libjpeg-devel zlib libxml2-devel ncurses-devel bison libtool-ltdl-devel libiconv libmcrypt mhash mcrypt libmcrypt-devel pcre-devel openssl-devel freetype-devel libcurl-devel

 

安装Nginx

建立安装目录,进入安装目录 cd /opt/src

wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0
//添加www用户,其中-M参数表示不添加用户家目录,-s参数表示指定shell类型
useradd www -M -s /sbin/nologin
vim auto/cc/gcc
//注释掉取消Debug编译模式
#CFLAGS="$CFLAGS -g"

//配置下nginx编译参数
[root@nginx-1.8.0 ~]#./configure --prefix=/opt/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module
[root@nginx-1.8.0 ~]#make
[root@nginx-1.8.0 ~]#make install clean

//添加开机自启动
[root@nginx-1.8.0 ~]#vim /etc/rc.local
在这个文件里面添加:/opt/nginx/sbin/nginx
[root@nginx-1.8.0 ~]#/opt/nginx/sbin/nginx

  技术分享图片

技术分享图片

 

centos6.5 Nginx安装

标签:注释   配置   ash   mha   自启动   class   www   --   shel   

原文地址:https://www.cnblogs.com/leisir/p/8301545.html

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