• 源码安装nginxphp-fpm需要注意的坑


    1、首先对服务器进行一次大的更新操作

    yum -y update

    yum install epel-release

    2、下载对应要安装的nginx版本

     yum -y install pcre-devel

    yum -y install openssl openssl-devel

    先添加要运行的用户

    useradd -s /sbin/nologin -r www

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

    正常安装...

    ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-openssl-opt='enable-weak-ssl-ciphers'

    make && make install

    编写启动脚本

    [Unit]
    Description=nginx
    After=network.target remote-fs.target nss-lookup.target
     
    [Service]
    Type=forking
    PIDFile=/usr/local/nginx/logs/nginx.pid
    ExecStartPost=/bin/sleep 0.1
    ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
    ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    ExecReload=/bin/kill -s HUP $MAINPID
    ExecStop=/bin/kill -s QUIT $MAINPID
    PrivateTmp=true
     
    [Install]
    WantedBy=multi-user.target
    

      开机启动

    1. 开机自启:
    2.  
      systemctl enable nginx.service
    3.  
      关闭开机自启:
    4.  
      systemctl disable nginx.service

    安装php-fpm

    安装基础依赖

    yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  
    libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel  
    libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel 
    ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel  krb5-devel 
    openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
    

      

  • 相关阅读:
    转: wireshark过滤规则
    PHP开发
    转:python安装pycrypto
    How to use pycharm to debug scrapy projects
    VCForPython27.msi安装后, 还显示error: Unable to find vcvarsall.bat
    Dcgpofix
    Dsamain
    组托管服务帐户概述
    创建 PSO
    介绍 Active Directory 域服务 (AD DS) 虚拟化
  • 原文地址:https://www.cnblogs.com/bfyang5130/p/13627498.html
Copyright © 2020-2023  润新知