{"id":2017,"date":"2023-01-18T09:47:09","date_gmt":"2023-01-18T01:47:09","guid":{"rendered":"https:\/\/blog.kingsbestone.com\/?p=2017"},"modified":"2023-01-18T17:22:10","modified_gmt":"2023-01-18T09:22:10","slug":"centos8%e6%89%8b%e5%8a%a8%e5%ae%89%e8%a3%85lnmpphpmyadmin","status":"publish","type":"post","link":"https:\/\/blog.kingsbestone.com\/?p=2017","title":{"rendered":"Centos8\u624b\u52a8\u5b89\u88c5LNMP+phpmyadmin"},"content":{"rendered":"<p><span style=\"font-family: 'comic sans ms', sans-serif;\">LNMP = Linux+NGINX+MySQL+PHP<\/span><\/p>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">phpMyAdmin\uff08MySQL\u7684\u7ba1\u7406web\u9875\u9762\uff09<\/span><\/p>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">1.\u51c6\u5907\u5b89\u88c5\u73af\u5883<\/span><\/h1>\n<hr \/>\n<h2><span style=\"font-family: 'comic sans ms', sans-serif;\">1-2.\u6362DNF\u6e90\u548cEPEL\u6269\u5c55\u6e90<\/span><\/h2>\n<hr \/>\n<h2><span style=\"font-family: 'comic sans ms', sans-serif;\">1-3.\u5173\u95edSELinux<\/span><\/h2>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-3-1.\u67e5\u770b\u672c\u5730SELinux\u662f\u5426\u4e3a\u5f00\u542f\u72b6\u6001<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">getenforce\r\n\r\n#\u5982\u679c\u63d0\u793aEnforcing\u5219\u8868\u793aSELinux\u4e3a\u5f00\u542f\u72b6\u6001\u3002\r\n#\u5982\u679c\u63d0\u793aDisabled\u5219\u8868\u793aSELinux\u4e3a\u5173\u95ed\u72b6\u6001\u3002<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-3-2.\u8fdb\u5165SELinux\u914d\u7f6e\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">vi \/etc\/selinux\/config<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-3-3.\u5173\u95edSELinux\uff0c\u6309\u7167\u5982\u4e0b\u547d\u4ee4\u4fee\u6539<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\"># This file controls the state of SELinux on the system.\r\n# SELINUX= can take one of these three values:\r\n#     enforcing - SELinux security policy is enforced.\r\n#     permissive - SELinux prints warnings instead of enforcing.\r\n#     disabled - No SELinux policy is loaded.\r\nSELINUX=disabled\r\n# SELINUXTYPE= can take one of these three values:\r\n#     targeted - Targeted processes are protected,\r\n#     minimum - Modification of targeted policy. Only selected processes are protected. \r\n#     mls - Multi Level Security protection.\r\nSELINUXTYPE=targeted\r\n\r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-3-4.\u91cd\u542f\u7cfb\u7edf<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">shutdown -r now<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-3-5.\u91cd\u65b0\u67e5\u770bSELinux\u662f\u5426\u5173\u95ed\u6210\u529f<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">getenforce\r\n\r\n#\u5982\u679c\u63d0\u793aEnforcing\u5219\u8868\u793aSELinux\u4e3a\u5f00\u542f\u72b6\u6001\u3002 \r\n#\u5982\u679c\u63d0\u793aDisabled\u5219\u8868\u793aSELinux\u4e3a\u5173\u95ed\u72b6\u6001\u3002<\/pre>\n<hr \/>\n<h2><span style=\"font-family: 'comic sans ms', sans-serif;\">1-4.\u5173\u95ed\u9632\u706b\u5899<\/span><\/h2>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-4-1.\u67e5\u770b\u7cfb\u7edf\u9632\u706b\u5899\u8fd0\u884c\u72b6\u6001<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl status firewalld.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-4-2.\u5173\u95ed\u9632\u706b\u5899<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl stop firewalld.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-4-3.\u91cd\u65b0\u67e5\u770b\u9632\u706b\u5899\u8fd0\u884c\u72b6\u6001<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl status firewalld.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">1-4-4.\u5173\u95ed\u9632\u706b\u5899\u5f00\u673a\u81ea\u542f\u52a8<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl disable firewalld.service<\/pre>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">2.\u5b89\u88c5NGINX<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-1.\u521b\u5efaNGINX\u7684\u6e90\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">vi \/etc\/yum.repos.d\/nginx.repo<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-2.\u628a\u4e0b\u9762\u5185\u5bb9\u6dfb\u52a0\u8fdb\u53bb<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[nginx-stable]\r\nname=nginx stable repo\r\nbaseurl=http:\/\/nginx.org\/packages\/centos\/$releasever\/$basearch\/\r\ngpgcheck=1\r\nenabled=1\r\ngpgkey=https:\/\/nginx.org\/keys\/nginx_signing.key\r\nmodule_hotfixes=true\r\n\r\n[nginx-mainline]\r\nname=nginx mainline repo\r\nbaseurl=http:\/\/nginx.org\/packages\/mainline\/centos\/$releasever\/$basearch\/\r\ngpgcheck=1\r\nenabled=0\r\ngpgkey=https:\/\/nginx.org\/keys\/nginx_signing.key\r\nmodule_hotfixes=true<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-3.\u6e05\u7406\u5e76\u91cd\u65b0\u751f\u6210dnf\u7f13\u5b58<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf clean all &amp;&amp; dnf makecache<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-4.\u67e5\u770bNGINX\u53ef\u5b89\u88c5\u7248\u672c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf --showduplicates search nginx<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-5.\u9009\u62e9NGINX\u7684\u7248\u672c\uff0c\u5e76\u5b89\u88c5\uff08\u8fd9\u91cc\u4ee5\u6700\u65b0\u7248\u672c\u4e3a\u4f8b\uff09<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf install -y nginx-1:1.22.1-1.el8.ngx.x86_64<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">2-6.\u67e5\u770bNGINX\u7248\u672c\uff0c\u68c0\u67e5NGINX\u662f\u5426\u5b89\u88c5\u6210\u529f<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">nginx -v<\/pre>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">3.\u5b89\u88c5MYSQL<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-1.\u521b\u5efaMYSQL\u7684\u6e90\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">vi \/etc\/yum.repos.d\/mysql-community.repo<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-2.\u628a\u4e0b\u9762\u5185\u5bb9\u6dfb\u52a0\u8fdb\u53bb<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[mysql80-community]\r\nname=MySQL 8.0 Community Server\r\nbaseurl=http:\/\/repo.mysql.com\/yum\/mysql-8.0-community\/el\/8\/$basearch\/\r\nenabled=1\r\ngpgcheck=0\r\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql-2022\r\n       file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql\r\n     \r\n[mysql57-community]\r\nname=MySQL 5.7 Community Server\r\nbaseurl=http:\/\/repo.mysql.com\/yum\/mysql-5.7-community\/el\/7\/$basearch\/\r\nenabled=1\r\ngpgcheck=0\r\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql-2022\r\n       file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql\r\n\r\n[mysql56-community]\r\nname=MySQL 5.6 Community Server\r\nbaseurl=http:\/\/repo.mysql.com\/yum\/mysql-5.6-community\/el\/7\/$basearch\/\r\nenabled=1\r\ngpgcheck=0\r\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql-2022\r\n       file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql\r\n     \r\n[mysql55-community]\r\nname=MySQL 5.5 Community Server\r\nbaseurl=http:\/\/repo.mysql.com\/yum\/mysql-5.5-community\/el\/7\/$basearch\/\r\nenabled=1\r\ngpgcheck=0\r\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql-2022\r\n       file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-mysql\r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-3.\u6e05\u7406\u5e76\u91cd\u65b0\u751f\u6210dnf\u7f13\u5b58<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf\u00a0clean\u00a0all\u00a0&amp;&amp;\u00a0dnf\u00a0makecache<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-4.\u5173\u95ed\u7cfb\u7edf\u9ed8\u8ba4\u6e90\u7684MYSQL<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf -y module disable mysql<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-5.\u67e5\u770bMYSQL\u53ef\u5b89\u88c5\u7248\u672c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf --showduplicates search mysql-community-server<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-6.\u9009\u62e9MYSQL\u7684\u7248\u672c\uff0c\u5e76\u5b89\u88c5\uff08\u8fd9\u91cc\u4ee5\u6700\u65b0\u7248\u672c\u4e3a\u4f8b\uff09<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf install -y mysql-community-server-8.0.31-1.el8.x86_64<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">3-7.\u67e5\u770bMYSQL\u7248\u672c\uff0c\u68c0\u67e5MYSQL\u662f\u5426\u5b89\u88c5\u6210\u529f<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">mysql -V<\/pre>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">4.\u5b89\u88c5PHP<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-1.\u6dfb\u52a0remi\u6e90\u4ed3\u5e93<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">rpm -ivh  https:\/\/rpms.remirepo.net\/enterprise\/remi-release-8.rpm --nodeps --force<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-2.\u6e05\u7406\u5e76\u91cd\u65b0\u751f\u6210dnf\u7f13\u5b58<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf clean all &amp;&amp; dnf makecache<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-3.\u641c\u7d22\u5e76\u67e5\u627e\u53ef\u5b89\u88c5\u7248\u672c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf --showduplicates list | grep ^php..\\.x86_64<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-4.\u641c\u7d22\u5e76\u67e5\u627e\u53ef\u5b89\u88c5\u7248\u672c\u7684\u5168\u79f0<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf --showduplicates search php  | awk  '\/Package that installs PHP\/{print}'<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-5.\u9009\u62e9PHP\u7684\u7248\u672c\uff0c\u5e76\u5b89\u88c5\uff08\u8fd9\u91cc\u4ee5\u6700\u65b0\u7248\u672c\u4e3a\u4f8b\uff09<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf install -y php82-8.2-2.el8.remi.x86_64<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">4-6.\u67e5\u770bPHP\u7248\u672c\uff0c\u68c0\u67e5PHP\u662f\u5426\u5b89\u88c5\u6210\u529f<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">php82 -v<\/pre>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">5.\u5b89\u88c5phpMyAdmin<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-1.\u6dfb\u52a0remi\u6e90\u4ed3\u5e93<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">rpm -ivh https:\/\/rpms.remirepo.net\/enterprise\/remi-release-8.rpm --nodeps --force<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-2.\u5f00\u542fremi\u4ed3\u5e93\u6e90<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf config-manager --set-enabled remi<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-3.\u6e05\u7406\u5e76\u91cd\u65b0\u751f\u6210dnf\u7f13\u5b58<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf clean all &amp;&amp; dnf makecache<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-4.\u67e5\u770b\u5e76\u5217\u51faphpmyadmin\u53ef\u5b89\u88c5\u7248\u672c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf --showduplicates list phpmyadmin<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-5.\u67e5\u770b\u5e76\u641c\u7d22phpmyadmin\u7684\u5168\u79f0<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf --showduplicates search phpmyadmin<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-6.\u5b89\u88c5phpmyadmin\uff08\u8fd9\u91cc\u4ee5\u6700\u65b0\u7248\u672c\u4e3a\u4f8b\uff09<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf install -y phpMyAdmin-5.1.4-1.el8.remi.noarch<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">5-7.\u67e5\u770bphpmyadmin\u7684\u7248\u672c\uff0c\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u6210\u529f<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">dnf info phpmyadmin<\/pre>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">6.\u914d\u7f6eNGINX<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-1.\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770bNginx\u914d\u7f6e\u6587\u4ef6\u7684\u9ed8\u8ba4\u8def\u5f84\u3002<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@localhost ~]# cat \/etc\/nginx\/nginx.conf\r\n\r\nuser  nginx;\r\nworker_processes  auto;\r\n\r\nerror_log  \/var\/log\/nginx\/error.log notice;\r\npid        \/var\/run\/nginx.pid;\r\n\r\n\r\nevents {\r\n    worker_connections  1024;\r\n}\r\n\r\n\r\nhttp {\r\n    include       \/etc\/nginx\/mime.types;\r\n    default_type  application\/octet-stream;\r\n\r\n    log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '\r\n                      '$status $body_bytes_sent \"$http_referer\" '\r\n                      '\"$http_user_agent\" \"$http_x_forwarded_for\"';\r\n\r\n    access_log  \/var\/log\/nginx\/access.log  main;\r\n\r\n    sendfile        on;\r\n    #tcp_nopush     on;\r\n\r\n    keepalive_timeout  65;\r\n\r\n    #gzip  on;\r\n\r\n    include \/etc\/nginx\/conf.d\/*.conf;\r\n}\r\n[root@localhost ~]# \r\n\r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-2.\u5728http\u62ec\u53f7\u5185\uff0cNGINX\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\u5373\u4e3a\uff0c\u4e0b\u9762\u4ee3\u7801\u4e2d\u6240\u793a\u7684<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">include \/etc\/nginx\/conf.d\/*.conf;<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-3.\u8fdb\u5165NGINX\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd \/etc\/nginx\/conf.d<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-4.\u5907\u4efd\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cp default.conf default.conf.bak<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-5.\u8fdb\u5165\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">vi default.conf<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-6.\u4fee\u6539\u5e76\u7f16\u8f91\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">server {\r\n    listen       80;\r\n    server_name  localhost;\r\n\r\n    #access_log  \/var\/log\/nginx\/host.access.log  main;\r\n\r\n    location \/ {\r\n        root   \/usr\/share\/nginx\/html;\r\n        index  index.html index.htm;\r\n    }\r\n\r\n    #error_page  404              \/404.html;\r\n\r\n    # redirect server error pages to the static page \/50x.html\r\n    #\r\n    error_page   500 502 503 504  \/50x.html;\r\n    location = \/50x.html {\r\n        root   \/usr\/share\/nginx\/html;\r\n    }\r\n\r\n    # proxy the PHP scripts to Apache listening on 127.0.0.1:80\r\n    #\r\n    #location ~ \\.php$ {\r\n    #    proxy_pass   http:\/\/127.0.0.1;\r\n    #}\r\n\r\n    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\r\n    #\r\n    #location ~ \\.php$ {\r\n    #    root           html;\r\n    #    fastcgi_pass   127.0.0.1:9000;\r\n    #    fastcgi_index  index.php;\r\n    #    fastcgi_param  SCRIPT_FILENAME  \/scripts$fastcgi_script_name;\r\n    #    include        fastcgi_params;\r\n    #}\r\n\r\n    # deny access to .htaccess files, if Apache's document root\r\n    # concurs with nginx's one\r\n    #\r\n    #location ~ \/\\.ht {\r\n    #    deny  all;\r\n    #}\r\n}\r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-7.\u4fee\u6539\u4e3a\u5982\u4e0b\u914d\u7f6e\u60c5\u51b5<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">server {\r\n    listen       80;\r\n    server_name  localhost;\r\n\r\n    #access_log  \/var\/log\/nginx\/host.access.log  main;\r\n\r\n    location \/ {\r\n        #\u5c06\u4e0b\u9762\u8def\u5f84\u4fee\u6539\u4e3a\u7f51\u7ad9\u76ee\u5f55\r\n        root   \/usr\/share\/nginx\/html;\r\n        #\u4e0b\u9762\u4e3a\u9ed8\u8ba4\u9996\u9875\u6587\u4ef6\r\n        index  index.html index.htm index.php;\r\n    }\r\n\r\n    #error_page  404              \/404.html;\r\n\r\n    # redirect server error pages to the static page \/50x.html\r\n    #\r\n    error_page   500 502 503 504  \/50x.html;\r\n    location = \/50x.html {\r\n        root   \/usr\/share\/nginx\/html;\r\n    }\r\n\r\n    # proxy the PHP scripts to Apache listening on 127.0.0.1:80\r\n    #\r\n    #location ~ \\.php$ {\r\n    #    proxy_pass   http:\/\/127.0.0.1;\r\n    #}\r\n\r\n    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\r\n    #\r\n    location ~ \\.php$ {\r\n        #\u5c06\u4e0b\u9762\u8def\u5f84\u4fee\u6539\u4e3a\u7f51\u7ad9\u76ee\u5f55\r\n        root           \/usr\/share\/nginx\/html;\r\n        #Nginx\u901a\u8fc7unix\u5957\u63a5\u5b57\u4e0ePHP-FPM\u5efa\u7acb\u8054\u7cfb\uff0c\u8be5\u914d\u7f6e\u4e0e\/etc\/php-fpm.d\/www.conf\u6587\u4ef6\u5185\u7684listen\u914d\u7f6e\u4e00\u81f4\u3002\r\n        fastcgi_pass   unix:\/run\/php-fpm\/www.sock;\r\n        fastcgi_index  index.php;\r\n        #\u5c06\/scripts$fastcgi_script_name\u4fee\u6539\u4e3a$document_root$fastcgi_script_name\u3002\r\n        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n        #Nginx\u8c03\u7528fastcgi\u63a5\u53e3\u5904\u7406PHP\u8bf7\u6c42\u3002\r\n        include        fastcgi_params;\r\n    }\r\n\r\n    # deny access to .htaccess files, if Apache's document root\r\n    # concurs with nginx's one\r\n    #\r\n    #location ~ \/\\.ht {\r\n    #    deny  all;\r\n    #}\r\n}\r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-8.\u542f\u52a8NGINX\u670d\u52a1<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl start nginx.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-9.\u67e5\u770bNGINX\u670d\u52a1\u662f\u5426\u542f\u52a8\u6210\u529f<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl status nginx.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-10.\u6dfb\u52a0NGINX\u670d\u52a1\u5f00\u673a\u81ea\u542f\u52a8<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl enable nginx.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">6-11.\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u673a\u5668IP\u5730\u5740\uff0c\u67e5\u770b\u662f\u5426\u6709NGINX\u6b22\u8fce\u9875\u9762\uff0c\u5982\u679c\u6709\u5219\u8bc1\u660eNGINX\u542f\u52a8\u6210\u529f\u3002<\/span><\/p>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">7.\u914d\u7f6eMYSQL<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">7-1.\u5f00\u542fMySQL\u670d\u52a1<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl start mysqld.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">7-2.\u8bbe\u7f6eMySQL\u5f00\u673a\u81ea\u542f\u52a8<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl enable mysqld<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">7-3.\u67e5\u770bMySQL\u8fd0\u884c\u72b6\u6001\uff0c\u786e\u8ba4\u662f\u5426\u6210\u529f\u8fd0\u884c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl status mysqld.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">7-4.\u83b7\u53d6MySQL\u9ed8\u8ba4\u751f\u6210\u7684\u5bc6\u7801\u3002<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">grep 'temporary password' \/var\/log\/mysqld.log<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">7-5.\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6267\u884cMySQL\u5b89\u5168\u6027\u64cd\u4f5c\u5e76\u8bbe\u7f6e\u5bc6\u7801\u3002<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">mysql_secure_installation<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">7-6.\u547d\u4ee4\u8fd0\u884c\u540e\uff0c\u6839\u636e\u547d\u4ee4\u884c\u63d0\u793a\u6267\u884c\u5982\u4e0b\u64cd\u4f5c\u3002<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@localhost ~]# mysql_secure_installation\r\n\r\nSecuring the MySQL server deployment.\r\n\r\nEnter password for user root: &lt;\u8f93\u5165MySQL\u9ed8\u8ba4\u751f\u6210\u7684\u5bc6\u7801&gt;\r\n\r\nThe existing password for the user account root has expired. Please set a new password.\r\n\r\nNew password: &lt;\u91cd\u65b0\u8bbe\u7f6e\u65b0\u5bc6\u7801&gt;\r\n\r\nRe-enter new password: &lt;\u91cd\u65b0\u8f93\u5165\u4e00\u6b21\u5bc6\u7801&gt;\r\nThe 'validate_password' component is installed on the server.\r\nThe subsequent steps will run with the existing configuration\r\nof the component.\r\nUsing existing password for root.\r\n\r\nEstimated strength of the password: 100 \r\nChange the password for root ? ((Press y|Y for Yes, any other key for No) : y\r\nNew password: &lt;\u8bbe\u7f6e\u65b0\u5bc6\u7801&gt;\r\n\r\nRe-enter new password: &lt;\u91cd\u65b0\u8f93\u5165\u4e00\u6b21&gt;\r\n\r\nEstimated strength of the password: 100 \r\nDo you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y\r\nBy default, a MySQL installation has an anonymous user,\r\nallowing anyone to log into MySQL without having to have\r\na user account created for them. This is intended only for\r\ntesting, and to make the installation go a bit smoother.\r\nYou should remove them before moving into a production\r\nenvironment.\r\n\r\nRemove anonymous users? (Press y|Y for Yes, any other key for No) : y\r\nSuccess.\r\n\r\n\r\nNormally, root should only be allowed to connect from\r\n'localhost'. This ensures that someone cannot guess at\r\nthe root password from the network.\r\n\r\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : y\r\nSuccess.\r\n\r\nBy default, MySQL comes with a database named 'test' that\r\nanyone can access. This is also intended only for testing,\r\nand should be removed before moving into a production\r\nenvironment.\r\n\r\n\r\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : y\r\n - Dropping test database...\r\nSuccess.\r\n\r\n - Removing privileges on test database...\r\nSuccess.\r\n\r\nReloading the privilege tables will ensure that all changes\r\nmade so far will take effect immediately.\r\n\r\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : y\r\nSuccess.\r\n\r\nAll done! \r\n[root@localhost ~]# \r\n\r\n\r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">7-7.\u767b\u5f55\u6570\u636e\u5e93\u9a8c\u8bc1\u662f\u5426\u8bbe\u7f6e\u6210\u529f<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">mysql -u root -p<\/pre>\n<ul>\n<li><span style=\"font-family: 'comic sans ms', sans-serif;\">\u8f93\u5165 exit \u9000\u51fa\u6570\u636e\u5e93<\/span><\/li>\n<\/ul>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">8.\u914d\u7f6ePHP<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-1.\u6253\u5f00PHP\u914d\u7f6e\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">vi \/etc\/opt\/remi\/php82\/php-fpm.d\/www.conf<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-2.\u627e\u5230user = apache\u548cgroup = apache\uff0c\u5c06apache\u4fee\u6539\u4e3anginx\uff0c\u4e0b\u9762\u4e3a\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u3002<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@localhost php-fpm.d]#\r\n; Start a new pool named 'www'.\r\n; the variable $pool can be used in any directive and will be replaced by the\r\n; pool name ('www' here)\r\n[www]\r\n\r\n; Per pool prefix\r\n; It only applies on the following directives:\r\n; - 'access.log'\r\n; - 'slowlog'\r\n; - 'listen' (unixsocket)\r\n; - 'chroot'\r\n; - 'chdir'\r\n; - 'php_values'\r\n; - 'php_admin_values'\r\n; When not set, the global prefix (or @php_fpm_prefix@) applies instead.\r\n; Note: This directive can also be relative to the global prefix.\r\n; Default Value: none\r\n;prefix = \/path\/to\/pools\/$pool\r\n\r\n; Unix user\/group of processes\r\n; Note: The user is mandatory. If the group is not set, the default user's group\r\n;       will be used.\r\n; RPM: apache user chosen to provide access to the same directories as httpd\r\nuser = apache\r\n; RPM: Keep a group allowed to write in log dir.\r\ngroup = apache\r\n\r\n; The address on which to accept FastCGI requests.\r\n; Valid syntaxes are:\r\n;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on\r\n;                            a specific port;\r\n;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on\r\n;                            a specific port;\r\n;   'port'                 - to listen on a TCP socket to all addresses\r\n;                            (IPv6 and IPv4-mapped) on a specific port;\r\n;   '\/path\/to\/unix\/socket' - to listen on a unix socket.\r\n; Note: This value is mandatory.\r\nlisten = \/var\/opt\/remi\/php82\/run\/php-fpm\/www.sock\r\n\r\n; Set listen(2) backlog.\r\n; Default Value: 511\r\n;listen.backlog = 511\r\n\r\n; Set permissions for unix socket, if one is used. In Linux, read\/write\r\n; permissions must be set in order to allow connections from a web server.\r\n; Default Values: user and group are set as the running user\r\n;                 mode is set to 0660\r\n;listen.owner = nobody\r\n;listen.group = nobody\r\n;listen.mode = 0660\r\n\r\n; When POSIX Access Control Lists are supported you can set them using\r\n; these options, value is a comma separated list of user\/group names.\r\n; When set, listen.owner and listen.group are ignored\r\nlisten.acl_users = apache\r\n;listen.acl_groups =\r\n\r\n; List of addresses (IPv4\/IPv6) of FastCGI clients which are allowed to connect.\r\n; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original\r\n; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address\r\n; must be separated by a comma. If this value is left blank, connections will be\r\n; accepted from any ip address.\r\n; Default Value: any\r\nlisten.allowed_clients = 127.0.0.1\r\n\r\n; Specify the nice(2) priority to apply to the pool processes (only if set)\r\n; The value can vary from -19 (highest priority) to 20 (lower priority)\r\n; Note: - It will only work if the FPM master process is launched as root\r\n;       - The pool processes will inherit the master process priority\r\n;         unless it specified otherwise\r\n; Default Value: no set\r\n; process.priority = -19\r\n\r\n; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user\r\n; or group is different than the master process user. It allows to create process\r\n; core dump and ptrace the process for the pool user.\r\n; Default Value: no\r\n; process.dumpable = yes\r\n\r\n; Choose how the process manager will control the number of child processes.\r\n; Possible Values:\r\n;   static  - a fixed number (pm.max_children) of child processes;\r\n;   dynamic - the number of child processes are set dynamically based on the\r\n;             following directives. With this process management, there will be\r\n;             always at least 1 children.\r\n;             pm.max_children      - the maximum number of children that can\r\n;                                    be alive at the same time.\r\n;             pm.start_servers     - the number of children created on startup.\r\n;             pm.min_spare_servers - the minimum number of children in 'idle'\r\n;                                    state (waiting to process). If the number\r\n;                                    of 'idle' processes is less than this\r\n;                                    number then some children will be created.\r\n;             pm.max_spare_servers - the maximum number of children in 'idle'\r\n;                                    state (waiting to process). If the number\r\n;                                    of 'idle' processes is greater than this\r\n;                                    number then some children will be killed.\r\n;  ondemand - no children are created at startup. Children will be forked when\r\n;             new requests will connect. The following parameter are used:\r\n;             pm.max_children           - the maximum number of children that\r\n;                                         can be alive at the same time.\r\n;             pm.process_idle_timeout   - The number of seconds after which\r\n;                                         an idle process will be killed.\r\n; Note: This value is mandatory.\r\npm = dynamic\r\n\r\n; The number of child processes to be created when pm is set to 'static' and the\r\n; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.\r\n; This value sets the limit on the number of simultaneous requests that will be\r\n; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.\r\n; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP\r\n; CGI. The below defaults are based on a server without much resources. Don't\r\n; forget to tweak pm.* to fit your needs.\r\n; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'\r\n; Note: This value is mandatory.\r\npm.max_children = 50\r\n\r\n; The number of child processes created on startup.\r\n; Note: Used only when pm is set to 'dynamic'\r\n; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) \/ 2\r\npm.start_servers = 5\r\n\r\n; The desired minimum number of idle server processes.\r\n; Note: Used only when pm is set to 'dynamic'\r\n; Note: Mandatory when pm is set to 'dynamic'\r\npm.min_spare_servers = 5\r\n\r\n; The desired maximum number of idle server processes.\r\n; Note: Used only when pm is set to 'dynamic'\r\n; Note: Mandatory when pm is set to 'dynamic'\r\npm.max_spare_servers = 35\r\n\r\n; The number of seconds after which an idle process will be killed.\r\n; Note: Used only when pm is set to 'ondemand'\r\n; Default Value: 10s\r\n;pm.process_idle_timeout = 10s;\r\n\r\n; The number of requests each child process should execute before respawning.\r\n; This can be useful to work around memory leaks in 3rd party libraries. For\r\n; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.\r\n; Default Value: 0\r\n;pm.max_requests = 500\r\n\r\n; The URI to view the FPM status page. If this value is not set, no URI will be\r\n; recognized as a status page. It shows the following information:\r\n;   pool                 - the name of the pool;\r\n;   process manager      - static, dynamic or ondemand;\r\n;   start time           - the date and time FPM has started;\r\n;   start since          - number of seconds since FPM has started;\r\n;   accepted conn        - the number of request accepted by the pool;\r\n;   listen queue         - the number of request in the queue of pending\r\n;                          connections (see backlog in listen(2));\r\n;   max listen queue     - the maximum number of requests in the queue\r\n;                          of pending connections since FPM has started;\r\n;   listen queue len     - the size of the socket queue of pending connections;\r\n;   idle processes       - the number of idle processes;\r\n;   active processes     - the number of active processes;\r\n;   total processes      - the number of idle + active processes;\r\n;   max active processes - the maximum number of active processes since FPM\r\n;                          has started;\r\n;   max children reached - number of times, the process limit has been reached,\r\n;                          when pm tries to start more children (works only for\r\n;                          pm 'dynamic' and 'ondemand');\r\n; Value are updated in real time.\r\n; Example output:\r\n;   pool:                 www\r\n;   process manager:      static\r\n;   start time:           01\/Jul\/2011:17:53:49 +0200\r\n;   start since:          62636\r\n;   accepted conn:        190460\r\n;   listen queue:         0\r\n;   max listen queue:     1\r\n;   listen queue len:     42\r\n;   idle processes:       4\r\n;   active processes:     11\r\n;   total processes:      15\r\n;   max active processes: 12\r\n;   max children reached: 0\r\n;\r\n; By default the status page output is formatted as text\/plain. Passing either\r\n; 'html', 'xml' or 'json' in the query string will return the corresponding\r\n; output syntax. Example:\r\n;   http:\/\/www.foo.bar\/status\r\n;   http:\/\/www.foo.bar\/status?json\r\n;   http:\/\/www.foo.bar\/status?html\r\n;   http:\/\/www.foo.bar\/status?xml\r\n;\r\n; By default the status page only outputs short status. Passing 'full' in the\r\n; query string will also return status for each pool process.\r\n; Example:\r\n;   http:\/\/www.foo.bar\/status?full\r\n;   http:\/\/www.foo.bar\/status?json&amp;full\r\n;   http:\/\/www.foo.bar\/status?html&amp;full\r\n;   http:\/\/www.foo.bar\/status?xml&amp;full\r\n; The Full status returns for each process:\r\n;   pid                  - the PID of the process;\r\n;   state                - the state of the process (Idle, Running, ...);\r\n;   start time           - the date and time the process has started;\r\n;   start since          - the number of seconds since the process has started;\r\n;   requests             - the number of requests the process has served;\r\n;   request duration     - the duration in \u00b5s of the requests;\r\n;   request method       - the request method (GET, POST, ...);\r\n;   request URI          - the request URI with the query string;\r\n;   content length       - the content length of the request (only with POST);\r\n;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);\r\n;   script               - the main script called (or '-' if not set);\r\n;   last request cpu     - the %cpu the last request consumed\r\n;                          it's always 0 if the process is not in Idle state\r\n;                          because CPU calculation is done when the request\r\n;                          processing has terminated;\r\n;   last request memory  - the max amount of memory the last request consumed\r\n;                          it's always 0 if the process is not in Idle state\r\n;                          because memory calculation is done when the request\r\n;                          processing has terminated;\r\n; If the process is in Idle state, then informations are related to the\r\n; last request the process has served. Otherwise informations are related to\r\n; the current request being served.\r\n; Example output:\r\n;   ************************\r\n;   pid:                  31330\r\n;   state:                Running\r\n;   start time:           01\/Jul\/2011:17:53:49 +0200\r\n;   start since:          63087\r\n;   requests:             12808\r\n;   request duration:     1250261\r\n;   request method:       GET\r\n;   request URI:          \/test_mem.php?N=10000\r\n;   content length:       0\r\n;   user:                 -\r\n;   script:               \/home\/fat\/web\/docs\/php\/test_mem.php\r\n;   last request cpu:     0.00\r\n;   last request memory:  0\r\n;\r\n; Note: There is a real-time FPM status monitoring sample web page available\r\n;       It's available in: @EXPANDED_DATADIR@\/fpm\/status.html\r\n;\r\n; Note: The value must start with a leading slash (\/). The value can be\r\n;       anything, but it may not be a good idea to use the .php extension or it\r\n;       may conflict with a real PHP file.\r\n; Default Value: not set\r\n;pm.status_path = \/status\r\n\r\n; The ping URI to call the monitoring page of FPM. If this value is not set, no\r\n; URI will be recognized as a ping page. This could be used to test from outside\r\n; that FPM is alive and responding, or to\r\n; - create a graph of FPM availability (rrd or such);\r\n; - remove a server from a group if it is not responding (load balancing);\r\n; - trigger alerts for the operating team (24\/7).\r\n; Note: The value must start with a leading slash (\/). The value can be\r\n;       anything, but it may not be a good idea to use the .php extension or it\r\n;       may conflict with a real PHP file.\r\n; Default Value: not set\r\n;ping.path = \/ping\r\n\r\n; This directive may be used to customize the response of a ping request. The\r\n; response is formatted as text\/plain with a 200 response code.\r\n; Default Value: pong\r\n;ping.response = pong\r\n\r\n; The access log file\r\n; Default: not set\r\n;access.log = log\/$pool.access.log\r\n\r\n; The access log format.\r\n; The following syntax is allowed\r\n;  %%: the '%' character\r\n;  %C: %CPU used by the request\r\n;      it can accept the following format:\r\n;      - %{user}C for user CPU only\r\n;      - %{system}C for system CPU only\r\n;      - %{total}C  for user + system CPU (default)\r\n;  %d: time taken to serve the request\r\n;      it can accept the following format:\r\n;      - %{seconds}d (default)\r\n;      - %{milliseconds}d\r\n;      - %{mili}d\r\n;      - %{microseconds}d\r\n;      - %{micro}d\r\n;  %e: an environment variable (same as $_ENV or $_SERVER)\r\n;      it must be associated with embraces to specify the name of the env\r\n;      variable. Some examples:\r\n;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e\r\n;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e\r\n;  %f: script filename\r\n;  %l: content-length of the request (for POST request only)\r\n;  %m: request method\r\n;  %M: peak of memory allocated by PHP\r\n;      it can accept the following format:\r\n;      - %{bytes}M (default)\r\n;      - %{kilobytes}M\r\n;      - %{kilo}M\r\n;      - %{megabytes}M\r\n;      - %{mega}M\r\n;  %n: pool name\r\n;  %o: output header\r\n;      it must be associated with embraces to specify the name of the header:\r\n;      - %{Content-Type}o\r\n;      - %{X-Powered-By}o\r\n;      - %{Transfert-Encoding}o\r\n;      - ....\r\n;  %p: PID of the child that serviced the request\r\n;  %P: PID of the parent of the child that serviced the request\r\n;  %q: the query string\r\n;  %Q: the '?' character if query string exists\r\n;  %r: the request URI (without the query string, see %q and %Q)\r\n;  %R: remote IP address\r\n;  %s: status (response code)\r\n;  %t: server time the request was received\r\n;      it can accept a strftime(3) format:\r\n;      %d\/%b\/%Y:%H:%M:%S %z (default)\r\n;      The strftime(3) format must be encapsuled in a %{&lt;strftime_format&gt;}t tag\r\n;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t\r\n;  %T: time the log has been written (the request has finished)\r\n;      it can accept a strftime(3) format:\r\n;      %d\/%b\/%Y:%H:%M:%S %z (default)\r\n;      The strftime(3) format must be encapsuled in a %{&lt;strftime_format&gt;}t tag\r\n;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t\r\n;  %u: remote user\r\n;\r\n; Default: \"%R - %u %t \\\"%m %r\\\" %s\"\r\n;access.format = \"%R - %u %t \\\"%m %r%Q%q\\\" %s %f %{mili}d %{kilo}M %C%%\"\r\n\r\n; The log file for slow requests\r\n; Default Value: not set\r\n; Note: slowlog is mandatory if request_slowlog_timeout is set\r\nslowlog = \/var\/opt\/remi\/php82\/log\/php-fpm\/www-slow.log\r\n\r\n; The timeout for serving a single request after which a PHP backtrace will be\r\n; dumped to the 'slowlog' file. A value of '0s' means 'off'.\r\n; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)\r\n; Default Value: 0\r\n;request_slowlog_timeout = 0\r\n\r\n; Depth of slow log stack trace.\r\n; Default Value: 20\r\n;request_slowlog_trace_depth = 20\r\n\r\n; The timeout for serving a single request after which the worker process will\r\n; be killed. This option should be used when the 'max_execution_time' ini option\r\n; does not stop script execution for some reason. A value of '0' means 'off'.\r\n; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)\r\n; Default Value: 0\r\n;request_terminate_timeout = 0\r\n\r\n; Set open file descriptor rlimit.\r\n; Default Value: system defined value\r\n;rlimit_files = 1024\r\n\r\n; Set max core size rlimit.\r\n; Possible Values: 'unlimited' or an integer greater or equal to 0\r\n; Default Value: system defined value\r\n;rlimit_core = 0\r\n\r\n; Chroot to this directory at the start. This value must be defined as an\r\n; absolute path. When this value is not set, chroot is not used.\r\n; Note: you can prefix with '$prefix' to chroot to the pool prefix or one\r\n; of its subdirectories. If the pool prefix is not set, the global prefix\r\n; will be used instead.\r\n; Note: chrooting is a great security feature and should be used whenever\r\n;       possible. However, all PHP paths will be relative to the chroot\r\n;       (error_log, sessions.save_path, ...).\r\n; Default Value: not set\r\n;chroot =\r\n\r\n; Chdir to this directory at the start.\r\n; Note: relative path can be used.\r\n; Default Value: current directory or \/ when chroot\r\n;chdir = \/var\/www\r\n\r\n; Redirect worker stdout and stderr into main error log. If not set, stdout and\r\n; stderr will be redirected to \/dev\/null according to FastCGI specs.\r\n; Note: on highloaded environment, this can cause some delay in the page\r\n; process time (several ms).\r\n; Default Value: no\r\n;catch_workers_output = yes\r\n\r\n; Clear environment in FPM workers\r\n; Prevents arbitrary environment variables from reaching FPM worker processes\r\n; by clearing the environment in workers before env vars specified in this\r\n; pool configuration are added.\r\n; Setting to \"no\" will make all environment variables available to PHP code\r\n; via getenv(), $_ENV and $_SERVER.\r\n; Default Value: yes\r\n;clear_env = no\r\n\r\n; Limits the extensions of the main script FPM will allow to parse. This can\r\n; prevent configuration mistakes on the web server side. You should only limit\r\n; FPM to .php extensions to prevent malicious users to use other extensions to\r\n; execute php code.\r\n; Note: set an empty value to allow all extensions.\r\n; Default Value: .php\r\n;security.limit_extensions = .php .php3 .php4 .php5 .php7\r\n\r\n; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from\r\n; the current environment.\r\n; Default Value: clean env\r\n;env[HOSTNAME] = $HOSTNAME\r\n;env[PATH] = \/usr\/local\/bin:\/usr\/bin:\/bin\r\n;env[TMP] = \/tmp\r\n;env[TMPDIR] = \/tmp\r\n;env[TEMP] = \/tmp\r\n\r\n; Additional php.ini defines, specific to this pool of workers. These settings\r\n; overwrite the values previously defined in the php.ini. The directives are the\r\n; same as the PHP SAPI:\r\n;   php_value\/php_flag             - you can set classic ini defines which can\r\n;                                    be overwritten from PHP call 'ini_set'.\r\n;   php_admin_value\/php_admin_flag - these directives won't be overwritten by\r\n;                                     PHP call 'ini_set'\r\n; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.\r\n\r\n; Defining 'extension' will load the corresponding shared extension from\r\n; extension_dir. Defining 'disable_functions' or 'disable_classes' will not\r\n; overwrite previously defined php.ini values, but will append the new value\r\n; instead.\r\n\r\n; Note: path INI options can be relative and will be expanded with the prefix\r\n; (pool, global or @prefix@)\r\n\r\n; Default Value: nothing is defined by default except the values in php.ini and\r\n;                specified at startup with the -d argument\r\n;php_admin_value[sendmail_path] = \/usr\/sbin\/sendmail -t -i -f www@my.domain.com\r\n;php_flag[display_errors] = off\r\nphp_admin_value[error_log] = \/var\/opt\/remi\/php82\/log\/php-fpm\/www-error.log\r\nphp_admin_flag[log_errors] = on\r\n;php_admin_value[memory_limit] = 128M\r\n\r\n; Set the following data paths to directories owned by the FPM process user.\r\n;\r\n; Do not change the ownership of existing system directories, if the process\r\n; user does not have write permission, create dedicated directories for this\r\n; purpose.\r\n;\r\n; See warning about choosing the location of these directories on your system\r\n; at http:\/\/php.net\/session.save-path\r\nphp_value[session.save_handler] = files\r\nphp_value[session.save_path]    = \/var\/opt\/remi\/php82\/lib\/php\/session\r\nphp_value[soap.wsdl_cache_dir]  = \/var\/opt\/remi\/php82\/lib\/php\/wsdlcache\r\n;php_value[opcache.file_cache]  = \/var\/opt\/remi\/php82\/lib\/php\/opcache\r\n[root@localhost php-fpm.d]# \r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-3.\u5c06PHP\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u4e3a\u5982\u4e0b\u5185\u5bb9<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@localhost php-fpm.d]# vi \/etc\/opt\/remi\/php82\/php-fpm.d\/www.conf\r\n; Start a new pool named 'www'.\r\n; the variable $pool can be used in any directive and will be replaced by the\r\n; pool name ('www' here)\r\n[www]\r\n\r\n; Per pool prefix\r\n; It only applies on the following directives:\r\n; - 'access.log'\r\n; - 'slowlog'\r\n; - 'listen' (unixsocket)\r\n; - 'chroot'\r\n; - 'chdir'\r\n; - 'php_values'\r\n; - 'php_admin_values'\r\n; When not set, the global prefix (or @php_fpm_prefix@) applies instead.\r\n; Note: This directive can also be relative to the global prefix.\r\n; Default Value: none\r\n;prefix = \/path\/to\/pools\/$pool\r\n\r\n; Unix user\/group of processes\r\n; Note: The user is mandatory. If the group is not set, the default user's group\r\n;       will be used.\r\n; RPM: apache user chosen to provide access to the same directories as httpd\r\nuser = nginx\r\n; RPM: Keep a group allowed to write in log dir.\r\ngroup = nginx\r\n\r\n; The address on which to accept FastCGI requests.\r\n; Valid syntaxes are:\r\n;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on\r\n;                            a specific port;\r\n;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on\r\n;                            a specific port;\r\n;   'port'                 - to listen on a TCP socket to all addresses\r\n;                            (IPv6 and IPv4-mapped) on a specific port;\r\n;   '\/path\/to\/unix\/socket' - to listen on a unix socket.\r\n; Note: This value is mandatory.\r\nlisten = \/var\/opt\/remi\/php82\/run\/php-fpm\/www.sock\r\n\r\n; Set listen(2) backlog.\r\n; Default Value: 511\r\n;listen.backlog = 511\r\n\r\n; Set permissions for unix socket, if one is used. In Linux, read\/write\r\n; permissions must be set in order to allow connections from a web server.\r\n; Default Values: user and group are set as the running user\r\n;                 mode is set to 0660\r\n;listen.owner = nobody\r\n;listen.group = nobody\r\n;listen.mode = 0660\r\n\r\n; When POSIX Access Control Lists are supported you can set them using\r\n; these options, value is a comma separated list of user\/group names.\r\n; When set, listen.owner and listen.group are ignored\r\nlisten.acl_users = apache\r\n;listen.acl_groups =\r\n\r\n; List of addresses (IPv4\/IPv6) of FastCGI clients which are allowed to connect.\r\n; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original\r\n; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address\r\n; must be separated by a comma. If this value is left blank, connections will be\r\n; accepted from any ip address.\r\n; Default Value: any\r\nlisten.allowed_clients = 127.0.0.1\r\n\r\n; Specify the nice(2) priority to apply to the pool processes (only if set)\r\n; The value can vary from -19 (highest priority) to 20 (lower priority)\r\n; Note: - It will only work if the FPM master process is launched as root\r\n;       - The pool processes will inherit the master process priority\r\n;         unless it specified otherwise\r\n; Default Value: no set\r\n; process.priority = -19\r\n\r\n; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user\r\n; or group is different than the master process user. It allows to create process\r\n; core dump and ptrace the process for the pool user.\r\n; Default Value: no\r\n; process.dumpable = yes\r\n\r\n; Choose how the process manager will control the number of child processes.\r\n; Possible Values:\r\n;   static  - a fixed number (pm.max_children) of child processes;\r\n;   dynamic - the number of child processes are set dynamically based on the\r\n;             following directives. With this process management, there will be\r\n;             always at least 1 children.\r\n;             pm.max_children      - the maximum number of children that can\r\n;                                    be alive at the same time.\r\n;             pm.start_servers     - the number of children created on startup.\r\n;             pm.min_spare_servers - the minimum number of children in 'idle'\r\n;                                    state (waiting to process). If the number\r\n;                                    of 'idle' processes is less than this\r\n;                                    number then some children will be created.\r\n;             pm.max_spare_servers - the maximum number of children in 'idle'\r\n;                                    state (waiting to process). If the number\r\n;                                    of 'idle' processes is greater than this\r\n;                                    number then some children will be killed.\r\n;  ondemand - no children are created at startup. Children will be forked when\r\n;             new requests will connect. The following parameter are used:\r\n;             pm.max_children           - the maximum number of children that\r\n;                                         can be alive at the same time.\r\n;             pm.process_idle_timeout   - The number of seconds after which\r\n;                                         an idle process will be killed.\r\n; Note: This value is mandatory.\r\npm = dynamic\r\n\r\n; The number of child processes to be created when pm is set to 'static' and the\r\n; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.\r\n; This value sets the limit on the number of simultaneous requests that will be\r\n; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.\r\n; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP\r\n; CGI. The below defaults are based on a server without much resources. Don't\r\n; forget to tweak pm.* to fit your needs.\r\n; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'\r\n; Note: This value is mandatory.\r\npm.max_children = 50\r\n\r\n; The number of child processes created on startup.\r\n; Note: Used only when pm is set to 'dynamic'\r\n; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) \/ 2\r\npm.start_servers = 5\r\n\r\n; The desired minimum number of idle server processes.\r\n; Note: Used only when pm is set to 'dynamic'\r\n; Note: Mandatory when pm is set to 'dynamic'\r\npm.min_spare_servers = 5\r\n\r\n; The desired maximum number of idle server processes.\r\n; Note: Used only when pm is set to 'dynamic'\r\n; Note: Mandatory when pm is set to 'dynamic'\r\npm.max_spare_servers = 35\r\n\r\n; The number of seconds after which an idle process will be killed.\r\n; Note: Used only when pm is set to 'ondemand'\r\n; Default Value: 10s\r\n;pm.process_idle_timeout = 10s;\r\n\r\n; The number of requests each child process should execute before respawning.\r\n; This can be useful to work around memory leaks in 3rd party libraries. For\r\n; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.\r\n; Default Value: 0\r\n;pm.max_requests = 500\r\n\r\n; The URI to view the FPM status page. If this value is not set, no URI will be\r\n; recognized as a status page. It shows the following information:\r\n;   pool                 - the name of the pool;\r\n;   process manager      - static, dynamic or ondemand;\r\n;   start time           - the date and time FPM has started;\r\n;   start since          - number of seconds since FPM has started;\r\n;   accepted conn        - the number of request accepted by the pool;\r\n;   listen queue         - the number of request in the queue of pending\r\n;                          connections (see backlog in listen(2));\r\n;   max listen queue     - the maximum number of requests in the queue\r\n;                          of pending connections since FPM has started;\r\n;   listen queue len     - the size of the socket queue of pending connections;\r\n;   idle processes       - the number of idle processes;\r\n;   active processes     - the number of active processes;\r\n;   total processes      - the number of idle + active processes;\r\n;   max active processes - the maximum number of active processes since FPM\r\n;                          has started;\r\n;   max children reached - number of times, the process limit has been reached,\r\n;                          when pm tries to start more children (works only for\r\n;                          pm 'dynamic' and 'ondemand');\r\n; Value are updated in real time.\r\n; Example output:\r\n;   pool:                 www\r\n;   process manager:      static\r\n;   start time:           01\/Jul\/2011:17:53:49 +0200\r\n;   start since:          62636\r\n;   accepted conn:        190460\r\n;   listen queue:         0\r\n;   max listen queue:     1\r\n;   listen queue len:     42\r\n;   idle processes:       4\r\n;   active processes:     11\r\n;   total processes:      15\r\n;   max active processes: 12\r\n;   max children reached: 0\r\n;\r\n; By default the status page output is formatted as text\/plain. Passing either\r\n; 'html', 'xml' or 'json' in the query string will return the corresponding\r\n; output syntax. Example:\r\n;   http:\/\/www.foo.bar\/status\r\n;   http:\/\/www.foo.bar\/status?json\r\n;   http:\/\/www.foo.bar\/status?html\r\n;   http:\/\/www.foo.bar\/status?xml\r\n;\r\n; By default the status page only outputs short status. Passing 'full' in the\r\n; query string will also return status for each pool process.\r\n; Example:\r\n;   http:\/\/www.foo.bar\/status?full\r\n;   http:\/\/www.foo.bar\/status?json&amp;full\r\n;   http:\/\/www.foo.bar\/status?html&amp;full\r\n;   http:\/\/www.foo.bar\/status?xml&amp;full\r\n; The Full status returns for each process:\r\n;   pid                  - the PID of the process;\r\n;   state                - the state of the process (Idle, Running, ...);\r\n;   start time           - the date and time the process has started;\r\n;   start since          - the number of seconds since the process has started;\r\n;   requests             - the number of requests the process has served;\r\n;   request duration     - the duration in \u00b5s of the requests;\r\n;   request method       - the request method (GET, POST, ...);\r\n;   request URI          - the request URI with the query string;\r\n;   content length       - the content length of the request (only with POST);\r\n;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);\r\n;   script               - the main script called (or '-' if not set);\r\n;   last request cpu     - the %cpu the last request consumed\r\n;                          it's always 0 if the process is not in Idle state\r\n;                          because CPU calculation is done when the request\r\n;                          processing has terminated;\r\n;   last request memory  - the max amount of memory the last request consumed\r\n;                          it's always 0 if the process is not in Idle state\r\n;                          because memory calculation is done when the request\r\n;                          processing has terminated;\r\n; If the process is in Idle state, then informations are related to the\r\n; last request the process has served. Otherwise informations are related to\r\n; the current request being served.\r\n; Example output:\r\n;   ************************\r\n;   pid:                  31330\r\n;   state:                Running\r\n;   start time:           01\/Jul\/2011:17:53:49 +0200\r\n;   start since:          63087\r\n;   requests:             12808\r\n;   request duration:     1250261\r\n;   request method:       GET\r\n;   request URI:          \/test_mem.php?N=10000\r\n;   content length:       0\r\n;   user:                 -\r\n;   script:               \/home\/fat\/web\/docs\/php\/test_mem.php\r\n;   last request cpu:     0.00\r\n;   last request memory:  0\r\n;\r\n; Note: There is a real-time FPM status monitoring sample web page available\r\n;       It's available in: @EXPANDED_DATADIR@\/fpm\/status.html\r\n;\r\n; Note: The value must start with a leading slash (\/). The value can be\r\n;       anything, but it may not be a good idea to use the .php extension or it\r\n;       may conflict with a real PHP file.\r\n; Default Value: not set\r\n;pm.status_path = \/status\r\n\r\n; The ping URI to call the monitoring page of FPM. If this value is not set, no\r\n; URI will be recognized as a ping page. This could be used to test from outside\r\n; that FPM is alive and responding, or to\r\n; - create a graph of FPM availability (rrd or such);\r\n; - remove a server from a group if it is not responding (load balancing);\r\n; - trigger alerts for the operating team (24\/7).\r\n; Note: The value must start with a leading slash (\/). The value can be\r\n;       anything, but it may not be a good idea to use the .php extension or it\r\n;       may conflict with a real PHP file.\r\n; Default Value: not set\r\n;ping.path = \/ping\r\n\r\n; This directive may be used to customize the response of a ping request. The\r\n; response is formatted as text\/plain with a 200 response code.\r\n; Default Value: pong\r\n;ping.response = pong\r\n\r\n; The access log file\r\n; Default: not set\r\n;access.log = log\/$pool.access.log\r\n\r\n; The access log format.\r\n; The following syntax is allowed\r\n;  %%: the '%' character\r\n;  %C: %CPU used by the request\r\n;      it can accept the following format:\r\n;      - %{user}C for user CPU only\r\n;      - %{system}C for system CPU only\r\n;      - %{total}C  for user + system CPU (default)\r\n;  %d: time taken to serve the request\r\n;      it can accept the following format:\r\n;      - %{seconds}d (default)\r\n;      - %{milliseconds}d\r\n;      - %{mili}d\r\n;      - %{microseconds}d\r\n;      - %{micro}d\r\n;  %e: an environment variable (same as $_ENV or $_SERVER)\r\n;      it must be associated with embraces to specify the name of the env\r\n;      variable. Some examples:\r\n;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e\r\n;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e\r\n;  %f: script filename\r\n;  %l: content-length of the request (for POST request only)\r\n;  %m: request method\r\n;  %M: peak of memory allocated by PHP\r\n;      it can accept the following format:\r\n;      - %{bytes}M (default)\r\n;      - %{kilobytes}M\r\n;      - %{kilo}M\r\n;      - %{megabytes}M\r\n;      - %{mega}M\r\n;  %n: pool name\r\n;  %o: output header\r\n;      it must be associated with embraces to specify the name of the header:\r\n;      - %{Content-Type}o\r\n;      - %{X-Powered-By}o\r\n;      - %{Transfert-Encoding}o\r\n;      - ....\r\n;  %p: PID of the child that serviced the request\r\n;  %P: PID of the parent of the child that serviced the request\r\n;  %q: the query string\r\n;  %Q: the '?' character if query string exists\r\n;  %r: the request URI (without the query string, see %q and %Q)\r\n;  %R: remote IP address\r\n;  %s: status (response code)\r\n;  %t: server time the request was received\r\n;      it can accept a strftime(3) format:\r\n;      %d\/%b\/%Y:%H:%M:%S %z (default)\r\n;      The strftime(3) format must be encapsuled in a %{&lt;strftime_format&gt;}t tag\r\n;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t\r\n;  %T: time the log has been written (the request has finished)\r\n;      it can accept a strftime(3) format:\r\n;      %d\/%b\/%Y:%H:%M:%S %z (default)\r\n;      The strftime(3) format must be encapsuled in a %{&lt;strftime_format&gt;}t tag\r\n;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t\r\n;  %u: remote user\r\n;\r\n; Default: \"%R - %u %t \\\"%m %r\\\" %s\"\r\n;access.format = \"%R - %u %t \\\"%m %r%Q%q\\\" %s %f %{mili}d %{kilo}M %C%%\"\r\n\r\n; The log file for slow requests\r\n; Default Value: not set\r\n; Note: slowlog is mandatory if request_slowlog_timeout is set\r\nslowlog = \/var\/opt\/remi\/php82\/log\/php-fpm\/www-slow.log\r\n\r\n; The timeout for serving a single request after which a PHP backtrace will be\r\n; dumped to the 'slowlog' file. A value of '0s' means 'off'.\r\n; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)\r\n; Default Value: 0\r\n;request_slowlog_timeout = 0\r\n\r\n; Depth of slow log stack trace.\r\n; Default Value: 20\r\n;request_slowlog_trace_depth = 20\r\n\r\n; The timeout for serving a single request after which the worker process will\r\n; be killed. This option should be used when the 'max_execution_time' ini option\r\n; does not stop script execution for some reason. A value of '0' means 'off'.\r\n; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)\r\n; Default Value: 0\r\n;request_terminate_timeout = 0\r\n\r\n; Set open file descriptor rlimit.\r\n; Default Value: system defined value\r\n;rlimit_files = 1024\r\n\r\n; Set max core size rlimit.\r\n; Possible Values: 'unlimited' or an integer greater or equal to 0\r\n; Default Value: system defined value\r\n;rlimit_core = 0\r\n\r\n; Chroot to this directory at the start. This value must be defined as an\r\n; absolute path. When this value is not set, chroot is not used.\r\n; Note: you can prefix with '$prefix' to chroot to the pool prefix or one\r\n; of its subdirectories. If the pool prefix is not set, the global prefix\r\n; will be used instead.\r\n; Note: chrooting is a great security feature and should be used whenever\r\n;       possible. However, all PHP paths will be relative to the chroot\r\n;       (error_log, sessions.save_path, ...).\r\n; Default Value: not set\r\n;chroot =\r\n\r\n; Chdir to this directory at the start.\r\n; Note: relative path can be used.\r\n; Default Value: current directory or \/ when chroot\r\n;chdir = \/var\/www\r\n\r\n; Redirect worker stdout and stderr into main error log. If not set, stdout and\r\n; stderr will be redirected to \/dev\/null according to FastCGI specs.\r\n; Note: on highloaded environment, this can cause some delay in the page\r\n; process time (several ms).\r\n; Default Value: no\r\n;catch_workers_output = yes\r\n\r\n; Clear environment in FPM workers\r\n; Prevents arbitrary environment variables from reaching FPM worker processes\r\n; by clearing the environment in workers before env vars specified in this\r\n; pool configuration are added.\r\n; Setting to \"no\" will make all environment variables available to PHP code\r\n; via getenv(), $_ENV and $_SERVER.\r\n; Default Value: yes\r\n;clear_env = no\r\n\r\n; Limits the extensions of the main script FPM will allow to parse. This can\r\n; prevent configuration mistakes on the web server side. You should only limit\r\n; FPM to .php extensions to prevent malicious users to use other extensions to\r\n; execute php code.\r\n; Note: set an empty value to allow all extensions.\r\n; Default Value: .php\r\n;security.limit_extensions = .php .php3 .php4 .php5 .php7\r\n\r\n; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from\r\n; the current environment.\r\n; Default Value: clean env\r\n;env[HOSTNAME] = $HOSTNAME\r\n;env[PATH] = \/usr\/local\/bin:\/usr\/bin:\/bin\r\n;env[TMP] = \/tmp\r\n;env[TMPDIR] = \/tmp\r\n;env[TEMP] = \/tmp\r\n\r\n; Additional php.ini defines, specific to this pool of workers. These settings\r\n; overwrite the values previously defined in the php.ini. The directives are the\r\n; same as the PHP SAPI:\r\n;   php_value\/php_flag             - you can set classic ini defines which can\r\n;                                    be overwritten from PHP call 'ini_set'.\r\n;   php_admin_value\/php_admin_flag - these directives won't be overwritten by\r\n;                                     PHP call 'ini_set'\r\n; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.\r\n\r\n; Defining 'extension' will load the corresponding shared extension from\r\n; extension_dir. Defining 'disable_functions' or 'disable_classes' will not\r\n; overwrite previously defined php.ini values, but will append the new value\r\n; instead.\r\n\r\n; Note: path INI options can be relative and will be expanded with the prefix\r\n; (pool, global or @prefix@)\r\n\r\n; Default Value: nothing is defined by default except the values in php.ini and\r\n;                specified at startup with the -d argument\r\n;php_admin_value[sendmail_path] = \/usr\/sbin\/sendmail -t -i -f www@my.domain.com\r\n;php_flag[display_errors] = off\r\nphp_admin_value[error_log] = \/var\/opt\/remi\/php82\/log\/php-fpm\/www-error.log\r\nphp_admin_flag[log_errors] = on\r\n;php_admin_value[memory_limit] = 128M\r\n\r\n; Set the following data paths to directories owned by the FPM process user.\r\n;\r\n; Do not change the ownership of existing system directories, if the process\r\n; user does not have write permission, create dedicated directories for this\r\n; purpose.\r\n;\r\n; See warning about choosing the location of these directories on your system\r\n; at http:\/\/php.net\/session.save-path\r\nphp_value[session.save_handler] = files\r\nphp_value[session.save_path]    = \/var\/opt\/remi\/php82\/lib\/php\/session\r\nphp_value[soap.wsdl_cache_dir]  = \/var\/opt\/remi\/php82\/lib\/php\/wsdlcache\r\n;php_value[opcache.file_cache]  = \/var\/opt\/remi\/php82\/lib\/php\/opcache\r\n[root@localhost php-fpm.d]# \r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-4.\u8fdb\u5165NGINX\u7f51\u7ad9\u76ee\u5f55<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd \/usr\/share\/nginx\/html<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-5.\u65b0\u5efa\u4e00\u4e2aphpinfo.php\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">vi phpinfo.php<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-6.\u8f93\u5165\u4ee5\u4e0b\u5185\u5bb9\uff0cPHP\u4f1a\u5217\u51fa\u6240\u6709\u914d\u7f6e\u4fe1\u606f<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?php echo phpinfo(); ?&gt;<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-7.\u5f00\u542fPHP\u670d\u52a1<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl start php82-php-fpm.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-8.\u8bbe\u7f6ePHP\u670d\u52a1\u5f00\u673a\u81ea\u542f\u52a8<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl enable php82-php-fpm.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-9.\u67e5\u770bPHP\u670d\u52a1\u8fd0\u884c\u72b6\u6001\uff0c\u786e\u8ba4\u662f\u5426\u5728\u8fd0\u884c<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl status php82-php-fpm.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">8-10.\u6253\u5f00\u6d4f\u89c8\u5668\u8f93\u5165IP\/phpinfo.php\uff0c\u67e5\u770b\u662f\u5426\u6709\u663e\u793aphpinfo\u9875\u9762\uff0c\u5982\u679c\u6709\u5219\u8bc1\u660e\u5b89\u88c5\u6210\u529f\u3002<\/span><\/p>\n<hr \/>\n<h1><span style=\"font-family: 'comic sans ms', sans-serif;\">9.\u914d\u7f6ephpmyadmin<\/span><\/h1>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-1.\u627e\u5230phpmyadmin\u7684\u7ad9\u70b9\u76ee\u5f55\u5e76\u8f6f\u94fe\u63a5\u81f3NGINX\u7684\u7ad9\u70b9\u76ee\u5f55\u4e0b<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">ln -s \/usr\/share\/phpMyAdmin \/usr\/share\/nginx\/html\/phpmyadmin<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-2.\u6b64\u65f6\u5c31\u53ef\u4ee5\u76f4\u63a5\u6d4f\u89c8\u5668\u8f93\u5165IP\/phpmyadmin\u6253\u5f00\u9875\u9762\u4e86\uff0c\u5982\u63d0\u793a\u5982\u4e0b\u9519\u8bef\uff0c\u5219\u8fd8\u9700\u4fee\u590d<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#\u9519\u8bef1\r\nmysqli::real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]\r\n#\u9519\u8bef2\r\nmysqli::real_connect(): (HY000\/2054): The server requested authentication method unknown to the client<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-3.\u767b\u5f55\u6570\u636e\u5e93\u5e76\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u4ee5\u5b8c\u6210\u4fee\u590d<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">#\u4ee5root\u8eab\u4efd\u767b\u5f55MySQL\r\nmysql -u root -p\r\n#\u4fee\u6539\u5bc6\u7801\r\nALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Admin@000';\r\n#\u9000\u51faMySQL\r\nexit\r\n<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-4.\u6253\u5f00MySQL\u914d\u7f6e\u6587\u4ef6<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">vi \/etc\/my.cnf<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-5.\u5728[mysqld]\u677f\u5757\u672b\u5c3e\u8ffd\u52a0\u4ee5\u4e0b\u547d\u4ee4<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">default_authentication_plugin=mysql_native_password<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-6.\u91cd\u542fMySQL\u670d\u52a1<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">systemctl restart mysqld.service<\/pre>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-7.\u73b0\u5728\u4f7f\u7528phpmyadmin\u521b\u5efa\u65b0\u7528\u6237\u5c31\u4e0d\u4f1a\u62a5\u9519\u4e86\u3002<\/span><\/p>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-8.\u6b64\u65f6\u91cd\u65b0\u6253\u5f00\u6d4f\u89c8\u5668\u8f93\u5165IP\/phpmyadmin\u6253\u5f00\u9875\u9762\uff0c\u8f93\u5165MySQL\u7684\u8d26\u6237\u5bc6\u7801\u767b\u5f55\uff08\u9ed8\u8ba4\u8d26\u6237\u4e3a\uff1aroot\uff0c\u5bc6\u7801\u4e3a\u4e0a\u9762\u8bbe\u7f6e\u7684\uff09<\/span><\/p>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">9-9.\u5982\u6ca1\u53d1\u73b0\u4efb\u4f55\u62a5\u9519\u5219\u4ee3\u8868\u5de5\u4f5c\u6b63\u5e38\uff0c\u642d\u5efa\u5b8c\u6bd5\u3002<\/span><\/p>\n<hr \/>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">NGINX+MySQL+PHP+phpmyadmin<\/span><\/p>\n<p><span style=\"font-family: 'comic sans ms', sans-serif;\">\u5b89\u88c5\u5b8c\u6210\uff01<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>LNMP = Linux+NGINX+MySQL+PHP phpMyAdmin\uff08MySQL\u7684\u7ba1\u7406web\u9875\u9762\uff09 1.\u51c6\u5907\u5b89\u88c5\u73af\u5883 1-2.\u6362DNF\u6e90\u548cEPEL\u6269\u5c55\u6e90 1-3.\u5173\u95edSELinux 1-3-1.\u67e5\u770b\u672c\u5730SELinux\u662f\u5426\u4e3a\u5f00\u542f\u72b6\u6001 getenforce #\u5982\u679c\u63d0\u793aEnforcing\u5219\u8868\u793aSELinux\u4e3a\u5f00\u542f\u72b6 &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Centos8\u624b\u52a8\u5b89\u88c5LNMP+phpmyadmin\" class=\"read-more button\" href=\"https:\/\/blog.kingsbestone.com\/?p=2017#more-2017\" aria-label=\"\u66f4\u591a Centos8\u624b\u52a8\u5b89\u88c5LNMP+phpmyadmin\">\u67e5\u770b\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":212,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[59,4],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/posts\/2017"}],"collection":[{"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2017"}],"version-history":[{"count":66,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/posts\/2017\/revisions"}],"predecessor-version":[{"id":2092,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/posts\/2017\/revisions\/2092"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=\/wp\/v2\/media\/212"}],"wp:attachment":[{"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kingsbestone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}