week_11_基于amp搭建wordpress和phpmyadmin


Q:

1、编译安装搭建wordpress
2、搭建php-admin


A:

1、编译安装搭建wordpress

下载wordpress

[root@localhost ~]# wget -O /tmp/wordpress.tar.gz https://cn.wordpress.org/latest-zh_CN.tar.gz
--2019-04-11 22:49:12--  https://cn.wordpress.org/latest-zh_CN.tar.gz
Resolving cn.wordpress.org (cn.wordpress.org)... 198.143.164.252
Connecting to cn.wordpress.org (cn.wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11098483 (11M) [application/octet-stream]
Saving to: ‘/tmp/wordpress.tar.gz’

100%[=================================================================================================>] 11,098,483  1.30MB/s   in 11s    

2019-04-11 22:49:24 (1000 KB/s) - ‘/tmp/wordpress.tar.gz’ saved [11098483/11098483]

解包

[root@localhost ~]# tar xf /tmp/wordpress.tar.gz 

[root@localhost ~]# cp -a wordpress/ /var/www/html/blog

创建wordpress数据库

[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE wordpress
    -> ;
Query OK, 1 row affected (0.00 sec)

配置wordpress和httpd

[root@localhost ~]# ls /var/www/html/blog/
index.php    wp-activate.php     wp-comments-post.php  wp-cron.php        wp-load.php   wp-settings.php   xmlrpc.php
license.txt  wp-admin            wp-config-sample.php  wp-includes        wp-login.php  wp-signup.php
readme.html  wp-blog-header.php  wp-content            wp-links-opml.php  wp-mail.php   wp-trackback.php
[root@localhost ~]# cp /var/www/html/blog/wp-config-sample.php /var/www/html/blog/wp-config.php
[root@localhost ~]# vim /var/www/html/blog/wp-config.php

wp-config.php

/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');

/** MySQL数据库用户名 */
define('DB_USER', 'wpuser');

/** MySQL数据库密码 */
define('DB_PASSWORD', 'wppass');

/** MySQL主机 */
define('DB_HOST', '192.168.0.103');

/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');

/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', '');

2、搭建php-admin


下载支持php-5.4的phpmyadmin版本

[root@localhost ~]# rpm -q php
php-5.4.16-46.el7.x86_64
[root@localhost ~]# wget -O /tmp/phpMyAdmin-4.0.10.20.tar.gz https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.tar.gz
--2019-04-12 00:29:03--  https://files.phpmyadmin.net/phpMyAdmin/4.0.10.20/phpMyAdmin-4.0.10.20-all-languages.tar.gz
Resolving files.phpmyadmin.net (files.phpmyadmin.net)... 43.245.63.29
Connecting to files.phpmyadmin.net (files.phpmyadmin.net)|43.245.63.29|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7203314 (6.9M) [application/octet-stream]
Saving to: ‘/tmp/phpMyAdmin-4.0.10.20.tar.gz’

100%[=================================================================================================>] 7,203,314    419KB/s   in 21s    

2019-04-12 00:29:28 (332 KB/s) - ‘/tmp/phpMyAdmin-4.0.10.20.tar.gz’ saved [7203314/7203314]

解包

[root@localhost ~]# tar zxf /tmp/phpMyAdmin-4.0.10.20.tar.gz 

[root@localhost ~]# cp -a phpMyAdmin-4.0.10.20-all-languages/ /var/www/html/pma/

改配置文件

[root@localhost ~]# cp /var/www/html/pma/config.sample.inc.php  /var/www/html/pma/config.inc.php 

[root@localhost ~]# openssl rand -base64 32
QknjcpQRuavimVq4Q2lkaEXm3MSdzxQ0UJa89kToRGs=

[root@localhost ~]# vim /var/www/html/pma/config.inc.php

[root@localhost ~]# yum install -y php-mbstring
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie. Needs to be 32 chars long.
 */
$cfg['blowfish_secret'] = 'QknjcpQRuavimVq4Q2lkaEXm3MSdzxQ0UJa89kToRGs'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

在mariadb中给root一个密码

MariaDB [(none)]> grant all privileges on *.* to 'root'@'192.168.0.103' identified by 'root';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> select Host,User,Password from mysql.user
    -> ;
+-----------------------+--------+-------------------------------------------+
| Host                  | User   | Password                                  |
+-----------------------+--------+-------------------------------------------+
| localhost             | root   |                                           |
| localhost.localdomain | root   |                                           |
| 127.0.0.1             | root   |                                           |
| ::1                   | root   |                                           |
| localhost             |        |                                           |
| localhost.localdomain |        |                                           |
| %                     | wpuser | *C9B2DB1CA193280B971CA3602D5174A5D637D2BF |
| 192.168.0.103         | root   | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+-----------------------+--------+-------------------------------------------+
8 rows in set (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

你可能感兴趣的:(week_11_基于amp搭建wordpress和phpmyadmin)