DNS HTTPD PHP NFS---Comprehensive application

Source: Internet
Author: User

DNS HTTPD PHP NFS ---Comprehensive application

Working Model Description:

650) this.width=650; "title=" Picture 1.png "src=" http://s3.51cto.com/wyfs02/M00/46/69/ Wkiol1pyiu7gltjdaaesisklo08918.jpg "alt=" Wkiol1pyiu7gltjdaaesisklo08918.jpg "/>


Using DNS Server domain name resolution for simple polling, two httpd servers for simple load balancing. NFS acts as the root directory for site resources. Two httpd share a MySQL service store

Experimental topology diagram:

650) this.width=650; "title=" Picture 2.png "src=" http://s3.51cto.com/wyfs02/M00/46/67/wKiom1PyIGXjjS88AAIvm_ 0zrfi025.jpg "alt=" Wkiom1pyigxjjs88aaivm_0zrfi025.jpg "/>

Compile and install the BIND9 package for bind-9.9.6b1.tar.gz decompression: tar-xf bind-9.9.6b1.tar.gz CD bind-9.9.6b1./configure--prefix=/usr/local/bind9 --sysconfdir=/etc/named/name.conf--disable-ipv6--enable-threads--disable-chroot compile and install: Make & amp;& make install edit config file:

650) this.width=650; "title=" Picture 3.png "src=" http://s3.51cto.com/wyfs02/M02/46/67/ Wkiom1pyijch9mkuaafzv3w5v1y713.jpg "alt=" Wkiom1pyijch9mkuaafzv3w5v1y713.jpg "/>


providing parsing files for hefeng.com domains

Vim/var/named/hefeng.com.zone content is as follows:

650) this.width=650; "title=" Picture 4.png "src=" http://s3.51cto.com/wyfs02/M00/46/67/wKiom1PyIK_ Wavdyaadjjkv5ryq638.jpg "alt=" Wkiom1pyik_wavdyaadjjkv5ryq638.jpg "/>


DNS Configuration Complete

Test whether polling can be completed

650) this.width=650; "title=" Picture 5.png "src=" http://s3.51cto.com/wyfs02/M02/46/69/wKioL1PyIeiyHV_ Raagazuk1qdu187.jpg "alt=" Wkiol1pyieiyhv_raagazuk1qdu187.jpg "/>

Install the HTTPD server and consolidate the PHP module package for httpd-2.4.10.tar.gz apr-1.5.1.tar.gz apr-util-1.5.3.tar.gz First install the Apache Portable Runtime environment./configure  --prefix=/usr/local/apr-1.5make && make install ./configure --prefix=/ Usr/local/apr-util-1.5 --with-apr-util=/usr/local/apr-1.5make && make install   Decompression: tar -xf httpd-2.4.10.tar.gz   CD httpd-2.4.10      ./ configure       --prefix=/usr/local/apache1       --sysconfdir=/etc/apache1      --enable-so        --enable-modules=most      --enable-mpms=all       --enable-mpm-share=all       --enable-mpm=event       --enable--ssl       --enable-cgi       --enable-rewrite      --with-zlib      --with-pcre        --with-apr=/usr/local/apr-1.5      -- with-apr-util=/usr/local/apr-util-1.5      make && make  Install the PHP Package: php-5.4.26.tar.bz2 Resolve dependencies:  yum install gd-devel --libmcrypt-devel compile configuration to  ./configure --prefix=/usr/local/php1 --with-config-file-path=/etc/php1 -- with-config-scan-dir=/etc/php1.d --enable-mbstring --with-freetype --with-jpeg-dir -- with-png-dir --writh-zlib --with-libxml-dir=/usr --enable-xml --with-apxs2=/usr/local/ Apache1/bin/apxs --enable-maintainer-zts --with-mysql=mysqlnd --with-mysqli=mysqld make  && make install  Edit configuration file:vim /etc/apache1/httpd.conf  Add the following PHP module will automatically add SERVERNAME WWW.HEFENG.COMLISTEN&N after installation is completeBsp;172.16.101.35:80addtype application/x-httpd-php .phpaddtype application/x-httpd-source  .PHPS installation Complete the first host test is as follows: Because the client host will have a DNS cache, so here directly with the IP address test

650) this.width=650; "title=" Picture 6.png "src=" http://s3.51cto.com/wyfs02/M02/46/67/ Wkiom1pyiqjgty3daakr9tvlys8191.jpg "alt=" Wkiom1pyiqjgty3daakr9tvlys8191.jpg "/>




The same method installs another httpd+php on the same host but changes the apache1 to apache2 php1 PhP2 Note When installing Apache2 on the same host , Apr and apr-util To reinstall a copy, the second host cannot start the listening process .

In addition, to edit the vim/etc/apache2/httpd.conf Monitor the second NIC port such as:

650) this.width=650; "title=" Picture 7.png "src=" http://s3.51cto.com/wyfs02/M02/46/67/ Wkiom1pyitab1j9oaadcbih0mha086.jpg "alt=" Wkiom1pyitab1j9oaadcbih0mha086.jpg "/>

Tests such as:

650) this.width=650; "title=" Picture 8.png "src=" http://s3.51cto.com/wyfs02/M01/46/69/wKioL1PyIljx_ Hdxaakw3gykwms880.jpg "alt=" Wkiol1pyiljx_hdxaakw3gykwms880.jpg "/>



Prepare to install MARIADB Server: Package is binary: mariadb-5.5.36-linux-x86_64.tar.gz the installation steps are as follows: first create the system user Mysqluseradd-r-s/sbin/nologin-d/  MyData Unpacking the installation package TAR-XF mariadb-5.5.36-linux-x86_64.tar.gz-c/usr/local/Creating a soft link: ln-sv mariadb-5.5.36-linux-x86_64 MySQL enters MySQL directory to modify the genus Group and the owner Chown-r mysql:mysql./* Run the following command./scripts/mysql_install_db--user=mysql--datadir=/mydata The modified file belongs to the main chown-r root./* Create profile for MySQL CP support-files/my-large.cnf/etc/my.cnf Modify the configuration file vim/etc/my.cnf


650) this.width=650; "title=" Picture 9.png "src=" http://s3.51cto.com/wyfs02/M00/46/67/ Wkiom1pyiw-suwtyaac23iaogfg074.jpg "alt=" Wkiom1pyiw-suwtyaac23iaogfg074.jpg "/>

Create SysV startup script CP Support-files/mysql.server/etc/init.d/mysqldchkconfig-add mysqld export binary vim/etc/profile.d/mysqld.sh


650) this.width=650; "title=" Picture 10.png "src=" http://s3.51cto.com/wyfs02/M02/46/67/ Wkiom1pyiajsyhjfaabu4ephbxi469.jpg "alt=" Wkiom1pyiajsyhjfaabu4ephbxi469.jpg "/>

Execute the command to make it effective source!$ for root account wearing password mysqladmin-uroot password ' hzm132 ' start MySQL Service mysqld start and test

650) this.width=650; "title=" Picture 11.png "src=" http://s3.51cto.com/wyfs02/M01/46/67/wKiom1PyIdDDdDlKAADKmb_ 0s5m916.jpg "alt=" Wkiom1pyidddddlkaadkmb_0s5m916.jpg "/>

At this point, the MARIADB installation succeeds to create an NFS share: Vim/etc/exports content is as follows: The shared directory creates a directory for/myweb Mkdir/myweb

650) this.width=650; "title=" Picture 12.png "src=" Http://s3.51cto.com/wyfs02/M00/46/69/wKioL1PyIw_ Xwf1qaacq7jpyrdu515.jpg "alt=" Wkiol1pyiw_xwf1qaacq7jpyrdu515.jpg "/>

Put the Discuz installation file upload into this directory and modify the permissions because Apache runs daemon user so chown-r daemon:daemon/mywebchmod-r 755/mywebnfs and installation files will accompany. Create the database for the installation site Mysql-uroot-p-E "Create databse myweb" Mysql-uroot-p-E "Grant all on myweb.* to ' myweb ' @ ' 172.16.101.35 ' IDE Ntified by ' hzm132 ' "Mysql-uroot-p-E" Grant all on myweb.*-' myweb ' @ ' 172.16.101.36 ' identified by ' hzm132 ' "Mysql-uroo T-p-E "flush privileges" view

650) this.width=650; "title=" Picture 13.png "src=" http://s3.51cto.com/wyfs02/M01/46/68/ Wkiom1pyihuzs805aacpibhwmpc032.jpg "alt=" Wkiom1pyihuzs805aacpibhwmpc032.jpg "/>


Okay, the data is ready.

Now to the Apache server hangs the NFS shared files to the site root directory

Mount-t NFS 172.16.101.100:/myweb/usr/local/apache2/htdocs/

Mount-t NFS 172.16.101.100:/myweb/usr/local/apache1/htdocs/

Start the installation process select any host can install the process no longer repeat details refer to the previous blog

Test:

Upload data is accessible via any host

650) this.width=650; "title=" Picture 14.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/46/69/ Wkiol1pyi2xsrlxsaabyb8bf630435.jpg "alt=" Wkiol1pyi2xsrlxsaabyb8bf630435.jpg "/>

650) this.width=650; "title=" Picture 15.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/46/69/ Wkiol1pyi2wzp1aoaaerphn2zma970.jpg "alt=" Wkiol1pyi2wzp1aoaaerphn2zma970.jpg "/>

Register an account

650) this.width=650; "title=" Picture 16.png "src=" http://s3.51cto.com/wyfs02/M02/46/68/wKiom1PyInGzt1Z-AAD_ N64nfw0759.jpg "alt=" Wkiom1pyingzt1z-aad_n64nfw0759.jpg "/>


Landing success

650) this.width=650; "title=" Picture 17.png "src=" http://s3.51cto.com/wyfs02/M02/46/68/ Wkiom1pyiocbw5tbaaexhii-6h0781.jpg "alt=" Wkiom1pyiocbw5tbaaexhii-6h0781.jpg "/>


Now change the other host to see if you can log in

650) this.width=650; "title=" Picture 18.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M01/46/6A/ Wkiol1pyi8rqjc1paabteq60y3g146.jpg "alt=" Wkiol1pyi8rqjc1paabteq60y3g146.jpg "/>

650) this.width=650; "title=" Picture 19.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M02/46/68/ Wkiom1pyirldryzoaac9zbiplos981.jpg "alt=" Wkiom1pyirldryzoaac9zbiplos981.jpg "/>

650) this.width=650; "title=" Picture 20.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/46/68/ Wkiom1pyirpg6wbzaadt1iy1pi4712.jpg "alt=" Wkiom1pyirpg6wbzaadt1iy1pi4712.jpg "/>

Log on successfully for data sharing


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.