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

LAMP (php-fpm)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Blog assignment 2: CentOS 7, lamp (php-fpm)

Requirements: (1) the three are separated from three hosts

(2) one virtual host is used to provide phpMyAdmin; and the other virtual host is used to provide wordpress

(3) xcache

First, prepare three virtual hosts. The IP of virtual host 1 is 192.168.1.108, the IP of virtual host 2 is 192.168.1.109, and the IP of virtual host 3 is 192.168.1.111.

1. First, install the package.

Virtual machine 1 is used to provide static web pages and install httpd

Yum install httpd-y

Then start the service

Systemctl start httpd.service

two。 Virtual machine 2 is used to provide dynamic web pages and install php-ftp php php-mysql php-mbstring packages

Yum install-y php-ftp php php-mysql php-mbstring

Then start the service

Systemctl start php-ftp.service

3. Virtual machine 3 is used to provide database and install package mariadb-service

Yum install-y mariadb-service

Then start the service

Systemctl start mariadb.service

4. Configure the virtual machine in virtual machine 1 configure the virtual machine file as follows

Exit after the configuration is completed,: wq save exit

5. Virtual machine 2 for configuration, check the file.

[root@localhost ~] # vim / etc/php

Php5.4/ php.d/ php-fpm.conf php-fpm.d/ php.ini

Edit configuration file

[root@localhost ~] # vim / etc/php-fpm.d/www.conf

Configuration of two listening IP for configuration file

The first setting is the address of the php-fpm host that is listening on this machine

The second setting is the ip of the host where the listening client provides the httpd service

6. Configure virtual host 3.

First, use the command mysql to set up the database

GRANT ALL ON *. * TO root@'192.168.%.%' IDENTIFIED BY 'root'

CREATE DATABASE rootdb

FLUSH PRIVILEGES

7. Then use virtual machine 1 for testing, first start the database of virtual machine 1, and test with mysql, as shown below

Mysql-uroot-h 192.168.1.111-proot ok can log in to the database and test ok

8. Then put their phpMyAdmin,wordpress under the specified path / var/www/html in virtual machine 1 and virtual machine 2 respectively

Both virtual machine 1 and virtual machine 2 have a copy, because virtual machine 1 provides static web pages and virtual machine 2 provides dynamic web pages.

9. Set phpMyAdmin\ wordpress separately to connect to the database

Set up the phpMyAdmin configuration file as follows

Cd / var/www/html/pma

Vim config.inc.php

The configuration file for setting wordpress is as follows

Cd / var/www/html/wordpress

Vim wp-config.php configures the connection to the database, as shown below

10. Then do the name resolution configuration. In linux, edit the configuration file vim / etc/hosts as follows

11. If windows is used for parsing, you can edit the following file, as shown below:

twelve。 Use Windows for testing. Isok

13. Install the php-xcache acceleration module on virtual machine 2.

Yum install-y php-xcache

14. Test work, use ab command to test work, ab-n 1000-c 1000 http://www.a.com /

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

Database

Wechat

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

12
Report