• nginx安装


    安装依赖,安装前准备
    yum install gcc
    yum install pcre-devel
    yum install zlib zlib-devel
    yum install openssl openssl-devel

    下载解压安装包
    //创建一个文件夹
    cd /usr/local
    mkdir nginx
    cd nginx
    //下载tar包
    wget http://nginx.org/download/nginx-1.13.7.tar.gz
    tar -xvf nginx-1.13.7.tar.gz

    安装nginx
    //进入nginx目录
    cd /usr/local/nginx
    //执行命令
    ./configure
    //执行make命令
    make
    //执行make install命令
    make install


    # //测试配置文件
    [root@VM-4-3-centos nginx]# ./sbin/nginx -t
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

    # nginx启动命令
    [root@VM-4-3-centos sbin]# ./nginx
    # nginx停止命令 或者 : nginx -s quit
    [root@VM-4-3-centos sbin]# ./nginx -s stop
    [root@VM-4-3-centos sbin]# ps -ef | grep nginx
    root 26194 22309 0 15:44 pts/0 00:00:00 grep --color=auto nginx

    如果是已经停止服务了,是不可以重启的。只有在正常运行的情况下,才可以reload重启。
    # 重启命令
    [root@VM-4-3-centos sbin]# ./nginx -s reload
    nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
    [root@VM-4-3-centos sbin]# ./nginx
    # 查看进程命令
    [root@VM-4-3-centos sbin]# ps -ef | grep nginx
    root 26291 1 0 15:44 ? 00:00:00 nginx: master process ./nginx
    nobody 26292 26291 0 15:44 ? 00:00:00 nginx: worker process
    root 26309 22309 0 15:44 pts/0 00:00:00 grep --color=auto nginx
    [root@VM-4-3-centos sbin]# ./nginx -s reload
    [root@VM-4-3-centos sbin]# ps -ef | grep nginx
    root 26291 1 0 15:44 ? 00:00:00 nginx: master process ./nginx
    nobody 26396 26291 0 15:45 ? 00:00:00 nginx: worker process
    root 26411 22309 0 15:45 pts/0 00:00:00 grep --color=auto nginx

    # 测试访问
    [root@VM-4-3-centos conf]# curl http://127.0.0.1:80

  • 相关阅读:
    Oracle中的带参数的视图--我们致力于打造人力资源软件
    (免费)在线演示人力资源管理系统--源自偕行软件
    打造国内第一个支持在线演示的人力资源管理系统--源自偕行软件
    Silverlight C1.Silverlight.FlexGrid 表格动态列
    SILVERLIGHT 多维表头、复杂表头 MULTIPLE HEADER
    weixin JS 接口调用代码
    盒布局
    焦点不在input或textarea中,屏蔽回格按钮
    CSS3多栏布局
    AJAX
  • 原文地址:https://www.cnblogs.com/oktokeep/p/16340344.html
Copyright © 2020-2023  润新知