zoukankan      html  css  js  c++  java
  • 源码安装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
    

      

  • 相关阅读:
    python的select和epoll
    ibatis annotations 注解方式返回刚插入的自增长主键ID的值
    java web 项目中获取当前路径的几种方法
    Servlet的监听器
    mybatis-配置文件mybatis-config.xml
    数据库死锁
    JDBC控制事务
    server.xml 解析
    linux下Tomcat 安装后执行startup.sh,出现– Cannot find …bin/catalina.sh
    jni 类初始化失败(nested exception is java.lang.NoClassDefFoundError)
  • 原文地址:https://www.cnblogs.com/bfyang5130/p/13627498.html
Copyright © 2011-2022 走看看