LNMP architecture and application deployment!

Nginx + MySQL + PHP web server architecture that Linux system: LNMP is represented.

WNMP is represented by: Nginx + MySQL + PHP web server architecture that the Windows system.

WAMP is represented by: Apache + MySQL + PHP web server architecture that the Windows system.

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

[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

Line 25 to remove the semicolon pid = run / php-fpm.pid of

149 Line amended as follows:

user = php
group = php

246 Line amended as follows:

pm.start_servers = 20 // FPM start number 20

251 Line amended as follows:

pm.min_spare_servers = 5 // 5 is the number of free

; 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个

Line 241 is modified:

pm.max_children = 50 // maximum idle to 50

[Root @ localhost etc] # / usr / local / sbin / php-fpm // start FPM

[root @ localhost etc] # netstat -anpt
0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 8709 / tcp PHP-FPM: FPM maste // will open a 9000 port

[root@localhost etc]# cd

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

Copy the code
#!/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
Copy the code

Guess you like

Origin www.cnblogs.com/L1-5551/p/11518452.html