1. 程式人生 > >12.1 LNMP架構介紹12.2 MySQL安裝12.3/12.4 PHP安裝12.5 Nginx

12.1 LNMP架構介紹12.2 MySQL安裝12.3/12.4 PHP安裝12.5 Nginx

12.1 LNMP架構介紹12.2 My

12.1 LNMP架構介紹

技術分享圖片

13.12.2 MySQL安裝

技術分享圖片

[root@martin001 ~]# service mysql stop
Redirecting to /bin/systemctl stop mysql.service
[root@martin001 ~]# ps -aux |grep mysql
root 1064 0.0 0.0 112676 956 pts/0 S+ 23:07 0:00 grep --color=auto mysql
[root@martin001 ~]# rm -rf /usr/local/mysql
[root@martin001 ~]# rm -rf /etc/init.d/mysqld

[root@martin001 mysql]# cp support-files/my-default.cnf /etc/my.cnf
[root@martin001 mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@martin001 mysql]# vi /etc/init.d/mysqld
技術分享圖片
[root@martin001 mysql]# /etc/init.d/mysqld start
Starting MySQL... SUCCESS!
[root@martin001 mysql]# ps -aux | grep mysql
root 1193 0.0 0.1 113264 1560 pts/0 S 23:26 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/martin001.pid
mysql 1302 0.9 44.9 973056 449444 pts/0 Sl 23:26 0:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql/martin001.err --pid-file=/data/mysql/martin001.pid
root 1377 0.0 0.0 112676 956 pts/0 S+ 23:29 0:00 grep --color=auto mysql

[root@martin001 mysql]# chkconfig --add mysqld
[root@martin001 mysql]# chkconfig mysqld on
[root@martin001 mysql]# service mysqld stop
Shutting down MySQL.. SUCCESS!
[root@martin001 mysql]# service mysqld start
Starting MySQL.. SUCCESS!

14.12.3/12.4 PHP安裝

技術分享圖片

技術分享圖片

[root@martin001 php-5.6.30]# ls /usr/local/php-fpm
bin etc include lib php sbin var
[root@martin001 php-5.6.30]# ls /usr/local/php
bin etc include lib php
[root@martin001 php-5.6.30]# ls /usr/local/php7
bin etc include lib php var
[root@martin001 php-5.6.30]# useradd php-fpm
[root@martin001 php-5.6.30]# cp php.ini-production /usr/local/php-fpm/etc/php.ini

[root@martin001 init.d]# chmod 755 /etc/init.d/php-fpm
[root@martin001 init.d]# chkconfig --add php-fpm
[root@martin001 init.d]# chkconfig php-fpm on
[root@martin001 init.d]# service php-fpm start
Starting php-fpm done
[root@martin001 init.d]# ps -aux |grep php-fpm
root 117430 0.1 0.4 123612 4912 ? Ss 00:50 0:00 php-fpm: master process (/usr/local/php-fpm/etc/php-fpm.conf)
php-fpm 117431 0.0 0.4 123612 4700 ? S 00:50 0:00 php-fpm: pool www
php-fpm 117432 0.0 0.4 123612 4700 ? S 00:50 0:00 php-fpm: pool www
php-fpm 117433 0.0 0.4 123612 4700 ? S 00:50 0:00 php-fpm: pool www
php-fpm 117434 0.0 0.4 123612 4700 ? S 00:50 0:00 php-fpm: pool www

15.12.5 Nginx介紹

技術分享圖片

12.1 LNMP架構介紹12.2 MySQL安裝12.3/12.4 PHP安裝12.5 Nginx