腾讯云CentOS安装Nginx

官方文档 http://nginx.org/en/docs/configure.html

./configure 

make 

make install


nginx依赖以下模块: //摘自网络

gzip模块需要 zlib 库

rewrite模块需要 pcre 库

ssl 功能需要openssl库


放弃用yum,直接wget http://nginx.org/download/nginx-1.8.1.tar.gz(我下的时候最新的稳定版1.8.1)

PuTTY登陆的时候光标前是[root@VM_       _centos ~]#   ~是root目录


然后解压 tar -zxvf nginx-1.8.1.tar.gz

进入解压文件夹 cd nginx-1.8.1

./configure

make

make install

/usr/local/nginx/sbin/nginx    开启nginx
(默认安装目录/usr/local/nginx ,自己改了这里应该也要改,腾讯云的方法是/目录下 sevice nginx restart,没试过 http://www.qcloud.com/wiki/CentOS环境配置)
 
Linux下的nginx启动、重新启动

最后用 wget http://127.0.0.1 测试


安装出现在下面的错误是缺少编译环境。安装编译源码所需的工具和库

报错  ./configure: error: C compiler cc is not found
解决 yum install gcc gcc-c++ ncurses-devel perl

继续./configure

报错  ./configure: error: the HTTP rewrite module requires the PCRE library.

安装pcre-devel解决问题
yum -y install pcre-devel


报错 ./configure: error: the HTTP gzip module requires the zlib library.

解决 yum install -y zlib-devel


报错 ./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library.   You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl=<path> options.

解决 yum -y install openssl openssl-devel

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值