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

阿里云服务器源码部署nginx服务器

时间:2017-10-16 17:53:38      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:download   1.0   usr   ++   table   http   tps   轻量   nginx服务器   

阿里云轻量应用服务器centos7.3镜像

  http://nginx.org/en/download.html下选择合适的版本:Mainline version:开发版本,最新版本;Stable version:稳定版本;Legacy versions:历史版本

  cd /usr/local/src/进入到src目录下

  wget http://nginx.org/download/nginx-1.12.1.tar.gz此处下载的是最新的稳定版本

  tar -zxvf nginx-1.12.1.tar.gz解压文件

  nginx依赖pcre,zlib,openssl,先下载并解压

  1.下载pcre包

  wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz

  tar -zxvf pcre-8.41.tar.gz

  2.下载zlib包

  wget http://zlib.net/zlib-1.2.11.tar.gz

  tar -zxvf zlib-1.2.11.tar.gz

  3.下载openssl包

  wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz

  tar -zxvf openssl-1.0.2l.tar.gz

  4.安装http://nginx.org/en/docs/configure.html查看配置参数

  cd nginx-1.12.1/进入到nginx目录下

  ./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=../pcre-8.41 --with-zlib=../zlib-1.2.11 --with-openssl=../openssl-1.0.2l

  make

  make时出现错误configure: error: You need a C++ compiler for C++ support则先安装gcc 和gcc-c++

    yum -y install gcc

    yum -y install gcc-c++

  再make

  make install

  在ll /usr/local/nginx下有如下文件表示安装成功

  技术分享

  敲/usr/local/nginx/nginx启动nginx

  在浏览器中输入服务器ip可以看到

  技术分享

 

 

  

阿里云服务器源码部署nginx服务器

标签:download   1.0   usr   ++   table   http   tps   轻量   nginx服务器   

原文地址:http://www.cnblogs.com/zaijiang/p/7662427.html

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