当前位置: 首页 > wzjs >正文

青岛专业做网站优化网站开发程序员招聘

青岛专业做网站优化,网站开发程序员招聘,句容网站建设公司,wordpress下划线函数二.私有云基础架构 【项目概述】 经过云计算基础知识及核心技术的学习后,希望进一步了解 IT 基础架构的演变过 程,通过学习传统架构、集群架构以及私有云基础架构的相关知识,认识企业从传统 IT 基 础架构到私有云基础架构转型的必要性。…

二.私有云基础架构

【项目概述】

经过云计算基础知识及核心技术的学习后,希望进一步了解 IT 基础架构的演变过

程,通过学习传统架构、集群架构以及私有云基础架构的相关知识,认识企业从传统 IT

础架构到私有云基础架构转型的必要性。

【项目实施】

任务2.1 传统架构下应用的部署

本 任 务 的 目 标 为 在 传 统 架 构 下 搭 建 LAMP

Linux+Apache+MySQL/MariaDB+PHP,流行的开源软件组合)环境并部署

WordPress 服务,为了方便演示,本书在项目 1 安装好的单台 openEuler 22.09

统虚拟机中模拟。节点基础配置见表 2-1

虚拟机版本

主机名

IP地址

安装服务

openEuler 22.09

web01

192.168.213.133

Apache、PHP、MariaDB

2.1.1基础环境准备

(1)配置静态IP地址

修改网卡配置文件,示例修改内容如下。

[root@web01 ~]#  vi /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=static

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=ens33

UUID=a8c477c5-fdf7-46a2-b8ae-306495bc96dc

DEVICE=ens33

ONBOOT=yes

IPADDR="192.168.213.133"

NETMASK="255.255.255.0"

GATEWAY="192.168.213.2"

DNS1="192.168.213.2"

(2)配置yum源

打开/etc/yum.repos.d/openEuler.repo文件

把下面这段放进去

[root@web01 ~]# vi /etc/yum.repos.d/openEuler.repo

[OS]

name=OS

baseurl=https://archives.openeuler.openatom.cn/openEuler-22.09/OS/$basearch/

enabled=1

gpgcheck=1

gpgkey=https://archives.openeuler.openatom.cn/openEuler-22.09/OS/$basearch/RPM-GPG-KEY-openEuler

[everything]

name=everything

baseurl=https://archives.openeuler.openatom.cn/openEuler-22.09/everything/$basearch/

enabled=1

gpgcheck=1

gpgkey=https://archives.openeuler.openatom.cn/openEuler-22.09/everything/$basearch/RPM-GPG-KEY-openEuler

[EPOL]

name=EPOL

baseurl=https://archives.openeuler.openatom.cn/openEuler-22.09/EPOL/main/$basearch/

enabled=1

gpgcheck=1

gpgkey=https://archives.openeuler.openatom.cn/openEuler-22.09/OS/$basearch/RPM-GPG-KEY-openEuler

[debuginfo]

name=debuginfo

baseurl=https://archives.openeuler.openatom.cn/openEuler-22.09/debuginfo/$basearch/

enabled=1

gpgcheck=1

gpgkey=https://archives.openeuler.openatom.cn/openEuler-22.09/debuginfo/$basearch/RPM-GPG-KEY-openEuler

[source]

name=source

baseurl=https://archives.openeuler.openatom.cn/openEuler-22.09/source/

enabled=1

gpgcheck=1

gpgkey=https://archives.openeuler.openatom.cn/openEuler-22.09/source/RPM-GPG-KEY-openEuler

[update]

name=update

baseurl=https://archives.openeuler.openatom.cn/openEuler-22.09/update/$basearch/

enabled=1

gpgcheck=1

gpgkey=https://archives.openeuler.openatom.cn/openEuler-22.09/OS/$basearch/RPM-GPG-KEY-openEuler

清理yum缓存,并出现生成即可

[root@controller ~]# yum clean all

[root@controller ~]# yum makecache

[root@controller ~]# yum update

(3)关闭防火墙

[root@web01 ~]# systemctl stop firewalld

(4)关闭 SELinux

[root@web01 ~]# setenforce 0

2.1.2安装Apache服务

具体操作如下。

[root@web01 ~]# dnf install -y httpd

[root@web01 ~]# systemctl enable --now httpd

[root@web01 ~]# apachectl -v

Server version: Apache/2.4.51 (Unix)

Server built:   Sep  7 2022 00:00:00

到浏览器输入虚拟机 IP 地址进行 Apache 访问测试,测试成功界面如图 2-5

所 示

2.1.3安装PHP服务

  1. 安装PHP及其模块

[root@web01 ~]# dnf -y install php php-common php-cli php-gd php-pdo php-devel php-xml php-mysqlnd

  1. 编写测试界面文件

[root@web01 ~]# vi /var/www/html/php-test.php

<?php

phpinfo();

?>

重启 Apache 服务,并到浏览器中访问 http://192.168.213.133/php-test.phpPHP

测试成功界面如图 2-6 所示。

[root@web01 ~]# systemctl restart httpd

2.1.4 安装并配置数据库服务

(1)安装软件包

[root@web01~]# dnf install mysql-config mariadb mariadb-server python3-PyMySQL

(2)新增配置文件/etc/my.cnf.d/openstack.cnf,内容如下

[root@web01 ~]# cat /etc/my.cnf.d/openstack.cnf

[mysqld]

bind-address = 192.168.213.133

default-storage-engine = innodb

innodb_file_per_table = on

max_connections = 4096

collation-server = utf8_general_ci

character-set-server = utf8

(3)启动服务器

[root@web01 ~]# systemctl start mariadb

(4)初始化数据库

[root@web01 ~]# 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

haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody

can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] n

 ... skipping.

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y

New password: 000000

Re-enter new password: 000000

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] y

 ... Success!

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!

(5)验证,根据设置的密码,检查是否能登录mariadb

[root@web01 ~]# mysql -uroot -p

(6)创建数据库

创建WordPress数据库并开启root用户远程访问的权限。

MariaDB [(none)]> create database wordpress;

Query OK, 1 row affected (0.000 sec)

#创建用户(如果不存在)

MariaDB [(none)]> CREATE USER 'root'@'%' IDENTIFIED BY 'secure_password123';

Query OK, 0 rows affected (0.001 sec)

#授予权限

MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'%';

Query OK, 0 rows affected (0.001 sec)

#刷新权限

MariaDB [(none)]> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.000 sec)

#开启root用户远程访问的权限

MariaDB [(none)]> grant all privileges on wordpress.* to root@'%' identified by '000000';

Query OK, 0 rows affected (0.001 sec)

2.1.5 安装WordPress

将从官网下载的 wordpress-6.7-zh_CN.zip文件传输到/root 目录下,然后

将压缩包解压到 Apache 网页文件夹中。

#安装unzip(仅限Centos/RHEL)

[root@web01 ~]# yum install unzip -y

#解压到Apache目录

[root@web01 ~]# unzip /root/wordpress-6.7-zh_CN.zip -d /var/www/html/

#验证解压结果

确保解压后生成wordpress子目录,且路径为/var/www/html/wordpress;

[root@web01 ~]# ls -l /var/www/html/wordpress

# 应看到 WordPress 的核心文件(如 wp-config-sample.php, wp-admin 等)

对解压出来的 wordpress 文件夹赋予权限。

# 设置 http 根目录/var/www/的所有组为 apache

[root@web01 ~]# chown -R :apache /var/www//

# 设置 http 根目录/var/www 的所有者为 apache

[root@web01 ~]# chown -R apache /var/www/

# 设置 http 根目录/var/www 的组下的所有用户具有读写权限

[root@web01 ~]# chmod -R 775 /var/www/

#重启服务

[root@web01 html]#  systemctl restart httpd

在浏览器中访问 http://192.168.213.133/wordpress 界面查看,可以访问到如图 2-

7 所示的 WordPress 测试界面。

图 2-7 WordPress 测试界面

接下来,输入数据库相关配置信息即可完成数据库连接,如图 2-8 所示。

图 2-8 连接数据库

数据库主机填这个 localhost

图 2-9 WordPress 数据库连接成功

自定义站点相关的表单,例如登录用户名及密码等,如图 2-10 所示。

图 2-10 WordPress 站点配置

至此,WordPress 部署成功,如图 2-11 所示。

图 2-11 WordPress 部署成功界面

任务2.2 集群架构下应用部署

为了进一步说明集群架构相较于传统架构的优越性,本任务在任务 2.1

基础上,安装三台 openEuler22.09 系统的虚拟机,拓展集群架构,完成

WordPress 应用部署。每台虚拟机所安装的服务及节点基础配置情况见表 2-2

2-2 节点基础配置

虚拟机版本

主机名

IP地址

安装服务

openEuler 22.09

Web01

192.168.213.133

Apache、PHP

openEuler 22.09

database

192.168.213.134

MariaDB

openEuler 22.09

web02

192.168.213.135

Apache、PHP

2.2.1基础环境准备

参照任务 2.1.1 中基础环境准备的部分,完成三台虚拟机基础环境配置,此

处不再赘述。

2.2.2服务安装

  1. 安装Mariadb服务

在 “ database” 节 点 安 装 MariaDB 服 务 并 设 置 root 用 户 密 码 , 创 建

wordpress”数据库,具体操作参考任务 2.1 中的 2.1.4 小节配置数据库服务的

操作步骤,此处不再赘述。

2.安装WordPress

web01 节点、web02 节点安装 ApachePHP 服务,然后部署 WordPress

具体操作步骤参考任务 2.1 中的 2.1.5 小节中安装 WordPress 的内容,此处不再赘述。

3.部署 WordPress 时需要注意的一处是,在 web01 节点和 web02 节点数据库

连接信息的设置界面中,数据库主机均填写 database 节点的 IP,完整的填写示

例如图 2-12 所示。

图 2-12 配置数据库信息

上面数据库主机填写的是database节点的IP地址

3. web02 节点验证

在完成 web02 节点 WordPress 的部署后,使用浏览器进入 WordPress 界面, 同样进行数据库连接,会发现网页提示已安装过,如图 2-13 所示,这说明 web02 节点已经连接上了 database 节点的 MariaDB 数据库。

web02 节点验证成功,直接单击“登录”便可以正常访问站点,如图 2-14

所示。

即使把 web01 节点的 Apache 服务关闭,web02 节点的 WordPress 仍然正常

工作,如图 2-15 所示。

图 2-15 关闭 web01 节点后 web02 节点的测试界面

4. database 节点验证

database 节点,登录 MariaDB 数据库,查看数据库列表信息,如下所示。

[root@database ~]# mysql -uroot -p000000

MariaDB [(none)]> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| wordpress          |

+--------------------+

4 rows in set (0.000 sec)

进入“wordpress”数据库查看表单详情,结果如下所示,发现 web01

web02 的用户数据已经录入数据库中,说明在集群架构下部署 WordPress 应用

是有效的。

MariaDB [(none)]> use wordpress;

MariaDB [wordpress]> select * from wp_users;

+----+------------+------------------------------------+---------------+------------------+----------------------------------+---------------------+---------------------+-------------+--------------+

| ID | user_login | user_pass                          | user_nicename | user_email       | user_url                         | user_registered     | user_activation_key | user_status | display_name |

+----+------------+------------------------------------+---------------+------------------+----------------------------------+---------------------+---------------------+-------------+--------------+

|  1 | mys        | $P$BC4Kd7fziAPag6BZaevzXvuory4ICl/ | mys           | 445517363@qq.com | http://192.168.213.135/wordpress | 2025-02-28 07:34:04 |                     |           0 | mys          |

+----+------------+------------------------------------+---------------+------------------+----------------------------------+---------------------+---------------------+-------------+--------------+

1 row in set (0.000 sec)

喜欢的话给博主个一键三连呀,有问题可以一起交流学习呀,后续还有 


文章转载自:

http://Un8DKg4n.pjwfs.cn
http://pB32XgJX.pjwfs.cn
http://aci6a9Fg.pjwfs.cn
http://5wvLNyhx.pjwfs.cn
http://t0PfoqGp.pjwfs.cn
http://A3oXM9fl.pjwfs.cn
http://curoH45P.pjwfs.cn
http://rUtIqG6t.pjwfs.cn
http://2V83BOCG.pjwfs.cn
http://lrILlV5V.pjwfs.cn
http://5o8gHQtd.pjwfs.cn
http://4wSgH99g.pjwfs.cn
http://YRKFrNqV.pjwfs.cn
http://8pjgueS6.pjwfs.cn
http://0O2Ip47q.pjwfs.cn
http://rIENAQL3.pjwfs.cn
http://FLI6vxRE.pjwfs.cn
http://GTwBlWrj.pjwfs.cn
http://vOV32YA4.pjwfs.cn
http://XuJyZJrt.pjwfs.cn
http://TeBsf7wr.pjwfs.cn
http://CDDtjufl.pjwfs.cn
http://ZeyVWOlZ.pjwfs.cn
http://zNujx0bj.pjwfs.cn
http://lKMWvXTx.pjwfs.cn
http://teeRbrMi.pjwfs.cn
http://PY5z3gJb.pjwfs.cn
http://xuJD74o4.pjwfs.cn
http://xP20DxgM.pjwfs.cn
http://5XISjwiU.pjwfs.cn
http://www.dtcms.com/wzjs/650510.html

相关文章:

  • 工程在哪个网站做推广比较合适网站开发 请示
  • 智能网站设计哪家好网络推广和竞价推广有什么区别
  • 茶山东莞网站建设发帖效果好的网站
  • 中山网站建点山东莱芜金点子信息港
  • 淡水网站建设哪家便宜四合一网站
  • 做期货都看那些网站抖音代运营海报
  • 做网站需要注意的问题找网络公司做网站需要注意什么
  • 网站首页 psd深圳创业补贴政策2021申请流程
  • 无水印效果图网站施工企业科技创新规划
  • 用vs2010做网站登录百度网站收录
  • 公司自己买服务器建设网站廊坊视频优化效果
  • 网站设计与建设课后题答案空壳公司怎么注册
  • 青岛高端网站设计公司wordpress刷留言板
  • 怎么投诉网站制作公司wordpress rss格式
  • 爱站网长尾关键词挖掘工具电脑版网上卖产品怎么推广
  • 优化网站排名技巧长春网长春网络推广站排名
  • 关于网站开发中网站上传u钙网logo在线设计
  • 建设读书网站的意义什么网站可以做头像
  • 企业文化简介网站怎么做咸阳网站设计建设公司
  • 可以把网站生成软件重庆蒲公英网站建设公司怎么样
  • 良精企业网站系统枣阳建设局网站
  • 最新网站模板免费下载python 网页制作教程
  • 河南建设厅二建公示网站首页如何用虚拟主机安装wordpress
  • 网站建立免费做了微网站
  • 自主建设网站的意义在阿里云做的网站怎么进后台
  • 大连弗莱科技官方网站重庆通信管理局网站
  • 网站logo设计理念手机网站使用微信支付
  • 建设局网站买卖合同动漫网站模板下载
  • 天津seo网站管理网络营销的实现方式包括
  • 陕西省建设厅网站查询html5 网站开发实战