集群:多台服务器在一起作同样的事
分布式 :多台服务器在一起作不同的事
常用架构
不管是C还是B,都是属于前端客户端
运维人员主要负责和管理的是server端,也统称为服务器端
最小化安装centOs6.9
安装vim
[root@server02 ~]# yum install -y vim
已加载插件:fastestmirror
设置安装进程
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
错误:Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
报错:Cannot retrieve repository metadata (repomd.xml) for repository: base.
原因:CentOS6已经在2020年11月30日停止维护了。centos官方停止了对centos6的所有更新,并且下架了包括官方所有的centos6源,目前阿里、163、清华等centos6源已无法使用
解决:如下
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vi /etc/yum.repos.d/CentOS-Base.repo
#编写
[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.10/os/x86_64/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6
yum list
yum install -y vim
配置vim
echo "set nu" >> /root/.vimrc
echo "set ts=4" >> /root/.vimrc
sed -i "8calias grep='grep --color'" /root/.bashrc
source /root/.bashrc
关闭防火墙
service iptables stop
chkconfig iptables off
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
修改主机名
vim /etc/sysconfig/network
#修改为
HOSTNAME=server01
su
域名解析
vim /etc/hosts
#追加
192.168.139.128 server01.lnmp.com server01
时间同步
yum -y install ntp
service ntpd start
chkconfig ntpd on
ntpdate cn.ntp.org.cn
编译参数的说明
编译参数 | 说明 |
---|---|
-DCMAKE_INSTALL_PREFIX | 安装到的软件目录 |
-DMYSQL_DATADIR | 数据文件存储的路径 |
-DSYSCONFDIR | 配置文件路径 (my.cnf) |
-DENABLED_LOCAL_INFILE=1 | 使用localmysql客户端的配置 |
-DWITH_PARTITION_STORAGE_ENGINE | 使mysql支持分表 |
-DEXTRA_CHARSETS | 安装支持的字符集 |
-DDEFAULT_CHARSET | 默认字符集使用 这里配置为utf8mb4 |
-DDEFAULT_COLLATION | 连接字符集 |
-DWITH_SSL | 开启mysql的ssl使用 |
初始化参数说明
初始化参数 | 说明 |
---|---|
–basedir | 安装到的软件目录 |
–datadir | 数据文件存储路径 |
–user | mysql使用的用户 |
脚本安装及其初始化
[root@server01 ~]# yum install -y lrzsz
[root@server01 ~]# mkdir /root/soft
[root@server01 ~]# cd /root/soft
[root@server01 soft]# rz
#传入mysql-5.6.33.tar.gz软件包
[root@server01 ~]# vim mysql_install.sh
#!/bin/bash
#源码编译安装MySQL
mysql_install() {
#1、创建用户
`id mysql` &>/dev/null
[ $? -ne 0 ] && useradd -s /sbin/nologin -M mysql
#2、解决依赖
yum install -y cmake ncurses-devel
#3、编译安装
cd /root/soft
tar zxvf mysql-5.6.33.tar.gz
cd mysql-5.6.33
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DWITH_SSL=bundled
make && make install
#配置文件
rm -rf /etc/my.cnf
cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
#授权并初始化数据库
chown -R mysql:mysql /usr/local/mysql
/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
#配置服务、自启动和环境变量
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
service mysqld start
chkconfig --add mysqld
echo 'PATH=/usr/local/mysql/bin:$PATH' >> /etc/profile
source /etc/profile
#删除匿名用户
#设置root域名的密码
rpm -qa|grep expect
if [ $? -ne 0 ];then
yum -y install expect
fi
#导入环境变量PATH
export PATH=/usr/local/mysql/bin:$PATH
#初始化root密码 删除匿名用户
echo '#!/usr/bin/expect
set timeout 60
spawn mysql_secure_installation
expect {
"enter for none" { send "\r"; exp_continue}
"Y/n" { send "Y\r" ; exp_continue}
"password" { send "123456\r"; exp_continue}
"Cleaning up" { send "\r"}
}
interact ' > mysql_secure_installation.exp
chmod +x mysql_secure_installation.exp
./mysql_secure_installation.exp
}
#脚本开始时间
start_time=`date +%s`
#执行的脚本代码
mysql_install
#脚本结束时间
end_time=`date +%s`
#脚本执行花费时间
const_time=$((end_time-start_time))
echo 'Take time is: '$const_time's'
[root@server01 ~]# sh mysql_install.sh
http://nginx.org/
同类的web服务器软件:apache,nginx(俄罗斯),IIS(微软 fastcgi),lighttpd(德国)
参数 | 作用 |
---|---|
–prefix | 编译安装到的软件目录 |
–user | worker进程运行用户 |
–group | worker进程运行用户组 |
–with-http_ssl_module | 支持https,需要pcel-devel依赖 |
–with-http_stub_status_module | 基本状态信息显示,查看请求数、连接数等 |
–with-http_realip_module | 定义客户端地址和端口为header头信息 用于反向代理后的真实IP获取 |
[root@server01 ~]# cd /root/soft/
[root@server01 soft]# rz
#传入下载好的 nginx-1.14.2软件包
[root@server01 soft]# tar -xzf nginx-1.14.2.tar.gz
[root@server01 soft]# ls
mysql-5.6.33 mysql_secure_installation.exp nginx-1.14.2.tar.gz
mysql-5.6.33.tar.gz nginx-1.14.2
[root@server01 nginx-1.14.2]# useradd -s /sbin/nologin -M www
[root@server01 nginx-1.14.2]# ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module
报错:./configure: error: the HTTP rewrite module requires the PCRE library.
原因:缺少pcre-devel依赖库
解决:yum install -y pcre-devel
[root@server01 nginx-1.14.2]# yum install -y pcre-devel
[root@server01 nginx-1.14.2]# ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module
报错:./configure: error: SSL modules require the OpenSSL library.
原因:缺少openssl-devel依赖库
解决:yum install -y openssl-devel
[root@server01 nginx-1.14.2]# yum install -y openssl-devel
[root@server01 nginx-1.14.2]# ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ using system zlib library
[root@server01 nginx-1.14.2]# make && make install
[root@server01 nginx-1.14.2]# cd /usr/local/nginx/
[root@server01 nginx]# pwd
/usr/local/nginx
脚本安装(提前将软件包下载到/root/soft):
#!/bin/bash #编译安装Nginx nginx_install(){ #创建软件运行用户 `id www` &>>/dev/null if [ $? -ne 0 ];then useradd -s/sbin/nologin -M www fi #安装依赖 yum -y install pcre-devel zlib-devel openssl-devel #编译安装 cd /root/soft tar xvf nginx-1.14.2.tar.gz cd nginx-1.14.2 ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module && make && make install } #脚本开始时间 start_time=`date +%s` #执行的脚本代码 nginx_install #脚本结束时间 end_time=`date +%s` #脚本执行花费时间 const_time=$((end_time-start_time)) echo 'Take time is: '$const_time's'
[root@server01 nginx-1.14.2]# cd /usr/local/nginx/
[root@server01 nginx]# ls
conf html logs sbin
[root@server01 nginx]# cd sbin/
[root@server01 sbin]# ls
nginx
目录 | 作用 |
---|---|
conf | 配置文件 |
html | 网站根目录 |
logs | 日志 |
sbin | 可执行文件 [软件的启动,停止,重启等] |
启动nginx
[root@server01 sbin]# ./nginx
[root@server01 sbin]# ss -tnalp|grep nginx
LISTEN 0 128 *:80 *:* users:(("nginx",34295,6),("nginx",34296,6))
[root@server01 sbin]# ps -ef |grep nginx
root 34295 1 0 17:57 ? 00:00:00 nginx: master process ./nginx
www 34296 34295 0 17:57 ? 00:00:00 nginx: worker process
root 34304 3419 0 17:57 pts/0 00:00:00 grep --color nginx
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-pvRlavDz-1633274276799)(…/%E5%9B%BE%E7%89%87%E6%94%BE%E7%BD%AE%E7%82%B9/image-20211002180101979.png)]
参数介绍(#后面的了解即可,不常用)
[root@server01 sbin]# ./nginx -h
nginx version: nginx/1.14.2
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-h : this help 帮助
-v : show version and exit #版本查看
-V : show version and configure options then exit查看版本和配置选项
-t : test configuration and exit 检测配置文件语法
-T : test configuration, dump it and exit
-q : suppress non-error messages during configuration testing #在配置测试期间禁止显示非错误信息
-s signal : send signal to a master process: stop, quit, reopen, reload stop强制退出 quit优雅的退出 reopen重开日志 reload重载配置
-p prefix : set prefix path (default: /usr/local/nginx/) #设置nginx目录
-c filename : set configuration file (default: conf/nginx.conf) #指定启动使用的配置文件
-g directives : set global directives out of configuration file
服务配置
[root@server01 ~]# cd /etc/init.d/
[root@server01 init.d]# rz
#传入已经下载的nginx脚本
[root@server01 init.d]# chmod +x nginx
开启
[root@server01 init.d]# service nginx start
[root@server01 init.d]# chkconfig --add nginx
[root@server01 init.d]# chkconfig nginx on
PHP: Hypertext Preprocessor,超文本预处理器
页面分类:
静态页面 一般普通访问到的页面
动态页面 用户可以和服务器进行交互页面
执行动态页面,需要和服务器进行交互,使用后端语言进行开发,php可实现该功能
PHP是一种通用开源脚本语言,混合了C、Java、Perl以及PHP自创的语法,主要适用于Web开发
PHP是将程序嵌入到HTML(标准通用标记语言下的一个应用)文档中去执行,执行效率比完全生成HTML标记的CGI要高许多
PHP还可以执行编译后代码,编译可以达到加密和优化代码运行,使代码运行更快
PHP-FPM(FastCGI Process Manager:FastCGI进程管理器)。PHP-FPM提供了更好的PHP进程管理方式,可以有效控制内存和进程、可以平滑重载PHP配置,在./configure的时候带 –enable-fpm参数即可开启PHP-FPM
[root@server01 init.d]# cd /root/soft/
[root@server01 soft]# rz
[root@server01 soft]# ls
mysql-5.6.33 mysql-5.6.33.tar.gz mysql_secure_installation.exp nginx-1.14.2 nginx-1.14.2.tar.gz php-7.2.12.tar.gz
[root@server01 soft]# tar -xzf php-7.2.12.tar.gz
[root@server01 soft]# cd php-7.2.12
解决依赖(可忽略下文因依赖报错的部分)
[root@server01 php-7.2.12]# yum -y install libxml2-devel libjpeg-devel libpng-devel freetype-devel curl-devel openssl-devel
配置
[root@server01 php-7.2.12]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --with-libzip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
报错:configure: error: libxml2 not found. Please check your libxml2 installation.
原因:缺少依赖库libxml2
解决:yum install -y libxml2-devel
[root@server01 php-7.2.12]# yum install -y libxml2-devel
[root@server01 php-7.2.12]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --with-libzip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
报错:configure: error: cURL version 7.10.5 or later is required to compile php with cURL support
原因:缺少curl依赖库
解决:yum install -y curl-devel
[root@server01 php-7.2.12]# yum install -y curl-devel
[root@server01 php-7.2.12]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --with-libzip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
报错:configure: error: jpeglib.h not found.
原因:缺少libjpeg依赖库
解决:yum install -y libjpeg-devel
[root@server01 php-7.2.12]# yum install -y libjpeg-devel
[root@server01 php-7.2.12]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --with-libzip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
报错:configure: error: png.h not found.
原因:缺少libpng依赖库
解决:yum install -y libpng-devel
[root@server01 php-7.2.12]# yum install -y libpng-devel
[root@server01 php-7.2.12]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --with-libzip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
报错:configure: error: freetype-config not found.
原因:缺少freetype依赖库
解决:yum install -y freetype-devel
[root@server01 php-7.2.12]# yum install -y freetype-devel
[root@server01 php-7.2.12]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --with-libzip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
编译安装
[root@server01 php-7.2.12]# make && make install
[root@server01 php-7.2.12]# cd /usr/local/php/
[root@server01 php]# ls
bin etc include lib php sbin var
目录名称 | 作用 |
---|---|
bin | php相关命令目录,php 、phpize、php-config在源码编译扩展时用 |
etc | 配置文件 |
include | php默认类库 |
lib | php第三方扩展类库 |
php | man文档文件 |
sbin | php-fpm执行文件 |
var | log日志目录 ;run运行目录 ;保存pid文件 |
使配置文件生效
[root@server01 php]# cd etc
[root@server01 etc]# ls
php-fpm.conf.default php-fpm.d
[root@server01 etc]# cp php-fpm.conf.default php-fpm.conf
[root@server01 etc]# cp php-fpm.d/www.conf.default php-fpm.d/www.conf
[root@server01 etc]# ls
php-fpm.conf php-fpm.conf.default php-fpm.d
[root@server01 etc]# cp /root/soft/php-7.2.12/php.ini-development /usr/local/php/etc/php.ini
#配置文件说明
php.ini 默认php配置文件
php-fpm.conf php-fpm相关的配置
启动php
[root@server01 etc]# cd ../sbin/
[root@server01 sbin]# ./php-fpm
选项说明
[root@server01 sbin]# ./php-fpm -h
Usage: php-fpm [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p ] [-g ] [-c ] [-d foo[=bar]] [-y ] [-D] [-F [-O]]
-c | Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-h This help
-i PHP information
-m Show compiled in modules
-v Version number
-p, --prefix <dir>
Specify alternative prefix path to FastCGI process manager (default: /usr/local/php).
-g, --pid
Specify the PID file location.
-y, --fpm-config
Specify alternative path to FastCGI process manager config file.
-t, --test Test FPM configuration and exit
-D, --daemonize force to run in background, and ignore daemonize option from config file
-F, --nodaemonize
force to stay in foreground, and ignore daemonize option from config file
-O, --force-stderr
force output to stderr in nodaemonize even if stderr is not a TTY
-R, --allow-to-run-as-root
Allow pool to run as root (disabled by default)
添加到启动服务中
[root@server01 php-7.2.12]# cp /root/soft/php-7.2.12/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@server01 php-7.2.12]# chmod +x /etc/init.d/php-fpm
[root@server01 php-7.2.12]# chkconfig --add php-fpm
[root@server01 php-7.2.12]# chkconfig --list
添加环境变量
[root@server01 php-7.2.12]# echo 'PATH=/usr/local/php/bin:$PATH' >> /etc/profile
[root@server01 php-7.2.12]# source /etc/profile
上述步骤均可使用脚本代替
#!/bin/bash php_install(){ #php编译安装 #和nginx使用相同的用户,如果没有就创建 `id www` &> /dev/null [ $? -ne 0 ] && useradd -s /sbin/nologin -M www #解决依赖 yum -y install libxml2-devel libjpeg-devel libpng-devel freetype-devel curl-devel openssl-devel #解压 tar xvf php-7.2.12.tar.gz cd php-7.2.12 #编译安装php ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --with-libzip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts && make && make install #配置文件初始化 cp php.ini-development /usr/local/php/etc/php.ini #php-fpm服务配置文件 cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf #php-fpm服务子配置文件 cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf #配置服务及其环境变量 cp /root/soft/php-7.2.12/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm chmod +x /etc/init.d/php-fpm service php-fpm start chkconfig --add php-fpm echo 'PATH=/usr/local/php/bin:$PATH' >> /etc/profile } #脚本开始时间 start_time=`date +%s` #执行的脚本代码 php_install #脚本结束时间 end_time=`date +%s` #脚本执行花费时间 const_time=$((end_time-start_time)) echo 'Take time is: '$const_time's'
编写测试文件
[root@server01 php-7.2.12]# vim /usr/local/nginx/html/index.php
();
修改配置文件
[root@server01 php-7.2.12]# vim /usr/local/nginx/conf/nginx.conf
41 #access_log logs/host.access.log main;
42 root html; 第一步:把root变量提升上层
43 location / {
44 #root html; 这里的root需要被注释掉
45 index index.html index.htm;
46 }
47
48 #error_page 404 /404.html;
49
50 # redirect server error pages to the static page /50x.html
51 #
52 error_page 500 502 503 504 /50x.html;
53 location = /50x.html {
54 root html;
55 }
56
57 # proxy the PHP scripts to Apache listening on 127.0.0.1:80
58 #
59 #location ~ \.php$ {
60 # proxy_pass http://127.0.0.1;
61 #}
62
63 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
64 #
65 location ~ \.php$ {
第二步:该段解注释
66 # root html; 默认使用上层的root变量,这里也要注释掉
67 fastcgi_pass 127.0.0.1:9000;
68 fastcgi_index index.php;
69 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 第三步:把script修改为$document_root
70 include fastcgi_params;
71 } 注意,不要忘记最后这个括号
72
root@server01 php-7.2.12]# service nginx configtest
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@server01 php-7.2.12]# service nginx reload
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
重新载入 nginx: [确定]
测试