Nginx安装

Nginx下载 http://nginx.org/en/download.html

本环境CentOS 7.9 安装nginx

gcc 安装
安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc 环境,如果没有 gcc 环境,则需要安装:

yum install -y gcc-c++

PCRE pcre-devel 安装
PCRE(Perl Compatible Regular Expressions) 是一个Perl库,包括 perl 兼容的正则表达式库。nginx 的 http 模块使用 pcre 来解析正则表达式,所以需要在 linux 上安装 pcre 库,pcre-devel 是使用 pcre 开发的一个二次开发库。nginx也需要此库。命令:

yum install -y pcre pcre-devel

zlib 安装
zlib 库提供了很多种压缩和解压缩的方式, nginx 使用 zlib 对 http 包的内容进行 gzip ,所以需要在 Centos 上安装 zlib 库。

yum install -y zlib zlib-devel

OpenSSL 安装
OpenSSL 是一个强大的安全套接字层密码库,囊括主要的密码算法、常用的密钥和证书封装管理功能及 SSL 协议,并提供丰富的应用程序供测试或其它目的使用。
nginx 不仅支持 http 协议,还支持 https(即在ssl协议上传输http),所以需要在 Centos 安装 OpenSSL 库。

yum install -y openssl openssl-devel

下载nginx

wget http://nginx.org/download/nginx-1.18.0.tar.gz

解压

tar xvzf nginx-1.18.0.tar.gz

cd nginx-1.18.0/

mkdir -p /var/temp/nginx

自定义安装:

./configure
–prefix=/usr/local/nginx
–conf-path=/usr/local/nginx/conf/nginx.conf
–pid-path=/usr/local/nginx/conf/nginx.pid
–lock-path=/var/lock/nginx.lock
–error-log-path=/var/log/nginx/error.log
–http-log-path=/var/log/nginx/access.log
–with-http_gzip_static_module
–http-client-body-temp-path=/var/temp/nginx/client
–http-proxy-temp-path=/var/temp/nginx/proxy
–http-fastcgi-temp-path=/var/temp/nginx/fastcgi
–http-uwsgi-temp-path=/var/temp/nginx/uwsgi
–http-scgi-temp-path=/var/temp/nginx/scgi

make

make install

whereis nginx

cd /usr/local/nginx/sbin

./nginx

验证,浏览器访问 ip:80
在这里插入图片描述

systemd管理nginx

如果在上面的实验中,已经启动nginx,需要先将nginx 进程杀掉,避免影响后面的操作。

ps aux | grep nginx
#都给b杀了,除了那个grep的不用操心。
kill -9 pid

vim /lib/systemd/system/nginx.service

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/usr/local/nginx/conf/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl start nginx.service
systemctl status nginx

在这里插入图片描述

systemctl enable nginx.service
systemctl reload nginx.service
systemctl stop nginx.service

接下来要研究基础配置啦。走你链接

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Version: 2.5.0 (2020-10-21) Keil.STM32L4xx_DFP.2.5.0.pack Download Updated Pack to STM32Cube_FW_L4 Firmware Package version V1.16.0 using HAL Drivers V1.12.0 Package Description (pdsc): Added global define USE_HAL_DRIVER to the component ::Device:STM32Cube HAL:Common. Device support: Aligned devices with CubeMX DB. CMSIS Flash Algorithm: Removed targets (STM32L4xx_512, STM32L4xx_256) from STM32L4Rx Flash Algorithm project. Added source code for: STM32L476G-Disco QSPI, STM32L4P5G-DK OSPI, STM32L4P5G-DK PSRAM STM32L4R9I-DK PSRAM, STM32L4R9I-DK OSPI1 and STM32L4R9I-EVAL OSPI. Added PSRAM external Loader support for STM32L4R9I-Disco. Fixed STM32L4P5 1M internal flash Loader sector erase with DBANK mode. Fixed STM32L4xx 512K and 128K internal flash Loader sector erase. CMSIS-Driver: MCI: Replaced empty delay loops with _NOP(). Added handling for separate SD and MMC HAL layers. Added busy signal handling after CMDREND interrupt. SPI: Corrected PowerControl function (to return error if Initialize was not called, to abort active transfer if power off was requested). Updated GetDataCount function to give accurate count. Corrected Uninitialize function (to power off the peripheral if it is powered). USART: Added Driver_USART6 (uses LPUART1). Corrected GetTxCount/GetRxCount implementation. USBD: Removed include of stm32l4xx_hal_pcd.h header. Corrected documentation of STM32CubeMx configuration. Updated Boards Examples: Migrated CubeMX projects to V6.0.1. Changed variant selection to "MDK-Plus" where possible. Updated all USB Host/Device examples with user templates from MDK-Middleware v7.11.1.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值