Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy three virtual machines to implement WordPress in kvm

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how kvm deploys three virtual machines to implement WordPress. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

A brief introduction to kvm

The abbreviation of kernel-based Virtual Machine is an open source system virtualization module that has been integrated in major releases of Linux since Linux 2.6.20. It is managed by Linux's own scheduler, so its core source code is relatively small compared to Xen. At present, KVM has become one of the mainstream VMM in academic circles.

KVM virtualization requires hardware support (such as Intel VT technology or AMD V technology). Is full virtualization based on hardware. In the early days, Xen was based on software simulation of Para-Virtualization, while the new version was based on full virtualization supported by hardware. But Xen itself has its own process scheduler, storage management module and so on, so the code is relatively large. The widely spread commercial system virtualization software VMware ESX series is also based on software simulation of Para-Virtualization.

Second, build the flow chart

III. Content

1. Deploy the installation environment

1.1 modify system memory

Double-click the virtual machine, edit the virtual machine settings on the right, and click Open

1.2 enable virtualization, set the number of processors, and check the options indicated in the figure.

When you are finished, click OK.

2. Check the instruction set of CPU, that is, to see whether virtualization is enabled.

Note: if the vmx is not displayed, restart the system.

3. Configure yum source

Note: the yum source is configured, depending on the situation

4. Install kvm services and manage packages related to requirements

Note:

Qemu-kvm-tools for simulating computers to provide IO devices for KVM virtual machines

Libvirt-manage virtual machines

Virt-install-command line virtual machine creation installation tool

Bridge-utils-Bridge tool

4.2 restart the service

4.3 check

5. Create a bridge

5.1 create a http-fpm bridge

5.1.1 enter the directory

5.1.2 Editing the xml file

5.1.3 define and generate the bridge according to the specified xml file

5.1.4 start the httpfpm Bridge

5.1.5 set the httpfpm bridge to boot

5.2 create a php-mysql bridge

5.2.1 enter the directory

5.2.2 Editing the xml file

5.2.3 the bridge is defined and generated by the specified xml file

5.2.4 start the httpfpm Bridge

5.2.5 set the httpfpm bridge boot

5.2.6 check to see if the bridge is started

5.3 create a physical bridge

5.3.1 New br0 profile

Note: type specifies the bridge type, con-name is the profile connection name, and ifname is the specified interface

5.3.2 set br0 dynamic ip to 172.18.254.39, and set gateway and DNS to 172.18.0.1

Note: ipv4.method to specify dynamic IP or manually set IP,ipv4.gateway to set gateway

5.3.3 start br0

5.3.4 add a physical network card for br0 and specify the primary network card as br0

Note: type type is bridge-slave,ifname, interface is ens33,master, and master device is br0.

5.3.5 enable bridge-slave network card

Note: if there is an unknown error in the Nic startup, restart the virtual machine

5.3.6 View network card association

5.3.7 View Brid

6. Create a virtual disk file

6.1 create a virtual disk file directory

6.2 create a disk file and generate a virtual disk template

7. Download virtual machine centos7 image

Slightly

8. Install the prototype machine

8.1 New virtual machine

8.2 choose the installation method

8.3 add an image file

8.4 modify memory and processor

8.5 Import the generated virtual disk file

8.6 modify the name of the virtual machine and select the network card

8.7 start installation

The steps after enter are the same as the newly installed centos7, so I won't repeat them here.

9. Configure the prototype machine

9.1 configure the yum repository

9.1.1 download yum Feed

9.1.2 clear the yum cache

9.1.3 updating the yum database

9.2 install related packages, standby

"after the installation is complete, use the reboot command to shut down the virtual machine."

10. Use the prototype machine as a template to create three virtual machines named httpd,mysql,php, in preparation for the implementation of WordPress.

10.1 create a virtual machine placement directory

Note: due to the large file size of the virtual machine, a new directory has been created here and mounted to the hard disk. It is recommended to create a new hard disk.

10.2 copy the prototype to the specified directory and change the name to httpd

10.3 enter the configuration file directory and copy the configuration file that generates the httpd virtual machine

10.4 Editing the profile

10.5 enable the httpd virtual machine

When finished, create the mysql and php virtual machines with the same steps as above.

10.6 check to see if the created virtual machine is started

11. Configure the httpd virtual machine

11.1 configure the first network card

11.2 configure the second network card

11.3 check whether the configured Nic automatically generates IP addresses

12. Configure the php virtual machine

12.1 add a network card

For adding a network card, select the network card, right click, click add network card, select network, modify network source, and then click the finish option in the lower right corner to complete.

12.2 modify network card parameters

12.3 check whether the configured Nic automatically generates IP addresses

13. Configure the mysql virtual machine

Check whether the configured Nic automatically generates IP addresses

14. Test whether virtual machines can be accessed

Httpd virtual machine

Php virtual machine

Mysql virtual machine

15. Realize building WordPress blog based on lamp

For more details, please refer to the blog: http://blog.51cto.com/12948961/2307599

Due to different modules, you need to specify the order of modules.

1. Modify the configuration file of http service in the httpd client

2. Specify the sequence of modules

Result

The IP address obtained varies depending on the connection network.

one

two

three

four

Note: because this experiment has been done before, the prompt content is different.

five

This is the end of the article on "how kvm deploys three virtual machines to achieve WordPress". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report