12.1 Lnmp Architecture Introduction
12.2 MySQL Installation
Go to download catalogue CD/USR/LOCAL/SRC
View the files that have been downloaded LS
To see if a process is running PS aux | grep MySQL
Remove the installation directory Rm-rf/usr/local/mysql
Delete Service Rm-rf/etc/init.d/mysqld
Modify the configuration file vim/etc/my.cnf//Do not modify, reserved;
Go to download catalogue CD/USR/LOCAL/SRC
Wgethttp: //mirrors.sohu.com/mysql/mysql-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
Tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
MV Mysql-5.6.36-linux-glibc2.5-x86_64/usr/local/mysql
Cd/usr/local/mysql
Useradd MySQL//Add user, previously added, can view #id MySQL, list off #rm-rf/data/mysql/*;
mkdir/data/
./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
CP SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF//or modify MY.CNF document (Datadir=/data/mysql,socket=/tmp/mysql.sock)
CP Support-files/mysql.server/etc/init.d/mysqld
VIM/ETC/INIT.D/MYSQLD//Definition Basedir and DataDir, (Basedir=/usr/local/mysql,datadir=/data/mysql)
/etc/init.d/mysqld start
PS aux | grep MySQL
Chkconfig--add mysqld//Add to boot startup item
Chkconfig mysqld on
Service Mysqld Stop
Service mysqld Start
PS aux | grep MySQL
12.3/12.4 PHP Installation
cd/usr/local/src/
Useradd-s/sbin/nologin PHP-FPM
CD php-5.6.30/
#make clean//The previously compiled file is deleted
./configure--prefix=/usr/local/php-fpm--with-config-file-path=/usr/local/php-fpm/etc--ENABLE-FPM-- WITH-FPM-USER=PHP-FPM--with-fpm-group=php-fpm--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/ Mysql_config--with-pdo-mysql=/usr/local/mysql--with-mysql-sock=/tmp/mysql.sock--with-libxml-dir--WITH-GD-- With-jpeg-dir--with-png-dir--with-freetype-dir--with-iconv-dir--with-zlib-dir--with-mcrypt--enable-soap-- Enable-gd-native-ttf--enable-ftp--enable-mbstring--enable-exif--with-pear--with-curl--with-openssl//Less curl, Install the Yum install libcurl-devel-y, install and then configure
Make && make install
ls/usr/local/php-fpm/sbin/
/usr/local/php-fpm/sbin/php-fpm-m
/usr/local/php-fpm/sbin/php-fpm-i
/USR/LOCAL/PHP-FPM/SBIN/PHP-FPM-T//Test PHP file syntax
CP Php.ini-production/usr/local/php-fpm/etc/php.ini
vi/usr/local/php/etc/php-fpm.conf//write the following (refer to https://coding.net/u/aminglinux/p/aminglinux-book/git/blob/master/ d15z/php-fpm.conf)
[Global]
pid = /usr/ Local /php-fpm/ var /run/ Php-fpm.pid
Error_log = /usr/ Local /php-fpm/ var /log/ Php-fpm.log
[WWW]
Listen = /tmp/ Php-fcgi.sock
Listen.mode = 666
user = PHP-FPM
Group = PHP-FPM
PM = dynamic
Pm.max_children = -
pm.start_servers = -
pm.min_spare_servers = 5
pm.max_spare_servers = *
pm.max_requests = -
rlimit_files = 1024x768
Write the above content;
CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM//Startup script
chmod 755/etc/init.d/php-fpm
Chkconfig--add PHP-FPM
Chkconfig PHP-FPM on
Service PHP-FPM Start
PS aux | grep php-fpm
12.5 Nginx Introduction
Extended
Why Nginx is more efficient than Apache httpd: Principle Article http://www.toxingwang.com/linux-unix/linux-basic/1712.html
Apache and Nginx working principle comparison http://www.server110.com/nginx/201402/6543.html
Comparison of mod_php and mod_fastcgi and PHP-FPM http://dwz.cn/1lwMSd
Concept understanding: cgi,fastcgi,php-cgi and Php-fpmhttp://www.nowamagic.net/librarys/veda/detail/1319/https://www.awaimai.com/371.html
Linux Study Notes 12 week lesson (April 23)