nginx dynamic website

Step One: Download the relevant package
[root @ ZXW HTML] # yum install nginx php php-MySQL
MariaDB Server php-FPM--y
Step 2: Edit php matching rules
[root @ zxw html] # vim / etc / nginx / nginx.conf

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
index index.php index.html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

PHP $ ~ {LOCATION
fastcgi_pass 127.0.0.1:9000;
the include fastcgi.conf;
}
Step 4: Check and restart
[@ ZXW the root HTML] -t # Nginx
Nginx: Configuration File The syntax IS /etc/nginx/nginx.conf the ok
nginx: the Configuration File /etc/nginx/nginx.conf the Test IS successful
[root @ ZXW HTML] # systemctl restart nginx
step five: start-FPM PHP
[root @ ZXW HTML] # systemctl restart PHP-FPM
[root @ ZXW html] # ss -tnl
fifth step; upload package. Configuration database file
[root @ ZXW HTML] # cd / usr / report this content share / nginx / HTML /
[root @ ZXW HTML] # rz
[root @ ZXW HTML] # the unzip wordpress-3.3.1-zh_CN.zip
[root @ ZXW WordPress ] # CP-WP WP-config-sample.php with the config.php
[@ ZXW the root WordPress] # WP-Vim the config.php

DEFINE ( 'the DB_NAME', 'ZXW');

/ ** MySQL database user name * /
DEFINE ( 'DB_USER', 'ZXW');

/ ** MySQL database password * /
DEFINE ( 'DB_PASSWORD', 'ZXW');

/ ** MySQL Host * /
the DEFINE ( 'DB_HOST', 'localhost');
Step six: Restart the database
[root @ zxw wordpress] # systemctl restart mariadb
seventh step; create a database user password
[root @ zxw wordpress] # mysql -uroot-
MariaDB [(none)]> Create Database ZXW;
Query the OK,. 1 Row affected (0.00 sec)
MariaDB [(none)]> ON ZXW * All Grant to ZXW @ 'localhost' IDENTIFIED by '123'.
Query the OK, 0 rows affected (0.00 sec)

 

Guess you like

Origin www.cnblogs.com/itzhao/p/11249954.html