Two lamp servers based on the CentOS 7 system, sharing the same PHP Web page via NFS

Source: Internet
Author: User
Tags install wordpress

System Requirements: Configure network and Yum sources.

Installation Environment:

Yum install httpd php-fpm php-mysql mariadb-server-y

After installation, modify some of the necessary parameters.

1, PHP-FPM

cd/etc/php-fpm.d/

VI www.conf

Listen = 127.0.0.1:9000 # indicates that the listener is on port 9000 on this machine.

Listen.backlog = 100 # Indicates the length of the queue waiting to be executed.

listen.allowed_clients = 127.0,0.1 # access control, allowing native access.

user = Apache

Group = Apache # PHP-FPM runs as Apache.

PM = <static | Dynamic> # Static: The number of processes is fixed. Dynamic: The number of processes started dynamically adjusted.

Pm.max_children = 50 # The maximum number of child processes to start.

Pm.min_spare_servers = 5 # The minimum number of processes to idle.

Pm.max_spare_servers = 35 # Max

Pm.start_servers = 5 # Number of processes started at service startup. Benefit: You can quickly respond to client requests.

pm.max_requests = 500 # Each server-side process, a lifetime can be corresponding to the request of fewer clients.

Systemctl Start Php-mysql

2, MARIADB

A, VI/ETC/MY.CNF

[mysqld] adds two parameters.

A, innodb_file_per_table = on # Each table corresponds to a separate file.

B, skip_name_resolve = on # when connecting to a database, name resolution is not performed.

Systemctl Start mariadb

SS-TNL # If you see 3306, the boot is successful!

B. Authorization

Grant all on test.* to ' testuser ' @ ' 192.168.10.% ' identified by ' testuser ';

Flush privileges;

Quit

Systemctl Start mariadb

3, httpd

To add parameters to the configuration file:

1. Proxyrequests off # Disables the forward proxy

2, Proxypassmatch ^/(. *\.php) $ fcgi://127.0.0.1:9000/data/vhosts/www1/$1

3, DirectoryIndex index.php

Tip: The above features require module support, presumably, proxy_fcgi_module default httpd2.4 is included. So do not worry more, the FPM function can only be used httpd2.4 version.

Systemctl Start httpd # If the 80 port starts, it means success!

Add test page: see if Httpd,php,mysql is connected successfully!.


4. Test page, WordPress

index.php

<?php

$conn = mysql_connect (' host ', ' user ', ' pass ');

if ($conn)

echo "11";

Else

echo "22";

Phpinfo ();

>650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/84/6B/wKiom1eQWKfA1zzsAAHUnE3735I973.png-wh_ 500x0-wm_3-wmp_4-s_537567697.png "title=" "alt=" Wkiom1eqwkfa1zzsaahune3735i973.png-wh_50 "/>

B, install WordPress

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/84/6B/wKioL1eQWbqhV1nzAAHTV5jxy0Y492.png-wh_500x0-wm_3 -wmp_4-s_1942272296.png "title=" Lamp-nfs2.png "alt=" Wkiol1eqwbqhv1nzaahtv5jxy0y492.png-wh_50 "/>

This image appears, indicating a successful configuration.

5, through the NFS, the Web page sharing.

Vi/etc/exports

/data/vhosts/www1/192.168.10.12 (Ro,async)

Systemctl Start Rpcbind NFS

The port appears: 111,139,445. Indicates a successful start.



6, on another server, configured, httpd php-fpm. and start the server.

Yum Install httpd php-fpm php-mysql


A, the view server shares out those can mount directory.

SHOWMOUNT-E 192.168.10.11

Mount.nfs 192.168.10.11:/DATA/VHOSTS/WWW1/DATA/VHOSTS/ZNH

DF # view.


650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/84/6B/wKiom1eQZp6A5kuqAAMZHalXZ6c850.png-wh_500x0-wm_3 -wmp_4-s_259597433.png "title=" Lamp-nfs3.png "alt=" Wkiom1eqzp6a5kuqaamzhalxz6c850.png-wh_50 "/>



7. Share the Web page file on the master server via Samba.



This article is from the "11650580" blog, please be sure to keep this source http://11660580.blog.51cto.com/11650580/1828375

Two lamp servers based on the CentOS 7 system, sharing the same PHP Web page via NFS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.