• nginx 安装


    nginx 安装 (http://nginx.org)

    一、安装nginx时必须先安装相应的编译工具
    yum -y install gcc gcc-c++ autoconf automake
    yum -y install zlib zlib-devel openssl openssl-devel pcre-devel

    #yum install -y zlib-devel

    1、wget http://nginx.org/download/nginx-1.5.0.tar.gz
    2、tar zxvf nginx-1.5.0.tar.gz
    3、cd nginx-1.5.0
    4、    #./configure --without-http_rewrite_module  --prefix=/usr/local/web_server/nginx/
             ./configure --prefix=/usr/local/web_server/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-pcre
    5、make && make install

    6、启动、停止

        启动/usr/local/web_server/nginx/sbin/nginx -c /usr/local/web_server/nginx/conf/nginx.conf

    停止
    步骤1:查询nginx主进程号
    ps -ef | grep nginx
    在进程列表里 面找master进程,它的编号就是主进程号了。
    步骤2:发送信号
    从容停止Nginx:
    kill -QUIT 主进程号
    快速停止Nginx:
    kill -TERM 主进程号
    强制停止Nginx:
    pkill -9 nginx

    另外, 若在nginx.conf配置了pid文件存放路径则该文件存放的就是Nginx主进程号,如果没指定则放在nginx的logs目录下。有了pid文 件,我们就不用先查询Nginx的主进程号,而直接向Nginx发送信号了,命令如下:
    kill -信号类型 '/usr/nginx/logs/nginx.pid'

    注意,修改了配置文件后最好先检查一下修改过的配置文件是否正 确,以免重启后Nginx出现错误影响服务器稳定运行。判断Nginx配置是否正确命令如下:
    nginx -t -c /usr/nginx/conf/nginx.conf 或者 /usr/nginx/sbin/nginx -t



    /usr/sbin/groupadd -f www
    /usr/sbin/useradd -g www www


    错误提示:./configure: error: the HTTP rewrite module requires the PCRE library.
    解决办法:安装pcre-devel解决问题 yum -y install pcre-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

  • 相关阅读:
    file类和io流
    数组元素的填充与替换、排序和复制
    foreach遍历数组、数组的转置与方阵的迹
    Java小故事(一)
    java杨辉三角和空心菱形(二维数组篇)
    JAVA修饰符、关键字和继承(一)
    JAVA面向对象和类
    JAVA小程序-----买衣服
    JAVA流程控制
    Java包、类、数据类型、表达式和标识符
  • 原文地址:https://www.cnblogs.com/linyu/p/3911803.html
Copyright © 2020-2023  润新知