CentOS7下安装Nginx

发布时间:2020-08-01 09:42:04 作者:chen_785
来源:网络 阅读:978

第一步:下载文件:Nginx下载网址
第二步:上传到相关目录中,解压 tar -zxvf nginx.tar.gz (下载后修改名字是nginx.tar.gz,基本上会带有版本号)
第三步:./configure [--prefix]指定文件目录,不指定目录默认安装在系统目录下。

  1. 执行上面命令可能会出现的错误信息:
    checking for OS

    • Linux 2.6.32-431.el6.x86_64 x86_64
      checking for C compiler ... not found
      则需要执行以下命令:

                      **yum -y install gcc gcc-c++ autoconf automake make**

当在执行./configure [--prefix]时,会出现2,

  1. 编译安装nginx需要pcre包,未安装会有如下提示:
    ./configure: error: the HTTP rewrite module requires the PCRE library.
    You can either disable the module by using --without-http_rewrite_module
    option, or install the PCRE library into the system, or build the PCRE library
    statically from the source with nginx by using --with-pcre=<path> option.
    需要安装pcre的devel包,pcre-devel。使用yum安装即可:(以下命令还带有ssl、zlib等依赖的安装)

                        **yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel**

第四步:make && make install

执行命令启动和停止命令进行测试

  1. sbin/nginx
  2. ./nginx -s stop
推荐阅读:
  1. Centos7下nginx的安装与配置教程详解
  2. Centos7怎么安装PHP及Nginx

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

nginx 7下 ce

上一篇:如何使用mysql条件查询and和or及其优先级

下一篇:mongodb副本集指的是什么

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》