实验
使用xserver1节点基于环境,部署WordPress应用(WoedPress源码包在 /opt 目录下)。应用部署完毕后,设置WordPress的站点标题为自己的姓名(例:名字叫张三,则设置站点标题为张三的BLOG),设置完毕后登录WordPress首页。最后将命令curl ip(ip为wordpress的首页ip)的返回结果以文本形式提交到答题框。
(1)curl ip的结果(提交完整内容的文档)
(2)博客首页显示截图
(3)发布自己的第一篇博文并截图
安装LNMP环境
yum源要装好!!!
[root@lnmp ~]# hostnamectl set-hostname lnmp
将提供的 lnmp1.6-full.tar.gz 上传到/root目录下并解压
[root@lnmp ~]# tar -zxvf lnmp1.6-full.tar.gz
[root@lnmp ~]# cd lnmp1.6-full
[root@lnmp lnmp1.6-full]# ./install.sh
除了MySQL密码其他都可以回车默认
任意键继续,时间较长耐心等待
看到 Install lnmp V1.6 completed! enjoy it. 就可以CTRL+C结束
ISTEN 0 128 *:80 *:*
LISTEN 0 128 *:55861 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 64 *:41692 *:*
LISTEN 0 50 *:445 *:*
LISTEN 0 64 [::]:2049 [::]:*
LISTEN 0 50 [::]:139 [::]:*
LISTEN 0 64 [::]:38508 [::]:*
LISTEN 0 128 [::]:52401 [::]:*
LISTEN 0 128 [::]:22 [::]:*
LISTEN 0 50 [::]:445 [::]:*
Install lnmp takes 9 minutes.
Install lnmp V1.6 completed! enjoy it.
^C[root@lnmp lnmp1.6-full]#
部署wordpress应用
[root@lnmp ~]# mysql -uroot -p000000
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.62-log Source distribution
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database wordpress;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to root@localhost identified by '000000' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to root@"%" identified by '000000' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> Ctrl-C -- exit!
Aborted
将提供的 wordpress-4.7.3-zh_CN.zip 压缩包上传至虚拟机的 /root 目录并解压
unzip wordpress-4.7.3-zh_CN.zip
进入 /home/wwwroot/default/ 删除给定网页模板 index.html
[root@lnmp ~]# cd /home/wwwroot/default/
[root@lnmp default]# rm -rf index.html
回到 /root/wordpress 将该命令下的文件都复制到 /home/wwwroot/default/ 并赋予权限 777
[root@lnmp default]# cd /root/wordpress/
[root@lnmp wordpress]# cp -rvf * /home/wwwroot/default/
[root@lnmp wordpress]# cd /home/wwwroot/default/
[root@lnmp default]# chmod 777 *
[root@lnmp default]# cp wp-config-sample.php wp-config.php
[root@lnmp default]# vi wp-config.php
...... #省略
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL数据库用户名 */
define('DB_USER', 'root');
/** MySQL数据库密码 */
define('DB_PASSWORD', '000000');
/** MySQL主机 */
define('DB_HOST', '192.168.110.10'); #IP地址
...... #省略
安装
[root@lnmp ~]# curl -L 192.168.110.10 > text
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 51617 0 51617 0 0 5081 0 --:--:-- 0:00:10 --:--:-- 12525
[root@lnmp ~]# ls
anaconda-ks.cfg Docker.tar.gz image.sh lnmp1.6-full lnmp-install.log wordpress
Docker images jdk lnmp1.6-full.tar.gz text.txt wordpress-4.7.3-zh_CN.zip
[root@lnmp ~]# cat test.txt