centos7.2下部署nginx

#nginx是一款功能强大、开源软件

专注于为中小企业提供网站建设、成都网站设计服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业复兴免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了成百上千企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。

1、系统版本和内核版本

        

           [root@node06 ~]# uname -r

              3.10.0-327.el7.x86_64

           [root@node06 ~]# cat /etc/redhat-release 

              CentOS Linux release 7.2.1511 (Core) 

           [root@node06 ~]# 

2、软件包版本  nginx-1.11.10.tar.gz   (包的地址在介绍里)

3、安装依赖

         [root@nginx ~]#  yum install -y gcc  pcre-devel  openssl-devel

4、创建nginx启动用户、需要的目录并解压安装包。

         [root@nginx ~]# useradd nginx

         [root@nginx ~]# mkdir -p /usr、local/nginx/{client,proxy,fastcgi,uwsgi,scgi}

         [root@nginx ~]# tar zxf nginx-1.11.10.tar.gz

         [root@nginx ~]# cd nginx-1.11.10/

5、配置nginx的安装参数和编译

        

[root@nginx nginx-1.11.4]# ./configure \

--prefix=/usr/local/nginx \

--user=nginx \

--group=nginx \

--with-http_ssl_module \

--with-http_flv_module \

--with-http_stub_status_module \

--with-http_gzip_static_module \

--http-client-body-temp-path=/usr/local/nginx/client \

--http-proxy-temp-path=/usr/local/nginx/proxy \

--http-fastcgi-temp-path=/usr/local/nginx/fastcgi \

--http-uwsgi-temp-path=/usr/local/nginx/uwsgi \

--http-scgi-temp-path=/usr/local/nginx/scgi \

--with-pcre \

--with-file-aio \

--with-http_secure_link_module 

[root@nginx nginx-1.11.10]# make && make install

6、验证安装是否成功

     [root@nginx ~]#cd /usr/local/nginx/

       [root@nginx ~]#ls sbin/

        nginx        证明安装成功

7、启动nginx并设置开机自启

     [root@nginx ~]# /usr/local/nginx/sbin/nginx 

     [root@nginx ~]#  vim /etc/rc.d/rc.local

     /usr/local/nginx/sbin/nginx 

     [root@nginx ~]# chmod a+x /etc/rc.d/rc.local   -------> centos7.2需要这一步

8、验证nginx是否正常启动

     打开网页输入       http://

     能看到nginx提供的页面表示安装成功


分享文章:centos7.2下部署nginx
当前链接:http://myzitong.com/article/psices.html