12.1 Lnmp Architecture Introduction 12.2 mysql installation 12.3/12.4 PHP installation 12.5 Nginx Introduction

Source: Internet
Author: User
Tags chmod create directory curl fpm soap openssl pear sapi

Nginx Design is designed to provide a fast, efficient, multi-concurrent Web services software. In the static page processing, Nginx is better than Apache, but in the dynamic page processing, Nginx does not have an advantage over Apache.

[[Email protected] src]# PS aux|grep mysql check MySQL service has no boot, if please stop service, s Ervice MySQL Stop
Root 5035 0.0 0.0 112676 980 pts/0 r+ 18:22 0:00 grep--color=auto MySQL

[Email protected] src]# Rm-rf/usr/local/mysql
[[email protected] src]# Rm-rf/etc/init.d/mysqld Delete startup script

[[email protected] src]# VIM/ETC/MY.CNF configuration temporarily reserved

[[email protected] src]# pwd                        &N Bsp                          ,         &NB Sp                   to enter the catalogue
/USR/LOCAL/SRC
[[email protected] src]# WG ET ....^c                                and nbsp                          ,         WGE T download package
[[email protected] src]# tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz        Unzip

[[email protected] src]# mv mysql-5.6.36-linux-glibc2.5-x86_64/usr/local/        change name, Make sure that the MySQL
apache2/apr/bin/games/lib/libexec/php/sbin/src/
Apache2.4/apr-util/etc/include/lib64/maria not appear Db/php7/share/
[[email protected] src]# MV mysql-5.6.36-linux-glibc2.5-x86_64/usr/local/mysql        Change the name to make sure that the MySQL
[[email protected] src]# ls/usr/local/mysql/
Bin COPYING data docs include is not present Lib man mysql-test README scripts share Sql-bench support-files

[[email protected] mysql]# ls/data/                      & nbsp                          ,         &NB Sp       Create directory, previously created
mariadb mysql wwwroot
[[email protected] mysql]# ID mysql                             ,         &NB Sp                           create user MySQL, previously created the
uid=1008 (my SQL) gid=1008 (MySQL) group =1008 (MySQL)

[[email protected] mysql]# ls
Bin COPYING data docs include Lib man mysql-test README scripts share Sql-bench support-files
[[email protected] mysql]# rm-rf/data/mysql/* to empty the contents of MySQL.

[Email protected] mysql]#/scripts/mysql_install_db--user=mysql--datadir=/data/mysql

[[email protected] mysql]# echo $?
0

Editing a configuration file

[[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld copy startup script

[Email protected] mysql]# Vim/etc/init.d/mysqld

[[email protected] mysql]# chkconfig--add mysqld mysqld Join the list of services
[[email protected] mysql]# chkconfig mysqld on Boot
[[Email protected] mysql]# service MySQL stop
Redirecting To/bin/systemctl Stop Mysql.service
[[Email protected] mysql]# service mysqld stop
Shutting down MySQL. success!
[[Email protected]nglinux01 mysql]# service mysqld start
Starting MySQL. success!

[[email protected] src]# cd php-5.6.30/
[[email protected] php-5.6.30]# pwd
/usr/local/src/ php-5.6.30
[[email protected] php-5.6.30]# make clean                &NBS P     All previously compiled files erase
find.-name \*.gcno-o-name \*.gcda | xargs rm-f
Find-name \*.lo-o-name \*.o | xa RGS rm-f
Find-name \*.la-o-name \*.a | xargs rm-f
Find.-name \*.so | xargs rm-f
Find-name. libs-a -type D|xargs rm-rf
rm-f libphp5.la sapi/cli/php sapi/cgi/php-cgi libphp5.la modules/* libs/*      &NB Sp       After deletion is in the state of just decompression, then compile the PHP

for Nginx

[Email protected] php-5.6.30]#/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

Checking for curl in default path ... not found installation error, less CURL
Configure:error:Please Reinstall the Libcurl distribution-
Easy.h should is in <curl-dir>/include/curl/

[email protected] php-5.6.30]# Yum install Libcurl-devel

[Email protected] php-5.6.30]#/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, go again.

[[email protected] php-5.6.30]# make && make install

[[email protected] php-5.6.30]# ls/usr/local/php-fpm/more than the original PHP a Sbin,var
Bin etc include Lib Php sbin var

[Email protected] php-5.6.30]# ls/usr/local/php/
Bin etc include Lib Php

[[email protected] php-5.6.30]#/usr/local/php-fpm/sbin/php-fpm-t Check for errors
[10-mar-2018 21:05:12] error:failed to open configuration file '/usr/local/php-fpm/etc/php-fpm.conf ': No such file or directory (
[10-mar-2018 21:05:12] error:failed to load configuration file '/usr/local/php-fpm/etc/php-fpm.conf '
[10-mar-2018 21:05:12] ERROR:FPM initialization failed
[Email protected] php-5.6.30]# ls/usr/local/php
php/php7/php-fpm/
[Email protected] php-5.6.30]# ls/usr/local/php-fpm/etc/
Pear.conf Php-fpm.conf.default

[[email protected] php-5.6.30]# CP Php.ini-production/usr/local/php-fpm/etc/php.ini copied past and renamed to PHP.ini

[[email protected] etc]# ls
pear.conf Php-fpm.conf.default php.ini

[Email protected] etc]# vim php-fpm.conf

[Global] Parameters
PID =/usr/local/php-fpm/var/run/php-fpm.pid
Error_log =/usr/local/php-fpm/var/log/php-fpm.log
[www] Module name
Listen =/tmp/php-fcgi.sock Listener Address

#listen = 127.0.0.1:9000
Listen.mode = 666 The statement takes effect when the socket is being monitored

user = PHP-FPM
Group = PHP-FPM
PM = dynamic
Pm.max_children = 50
Pm.start_servers = 20
Pm.min_spare_servers = 5
Pm.max_spare_servers = 35
Pm.max_requests = 500
Rlimit_files = 1024

[Email protected] etc]# cd/usr/local/src/php
php-5.6.30/php-7.1.6/phpredis-develop/
[[email protected] etc]# cd/usr/local/src/php-5.6.30/into the source directory, copy the startup script
[email protected] php-5.6.30]# CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM

[Email protected] php-5.6.30]# chmod 755/etc/init
Init.d/inittab
[Email protected] php-5.6.30]# chmod 755/etc/init.d/php-fpm
[Email protected] php-5.6.30]# chkconfig--add php-fpm
[Email protected] php-5.6.30]# chkconfig php-fpm on
[[Email protected] php-5.6.30]# Service PHP-FPM start failed because there is a user that does not exist
Starting PHP-FPM [10-mar-2018 21:49:01] ERROR: [Pool www] cannot get uid for user ' php-fpm '
[10-mar-2018 21:49:01] ERROR:FPM initialization failed

Failed

[Email protected] php-5.6.30]# Useradd PHP-FPM
[[Email protected] php-5.6.30]# service PHP-FPM start
Starting php-fpm Done
[[Email protected] php-5.6.30]# PS aux |grep php-fpm

[Email protected] php-5.6.30]# ls-l/tmp/php-fcgi.sock
Srw-rw-rw-1 root root 0 March 21:50/tmp/php-fcgi.sock 666

12.1 Lnmp Architecture Introduction 12.2 mysql installation 12.3/12.4 PHP installation 12.5 Nginx Introduction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.