wordpress博客系统

发布时间 2023-12-20 11:05:50作者: 代码你敲我不敲

wordpress博客系统

LNMP:Linux+nginx+mysql+php

一个操作系统+web网站+一个数据库存放数据+后端编程语言

基于红帽操作系统来搭建

1.需要一个本地yum仓库

[root@server yum.repos.d]# vim local.repo 

[local]
name=local
baseurl=file:///media
enabled=1
gpgcheck=0

[root@server yum.repos.d]# yum clean all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: local
Cleaning up everything
[root@server yum.repos.d]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
local                                                                                                    | 4.1 kB  00:00:00     
(1/2): local/group_gz                                                                                    | 136 kB  00:00:00     
(2/2): local/primary_db                                                                                  | 3.9 MB  00:00:00     
repo id                                                       repo name                                                   status
local                                                         local                                                       4,751
repolist: 4,751
[root@server yum.repos.d]# 

2.安装需要软件包,windows的软件包拖入需要进行解压

[root@server ~]# ls
anaconda-ks.cfg  initial-setup-ks.cfg  lnmp.zip  tlsweb.csr  wordpress-4.7.3-zh_CN.zip
[root@server ~]# unzip lnmp.zip 
Archive:  lnmp.zip
   creating: lnmp/
   creating: lnmp/lnmp/
  inflating: lnmp/lnmp/alsa-lib-1.1.8-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/apr-1.4.8-5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/apr-util-1.5.2-6.el7.x86_64.rpm  
  inflating: lnmp/lnmp/atk-2.28.1-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/autoconf-2.69-11.el7.noarch.rpm  
  inflating: lnmp/lnmp/automake-1.13.4-3.el7.noarch.rpm  
  inflating: lnmp/lnmp/avahi-libs-0.6.31-19.el7.x86_64.rpm  
  inflating: lnmp/lnmp/boost-filesystem-1.53.0-25.el7.x86_64.rpm  
  inflating: lnmp/lnmp/boost-program-options-1.53.0-25.el7.x86_64.rpm  
  inflating: lnmp/lnmp/boost-system-1.53.0-25.el7.x86_64.rpm  
  inflating: lnmp/lnmp/boost-thread-1.53.0-25.el7.x86_64.rpm  
  inflating: lnmp/lnmp/cairo-1.15.12-4.el7.x86_64.rpm  
  inflating: lnmp/lnmp/chkconfig-1.7.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/copy-jdk-configs-3.3-10.el7_5.noarch.rpm  
  inflating: lnmp/lnmp/cups-libs-1.6.3-40.el7.x86_64.rpm  
  inflating: lnmp/lnmp/dejavu-fonts-common-2.33-6.el7.noarch.rpm  
  inflating: lnmp/lnmp/dejavu-sans-fonts-2.33-6.el7.noarch.rpm  
  inflating: lnmp/lnmp/dracut-033-360.el7_2.1.x86_64.rpm  
  inflating: lnmp/lnmp/dracut-config-generic-033-360.el7_2.1.x86_64.rpm  
  inflating: lnmp/lnmp/dracut-config-rescue-033-360.el7_2.1.x86_64.rpm  
  inflating: lnmp/lnmp/dracut-network-033-360.el7_2.1.x86_64.rpm  
  inflating: lnmp/lnmp/elasticsearch-6.0.0.rpm  
  inflating: lnmp/lnmp/erlang-asn1-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-compiler-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-crypto-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-eldap-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-erts-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-hipe-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-inets-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-kernel-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-mnesia-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-os_mon-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-otp_mibs-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-public_key-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-runtime_tools-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-sasl-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-sd_notify-0.1-9.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-snmp-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-ssl-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-stdlib-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-syntax_tools-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-tools-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/erlang-xmerl-18.3.4.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/fontconfig-2.13.0-4.3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/fontpackages-filesystem-1.44-8.el7.noarch.rpm  
  inflating: lnmp/lnmp/freetype-2.8-14.el7.x86_64.rpm  
  inflating: lnmp/lnmp/fribidi-1.0.2-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/gdk-pixbuf2-2.36.12-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/giflib-4.1.6-9.el7.x86_64.rpm  
  inflating: lnmp/lnmp/glib2-2.56.1-5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/gperftools-libs-2.4.91-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/graphite2-1.3.10-1.el7_3.x86_64.rpm  
  inflating: lnmp/lnmp/gtk-update-icon-cache-3.22.30-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/gtk2-2.24.31-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/harfbuzz-1.7.5-2.el7.x86_64.rpm  
  inflating: lnmp/lnmp/hicolor-icon-theme-0.12-7.el7.noarch.rpm  
  inflating: lnmp/lnmp/httpd-2.4.6-90.el7.centos.x86_64.rpm  
  inflating: lnmp/lnmp/httpd-tools-2.4.6-90.el7.centos.x86_64.rpm  
  inflating: lnmp/lnmp/hwdata-0.252-9.3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/initscripts-9.49.30-1.el7_2.3.x86_64.rpm  
  inflating: lnmp/lnmp/jasper-libs-1.900.1-33.el7.x86_64.rpm  
  inflating: lnmp/lnmp/java-1.8.0-openjdk-1.8.0.222.b10-1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/java-1.8.0-openjdk-devel-1.8.0.222.b10-1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/java-1.8.0-openjdk-headless-1.8.0.222.b10-1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/javapackages-tools-3.4.1-11.el7.noarch.rpm  
  inflating: lnmp/lnmp/jemalloc-3.6.0-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/kmod-20-8.el7_2.x86_64.rpm  
  inflating: lnmp/lnmp/libaio-0.3.109-13.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libdrm-2.4.97-2.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libfontenc-1.1.3-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libglvnd-1.0.1-0.8.git5baa1e5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libglvnd-egl-1.0.1-0.8.git5baa1e5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libglvnd-glx-1.0.1-0.8.git5baa1e5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libgudev1-219-19.el7_2.13.x86_64.rpm  
  inflating: lnmp/lnmp/libICE-1.0.9-9.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libpciaccess-0.14-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libpng-1.5.13-7.el7_2.x86_64.rpm  
  inflating: lnmp/lnmp/libSM-1.2.2-2.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libstemmer-0-2.585svn.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libthai-0.1.14-9.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libunwind-1.1-5.el7_2.2.x86_64.rpm  
  inflating: lnmp/lnmp/libwayland-client-1.15.0-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libwayland-server-1.15.0-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libX11-1.6.7-2.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libX11-common-1.6.7-2.el7.noarch.rpm  
  inflating: lnmp/lnmp/libXau-1.0.8-2.1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libxcb-1.13-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXcomposite-0.4.4-4.1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXcursor-1.1.15-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXdamage-1.1.4-4.1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXext-1.3.3-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXfixes-5.0.3-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXft-2.3.2-2.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXi-1.7.9-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXinerama-1.1.3-2.1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXrandr-1.5.1-2.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXrender-0.9.10-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libxshmfence-1.2-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libxslt-1.1.28-5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXtst-1.2.3-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libXxf86vm-1.1.4-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/libzip-0.10.1-8.el7.x86_64.rpm  
  inflating: lnmp/lnmp/lksctp-tools-1.0.13-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/lksctp-tools-1.0.17-2.el7.x86_64.rpm  
  inflating: lnmp/lnmp/logstash-2.1.3-1.noarch.rpm  
  inflating: lnmp/lnmp/m4-1.4.16-10.el7.x86_64.rpm  
  inflating: lnmp/lnmp/mailcap-2.1.41-2.el7.noarch.rpm  
  inflating: lnmp/lnmp/mesa-libEGL-18.3.4-5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/mesa-libgbm-18.3.4-5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/mesa-libGL-18.3.4-5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/mesa-libglapi-18.3.4-5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/mongodb-2.6.11-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/mongodb-server-2.6.11-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/nginx-1.16.1-1.el7.ngx.x86_64.rpm  
  inflating: lnmp/lnmp/openssl-1.0.2k-19.el7.x86_64.rpm  
  inflating: lnmp/lnmp/openssl-libs-1.0.2k-19.el7.x86_64.rpm  
  inflating: lnmp/lnmp/pango-1.42.4-4.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/pcre-8.32-17.el7.x86_64.rpm  
  inflating: lnmp/lnmp/pcre-devel-8.32-17.el7.x86_64.rpm  
  inflating: lnmp/lnmp/pcsc-lite-libs-1.8.8-8.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-5.16.3-294.el7_6.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Carp-1.26-244.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-constant-1.27-2.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Data-Dumper-2.145-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-DBD-MySQL-4.023-6.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-DBI-1.627-4.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Encode-2.51-7.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Exporter-5.68-3.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-File-Path-2.09-2.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-File-Temp-0.23.01-3.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Filter-1.49-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Getopt-Long-2.40-3.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-HTTP-Tiny-0.033-3.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-IO-Compress-2.061-2.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-libs-5.16.3-294.el7_6.x86_64.rpm  
  inflating: lnmp/lnmp/perl-macros-5.16.3-294.el7_6.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Net-Daemon-0.48-5.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-parent-0.225-244.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-PathTools-3.40-5.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-PlRPC-0.2020-14.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Pod-Escapes-1.04-294.el7_6.noarch.rpm  
  inflating: lnmp/lnmp/perl-Pod-Perldoc-3.20-4.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Pod-Simple-3.28-4.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Pod-Usage-1.63-3.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-podlators-2.5.1-3.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Socket-2.010-4.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Storable-2.45-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Test-Harness-3.28-3.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Text-ParseWords-3.29-4.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-Thread-Queue-3.02-2.el7.noarch.rpm  
  inflating: lnmp/lnmp/perl-threads-1.87-4.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-threads-shared-1.43-6.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Time-HiRes-1.9725-3.el7.x86_64.rpm  
  inflating: lnmp/lnmp/perl-Time-Local-1.2300-2.el7.noarch.rpm  
  inflating: lnmp/lnmp/php-5.4.16-46.1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/php-cli-5.4.16-46.1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/php-common-5.4.16-46.1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/php-devel-5.4.16-46.1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/php-fpm-5.4.16-46.1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/php-mysql-5.4.16-46.1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/php-pdo-5.4.16-46.1.el7_7.x86_64.rpm  
  inflating: lnmp/lnmp/pixman-0.34.0-1.el7.x86_64.rpm  
  inflating: lnmp/lnmp/python-javapackages-3.4.1-11.el7.noarch.rpm  
  inflating: lnmp/lnmp/python-lxml-3.2.1-4.el7.x86_64.rpm  
  inflating: lnmp/lnmp/rabbitmq-server-3.6.5-1.el7.noarch.rpm  
  inflating: lnmp/lnmp/redis-3.2.12-2.el7.x86_64.rpm  
   creating: lnmp/lnmp/repodata/
  inflating: lnmp/lnmp/repodata/56b29f4f10648a116bdf0e4acef97ad269d0b1918d6ee03c492942470d77f7f9-other.xml.gz  
  inflating: lnmp/lnmp/repodata/68b587cbf7cd910af1d1f608129b2a3157564f30fa04e08a93ee778863aba472-primary.xml.gz  
  inflating: lnmp/lnmp/repodata/76332b70b2275e21e197778d246fb82feddbd1c900b07c11a9080566e1e6a808-filelists.xml.gz  
  inflating: lnmp/lnmp/repodata/9b7ac28cfad055e3bc1d454440c8828887b0b231e3974b576cf04a3139e8185e-filelists.sqlite.bz2  
  inflating: lnmp/lnmp/repodata/e8d1a9d37eca23068a0a07bc3f50030a203b2b8ccfe3dd79d1aac268c8a474fe-primary.sqlite.bz2  
  inflating: lnmp/lnmp/repodata/ff9899fcfc97c400412461e488caf88fa08431ccb684175da7bca61e0aa541a3-other.sqlite.bz2  
  inflating: lnmp/lnmp/repodata/repomd.xml  
  inflating: lnmp/lnmp/systemd-219-19.el7_2.13.x86_64.rpm  
  inflating: lnmp/lnmp/systemd-libs-219-19.el7_2.13.x86_64.rpm  
  inflating: lnmp/lnmp/systemd-sysv-219-19.el7_2.13.x86_64.rpm  
  inflating: lnmp/lnmp/ttmkfdir-3.0.9-42.el7.x86_64.rpm  
  inflating: lnmp/lnmp/tzdata-java-2019c-1.el7.noarch.rpm  
  inflating: lnmp/lnmp/v8-3.14.5.10-14.el7.x86_64.rpm  
  inflating: lnmp/lnmp/xorg-x11-font-utils-7.5-21.el7.x86_64.rpm  
  inflating: lnmp/lnmp/xorg-x11-fonts-Type1-7.5-9.el7.noarch.rpm  
  inflating: lnmp/lnmp/yaml-cpp-0.5.1-6.el7.x86_64.rpm  
[root@server ~]# 

3.基于软件包新建一个yum本地仓库

[root@server yum.repos.d]# vim lnmp
[lnmp]
name=lnmp
baseurl=file://root/lnmp/lnmp
gpgcheck=0
enabled=1
[root@server yum.repos.d]# yum clean all
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: local
Cleaning up everything
[root@server yum.repos.d]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
local                                                                                                    | 4.1 kB  00:00:00     
(1/2): local/group_gz                                                                                    | 136 kB  00:00:00     
(2/2): local/primary_db                                                                                  | 3.9 MB  00:00:00     
repo id                                                       repo name                                                   status
local                                                         local                                                       4,751
repolist: 4,751

4.安装软件

yum -y install nginx mariadb-server php  php-mysql php-fpm  

5.解压wordpress.zip

[root@server ~]# unzip wordpress-4.7.3-zh_CN.zip 

6.配置nginx

[root@server html]# cat /etc/nginx/conf.d/default.conf 
server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.php index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
        root           /usr/share/nginx/html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

7.配置数据库初始化

[root@server html]# systemctl  start mariadb
[root@server html]# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y  
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

mysql  -uroot -p000000
->  create  database  wordpress;
->  show databases;
->  exit
#进入数据库,创建一个WordPress的数据库

8.配置权限
(1)文件权限

chmod -R 777 ./

(2)防火墙权限

  firewall-cmd  --permanent  --add-service=http 
  firewall-cmd  --permanent  --add-service=mysql
 firewall-cmd  --reload

(3)selinux文件的上下文

semanage fcontext -a -t httpd_sys_content_t '/usr/share/nginx/html/(/.*)?'
  restorecon -RFv .

9.开启服务并设置开机自启

  systemctl enable php-fpm
  systemctl enable mariadb.service 
  systemctl enable nginx
    systemctl start php-fpm
  systemctl start mariadb.service 
  systemctl start nginx

10.访问http://192.168.10.10
image