zoukankan      html  css  js  c++  java
  • nginx

    [root@zzx nginx-1.10.1]# yum install -y openssl openssl-devel zlib pcre           yum安装的pcre版本很低 可以编译安装高版本

    yum install -y gcc gcc-c++  编译安装需要gcc

    tar zxf pcre-8.39.tar.gz

    cd  pcre-8.39

    ./configure

    make

    make install

    tar 

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

    指定用户和组 指定安装位置和安装模块

    [root@zzx nginx-1.10.1]# ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.10.1 --with-http_stub_status_module --with-http_ssl_module           

    [root@zzx nginx-1.10.1]# make

    [root@zzx nginx-1.10.1]# make install

     [root@nginx application]# ln -sv /application/nginx-1.10.1/ /application/nginx

    检查语法发现错误 由于pcre版本太高了 打开共享库的时候找不到这个文件

    [root@nginx application]# /application/nginx/sbin/nginx -t
    /application/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory

    [root@nginx application]# find / -name libpcre.so.1
    /usr/local/lib/libpcre.so.1

    [root@nginx application]# echo "/usr/local/lib" >> /etc/ld.so.conf    编辑文件
    [root@nginx application]# ldconfig       使文件立即生效
    [root@nginx application]# /application/nginx/sbin/nginx -t   再次检查语法

    nginx: the configuration file /application/nginx-1.10.1/conf/nginx.conf syntax is ok
    nginx: [emerg] getpwnam("nginx") failed       由于没有创建nginx这个用户
    nginx: configuration file /application/nginx-1.10.1/conf/nginx.conf test failed

    [root@nginx application]# useradd nginx -s /sbin/nologin -M
    [root@nginx application]# passwd nginx

    [root@nginx application]# /application/nginx/sbin/nginx -t   再次检查就成功了
    nginx: the configuration file /application/nginx-1.10.1/conf/nginx.conf syntax is ok
    nginx: configuration file /application/nginx-1.10.1/conf/nginx.conf test is successful

    [root@nginx application]# /application/nginx/sbin/nginx    回车启动 不需要start

  • 相关阅读:
    RMQ 算法入门
    hdu1535——Invitation Cards
    LeetCode 206. Reverse Linked List(迭代和递归两种实现)
    CSDN开源夏令营 基于Compiz的switcher插件设计与实现之前期准备 git的简单使用
    xml初学简单介绍
    do{}while(0)与CC_BREAK_IF的绝妙搭配
    《Python基础教程》第20章学习笔记
    oracle启动过程2
    Javascript 笔记与总结(1-6)Javascript 面向对象
    [Swift]LeetCode44. 通配符匹配 | Wildcard Matching
  • 原文地址:https://www.cnblogs.com/hanxing/p/5765626.html
Copyright © 2011-2022 走看看