nginx专栏 01.nginx简介

01.nginx简介

[toc]{type: “ol”, level: [2, 3, 4, 5]}

工作原理

启动后生成一个主进程,根据配置文件的选项来生成子进程/工作进程
主进程负责转发用户的请求,不负责处理用户的请求
工作进程的个数,一般为CPU核心数-1或-2

安装

wget https://nginx.org/download/nginx-1.16.1.tar.gz
tar xf nginx-1.16.1.tar.gz 
cd nginx-1.16.1
yum install gcc zlib2-devel pcre-devel openssl-devel ./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_stub_status_module
make && make install

目录结构

[root@localhost nginx]
conf  html  logs  sbin
conf 配置文件
html 存放静态文件 index.html 是默认的欢迎页面
logs 日志目录
sbin 二进制文件
# 启动以后会生成一个主进程,根据配置文件的选项来生成子进程(工作进程),主进程不负责处理用户的请求,用来转发用户的请求,真正负责处理用户请求的是子进程

命令格式

./sbin/nginx -h
nginx version: nginx/1.16.1
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit 显示版本号
  -V            : show version and configure options then exit 显示版本+编译时选项
  -t            : test configuration and exit  测试配置文件
  -T            : test configuration, dump it and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /opt/nginx/)
  -c filename   : set configuration file (default: conf/nginx.conf)
  -g directives : set global directives out of configuration file
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值