Two Web servers for a load balancing solution

Source: Internet
Author: User
Tags php server

write in front: If this article is fortunate enough to be seen by a friend and found wrong, I hope to criticize. If you do not understand the place, we would like to discuss together.


Overall scenario

The Platform planning topology diagram is as follows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/46/41/wKiom1Pw0X6iL00iAAFe7XKMelk102.jpg "title=" Figure 1 "alt = "Wkiom1pw0x6il00iaafe7xkmelk102.jpg"/>

Overall Solutions:

Two Web services load-balance through DNS, share Server for NFS, share MySQL server through Server for NFS


Note: The next step is to build a DNS server, two Web servers, Server for NFS, and MySQL server, and in the process only give the implementation process and its steps to understand.


Building a DNS server

1. Edit the master configuration file

# vim/etc/named.conf

Options {

Directory "/var/named";

Dump-file "/var/named/data/cache_dump.db";

Statistics-file "/var/named/data/named_stats.txt";

Memstatistics-file "/var/named/data/named_mem_stats.txt";

recursion Yes;

};


Logging {

Channel Default_debug {

File "Data/named.run";

Severity dynamic;

};

};


Zone "." in {

Type hint;

File "named.ca";

};


Include "/etc/named.rfc1912.zones";

2. Edit the zone configuration file

# Vim/etc/named.rfc1912.zones

After this file, add the following:

Zone "Muluhe.com" in {

Type master;

File "Muluhe.com.zone";

};

3. Edit the positive solution database file

# Vim/var/named/muluhe.com.zone

$TTL 3600

$ORIGIN muluhe.com.

@ in SOA ns.muluhe.com. Admin.muluhe.com. (

2014081701

2H

10M

7D

1D)

In NS NS

NS in A 10.170.2.10

www in A 10.170.2.60

www in A 10.170.2.80


4. Start the service and test

# Service named restart

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/46/43/wKioL1Pw0NTgf7lgAAAvF5JsVnw597.jpg "title=" Figure 2 "alt = "Wkiol1pw0ntgf7lgaaavf5jsvnw597.jpg"/>

[email protected] ~]# nslookup

> www.muluhe.com

Server:127.0.0.1

Address:127.0.0.1#53


Name:www.muluhe.com

address:10.170.2.80

Name:www.muluhe.com

address:10.170.2.60


Build httpd+php Server

See Building a separate Lamp server platform blog

The difference is that the supplied Discuz file of the NFS server is mounted to/var/www/php

# mount-t NFS 10.170.2.30:/discuz/var/www/php

Preferably set to boot mount


Build MySQL Server

See Building a separate Lamp server platform blog

MariaDB [(None)]> CREATE DATABASE Muluhe;

MariaDB [(None)]> GRANT all on muluhe.* to ' Muluhe ' @ ' 10.170.%.% ' identified by ' [email protected] ';

MariaDB [(None)]> FLUSH privileges;


Building an NFS server

Build NFS server, mainly to edit/etc/exports files

# Vim/etc/exports

The edited content is as follows:

/discuz 10.170.2.0/255.255.252.0 (rw)

Start the service

# Chkconfig Rpcbind on

# Chkconfig NFS On

# Chkconfig Nfslock on

# Service Rpcbind Restart

# Service NFS Restart

# Service Nfslock Restart


Provide Discuz resources

# Mkdir/discuz

Unzip the Discuz_x2.5_sc_gbk.zip file in the/discuz directory

# Unzip Discuz_x2.5_sc_gbk.zip

# CD Upload

# chmod-r Go+w config/

# chmod-r Go+w data/

# chmod-r Go+w uc_*


Installing Discuz

In the browser, type: www.muluhe.com/upload

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/46/43/wKioL1Pw232xpaTiAAJMnZfLED8026.jpg "title=" Figure 3 "alt = "Wkiol1pw232xpatiaajmnzfled8026.jpg"/>


When you click Agree, you can get the following content

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/46/43/wKioL1Pw3BCyS2o3AAEh2Z39lEI023.jpg "title=" Figure 4 "alt = "Wkiol1pw3bcys2o3aaeh2z39lei023.jpg"/>

Then click Next to get the following:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/46/41/wKiom1Pw203CPUbHAAFJ9US6y-o973.jpg "title=" Figure 5 "alt = "Wkiom1pw203cpubhaafj9us6y-o973.jpg"/>

Then click Next to get the following:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/46/43/wKioL1Pw3VOARjLcAAFCcdwHmqI589.jpg "title=" Figure 6 "alt = "Wkiol1pw3voarjlcaafccdwhmqi589.jpg"/>

And then next, you can get the following:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/46/41/wKiom1Pw3N7iA6aWAAJkNYgY03A929.jpg "title=" Figure 7 "alt = "Wkiom1pw3n7ia6awaajknygy03a929.jpg"/>

After installation, you can get the following content

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/46/43/wKioL1Pw3lDTu8CiAAIv3CDxMTQ922.jpg "title=" Figure 8 "alt = "Wkiol1pw3ldtu8ciaaiv3cdxmtq922.jpg"/>


Cond...

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.