• LNMP架构及应用部署!


    LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构。

    WNMP代表的就是:Windows系统下Nginx+MySQL+PHP这种网站服务器架构。

    WAMP代表的就是:Windows系统下Apache+MySQL+PHP这种网站服务器架构。

    ========================================================================================

    [root@localhost ~]# cd /usr/local/php5/etc
    [root@localhost etc]# ls
    pear.conf       php-fpm.conf.default
    [root@localhost etc]# cp php-fpm.conf.default php-fpm.conf
    [root@localhost etc]# useradd -M -s /sbin/nologin php

    [root@localhost etc]# vim php-fpm.conf

    去掉第25行pid = run/php-fpm.pid的分号

    第149行修改为:

    user = php
    group = php

    第246行修改为

    pm.start_servers = 20           //FPM启动数为20个

    第251行修改为

    pm.min_spare_servers = 5                      //空闲数量为5个

    ; The desired maximum number of idle server processes.
    ; Note: Used only when pm is set to 'dynamic'
    ; Note: Mandatory when pm is set to 'dynamic'
    pm.max_spare_servers = 35                     //空闲数量为35个

    第241行修改为

    pm.max_children = 50                          //最大空闲为50个

    [root@localhost etc]# /usr/local/sbin/php-fpm                       //启动FPM

    [root@localhost etc]# netstat -anpt
    tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 8709/php-fpm: maste                 //FPM会开启一个9000的端口

    [root@localhost etc]# cd

    [root@localhost ~]# vim /etc/init.d/nginx 

    复制代码
    #!/bin/bash
    # chkconfig: 2345 99 20
    # description: Nginx Server Control Scripts shell
    PROG="/usr/local/nginx/sbin/nginx"
    PIDF="/usr/local/nginx/logs/nginx.pid"

      PROG_FPM="/usr/local/sbin/php-fpm"
      PIDF_FPM="/usr/local/php5/var/run/php-fpm.pid"

    case "$1" in
    start)
            $PROG
            $PROG_FPM
    ;;
    stop)
            kill -s QUIT $(cat $PIDF)
            kill -s QUIT $(cat $PIDF_FPM)
    ;;
    restart)
            $0 stop
            $0 start
    ;;
    reload)
            kill -s HUP $(cat $PIDF)
    ;;
    *)
            echo "Usage: $0 {start|stop|restart|reload}"
            exit 1
    esac
    exit 0
    复制代码
  • 相关阅读:
    Argument 1 cannot be null
    灵性的笔尖勾勒幻想的国度,找寻梦想的脚步!用我的思想创建一个芬芳的世界!
    错误: Aggregate query has too many rows > 不需要用子查询
    之前玩GAE收藏夹里的链接
    ExtJs收缩按钮相应事件如何被捕捉?
    winxp注册表之开始菜单和任务栏
    C#代码规范 程序员必备的秘笈[转]
    c#中datagridview里checkbox的使用方法[转]
    Log4Net详细介绍[转]
    Ubuntu10.04窗口风格改为windows风格的方法
  • 原文地址:https://www.cnblogs.com/L1-5551/p/11518452.html
Copyright © 2020-2023  润新知