zoukankan      html  css  js  c++  java
  • Nginx小白入门实战

    Nginx启动

    通过配置文件启动,其中-c是配置文件的意思

    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

    若是将nginx添加到环境变量中,那么直接输入nginx即可启动

    先vim /etc/profile

    然后在文件中写

    PATH=$PATH:/usr/local/nginx/sbin
    export PATH

    如果输入该命令,结果报错,那么可能是端口占用引起的,可以先查看是否已有nginx在运行,有的话就kill掉进程


    启动之后,如何查看运行状态

    ps -ef | grep nginx


    查看之后有两个进程,一个master 一个worker,说明nginx启动好了

    nginx: master process

    nginx: worker process

    其中:

    master进程用来读取配置文件并且维护worker进程

    worker进程用来对请求进行实际处理


    关闭Nginx

    kill -QUIT masterPID  (其中masterPID为主进程的PID,用ps -ef | grep nginx查找) 会执行完当前请求再关闭进程

    重启Nginx 在sbin目录下

    ./nginx -s reload


    配置检查

    nginx -t

    查看版本

    nginx -v 或者 nginx -V,后者更详细些

    查看日志

    cd /usr/local/nginx/logs

    tail access.log

    启动关闭nginx

    systemctl start nginx

    systemctl stop nginx

  • 相关阅读:
    oracle数据库数据导出
    oracle 数据连接方式
    plsql 建表空间
    java Excel 导入数据库
    python爬虫学习数据分析(连载中)
    python之pip库管理工具pip安装
    数据结构之看病排队系统
    数据结构之顺序串
    数据结构之链队
    数据结构之环形队列
  • 原文地址:https://www.cnblogs.com/tudoo/p/12521306.html
Copyright © 2011-2022 走看看