[root@hecs-x-medium-2-linux-20200619090653 ~]# yum install mysql-server
Last metadata expiration check: 0:06:41 ago on Wed 10 Feb 2021 11:26:44 AM CST.
Dependencies resolved.
=============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
mysql-server
[root@hecs-x-medium-2-linux-20200619090653 ~]# systemctl start mysqld
[root@hecs-x-medium-2-linux-20200619090653 ~]# systemctl enable mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.
[root@hecs-x-medium-2-linux-20200619090653 ~]# systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2021-02-10 11:34:42 CST; 21s ago
Main PID: 9072 (mysqld)
Status: "Server is operational"
Tasks: 39 (limit: 11434)
Memory: 421.1M
CGroup: /system.slice/mysqld.service
└─9072 /usr/libexec/mysqld --basedir=/usr
[root@hecs-x-medium-2-linux-20200619090653 ~]# mysql_secure_installation
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
[root@hecs-x-medium-2-linux-20200619090653 ~]# yum install php php-fpm
Last metadata expiration check: 0:17:11 ago on Wed 10 Feb 2021 11:26:44 AM CST.
Dependencies resolved.
=============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
php x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66 AppStream 1.5 M
php-fpm x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66 AppStream 1.6 M
Installing dependencies:
apr x86_64 1.6.3-11.el8 AppStream 125 k
apr-util x86_64 1.6.1-6.el8 AppStream 105 k
centos-logos-httpd noarch 80.5-2.el8 BaseOS 24 k
httpd x86_64 2.4.37-30.module_el8.3.0+561+97fdbbcc AppStream 1.7 M
httpd-filesystem noarch 2.4.37-30.module_el8.3.0+561+97fdbbcc AppStream 37 k
httpd-tools x86_64 2.4.37-30.module_el8.3.0+561+97fdbbcc AppStream 104 k
mailcap noarch 2.1.48-3.el8 BaseOS 39 k
mod_http2 x86_64 1.15.7-2.module_el8.3.0+477+498bb568 AppStream 154 k
php-cli x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66 AppStream 3.1 M
php-common x86_64 7.2.24-1.module_el8.2.0+313+b04d0a66 AppStream 661 k
Installing weak dependencies:
apr-util-bdb x86_64 1.6.1-6.el8 AppStream 25 k
apr-util-openssl x86_64 1.6.1-6.el8 AppStream 27 k
Enabling module streams:
httpd 2.4
php 7.2
Transaction Summary
=============================================================================================================================================================================================================================================
Install 14 Packages
[root@hecs-x-medium-2-linux-20200619090653 ~]# systemctl start php-fpm
[root@hecs-x-medium-2-linux-20200619090653 ~]# systemctl enable php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
[root@hecs-x-medium-2-linux-20200619090653 ~]# systemctl status php-fpm
[root@hecs-x-medium-2-linux-20200619090653 ~]# php -v
PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
[root@hecs-x-medium-2-linux-20200619090653 ~]# yum -y install nginx
Last metadata expiration check: 0:25:14 ago on Wed 10 Feb 2021 11:26:44 AM CST.
Package nginx-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; }
原文:https://www.cnblogs.com/wbwj/p/14395412.html