Deploy social networking sites

Source: Internet
Author: User
Tags php server svn client nginx server

Project case: Deploying social networking sites

This project is to build a dynamic Web server platform, running social networking sites (for example: Renren, net, Tianya forum). Relevant knowledge points are involved in the previous course, today's experiment is a comprehensive application, reflecting the real project implementation process and ideas. This experiment has a new knowledge point, is the SVN server, SVN server can be unified storage programmer development Code, to avoid code confusion, it is easy to say that SVN is used for many people to jointly develop the same project, the purpose of sharing resources, a bit similar to the file server, but more secure than the file server, It is advantageous for many people to maintain, avoids the work coordination to appear the problem. In addition, our environment today is to realize the separation of Nginx, PHP, MySQL, which helps to optimize the environment, improve performance and security.

I. Description of the project
1. Build SVN server
2. Deploy Nginx server to handle static Web pages
3. Deploy PHP server to handle Dynamic Web pages
4. Deploy MySQL server for dynamic site database storage
5, configure Nginx and PHP, use SVN to publish the development of a good website
6. Browse the website on the client

Second, the experimental topology

650) this.width=650; "title=" 2017-09-28_102838.png "alt=" wkiom1nmxurwxubhaabn6xzs4l4229.png-wh_50 "src=" https:// "/>

Third, build SVN server

1. Install SVN (default already installed)

650) this.width=650; "title=" 2017-09-28_103143.png "alt=" wkiol1nmxw3yhzqzaabjfavhx10453.png-wh_50 "src=" https:// "/>

2. Create a warehouse directory for PHP programmers repo (for unified storage development data)

650) this.width=650; "title=" 2017-09-28_103217.png "alt=" wkiom1nmx2jixzqgaabu9amuvzq589.png-wh_50 "src=" https:// "/>

3. Adjust SVN parameters

650) this.width=650; "title=" 2017-09-28_103430.png "alt=" wkiom1nmx_krm30raaa4ontqemu950.png-wh_50 "src=" https:// "/>

650) this.width=650; "title=" 2017-09-28_103514.png "alt=" wkiom1nmybrapjaxaagszyqrupe272.png-wh_50 "src=" https:// "/>

Anon-access = none//anonymous user does not have any permissions
auth-access = write//authenticated user has Write permission
PASSWORD-DB =/OPT/SVN/REPO/CONF/PASSWD//user's password file
AUTHZ-DB =/opt/svn/repo/conf/authz//user information file

4. Start SVN service (Stop svnserve using killall-9 svnserve)

650) this.width=650; "title=" 2017-09-28_103557.png "alt=" wkiom1nmyesimwydaabif3lsiys314.png-wh_50 "src=" https:// "/>

5, for PHP programmer Ydw Set up a user, configure the Repo warehouse has read and write permissions, and the account information and warehouse directory feedback to the PHP programmer.

650) this.width=650; "title=" 2017-09-28_103635.png "alt=" wkiom1nmygqqed1caabdsidda44418.png-wh_50 "src=" https:// "/>

Create an account password file for authentication during client synchronization

650) this.width=650; "Width=" 526 "height=" 422 "title=" 2017-09-28_103736.png "style=" WIDTH:404PX;HEIGHT:349PX; "alt=" Wkiom1nmylqjoochaaavkqvq18c391.png-wh_50 "src=" Wkiom1nmylqjoochaaavkqvq18c391.png-wh_500x0-wm_3-wmp_4-s_3490918985.png "/>

Create permission profiles, set read and Write permissions

650) this.width=650; "title=" 2017-09-28_103842.png "alt=" wkiom1nmyoqbmox_aaatxtfgjwu025.png-wh_50 "src=" https:// "/>

650) this.width=650; "width=" 525 "height=" 357 "title=" 2017-09-28_103915.png "style=" WIDTH:424PX;HEIGHT:317PX; "alt=" Wkiol1nmymujdga_aaanz5v9ofm119.png-wh_50 "src=" Https:// Aaanz5v9ofm119.png-wh_500x0-wm_3-wmp_4-s_2649346503.png "/>

Create a subdirectory of the user store development data webphp, and initialize the SVN directory

650) this.width=650; "title=" 2017-09-28_104011.png "alt=" wkiom1nmyuahtkd6aabomwsixmw608.png-wh_50 "src=" https:// "/>

Installing the SVN client software on Win7

650) this.width=650; "Width=" 526 "height=" 413 "title=" 2017-09-28_104048.png "style=" WIDTH:371PX;HEIGHT:316PX; "alt=" Wkiom1nmyhdjtolqaac9r0au_ba711.png-wh_50 "src=" Ba711.png-wh_500x0-wm_3-wmp_4-s_54767509.png "/>

To open the software:

650) this.width=650; "Width=" 526 "height=" 522 "title=" 2017-09-28_104100.png "style=" width:488px;height:345px; "alt=" Wkiol1nmyekq1cfdaaa850-kdyy229.png-wh_50 "src=" Wkiol1nmyekq1cfdaaa850-kdyy229.png-wh_500x0-wm_3-wmp_4-s_4143443084.png "/>

Enter the SVN server address

650) this.width=650; "title=" 2017-09-28_104112.png "alt=" wkiom1nmyjecgaukaaat-ed5z34957.png-wh_50 "src=" https:// "/>

650) this.width=650; "title=" 2017-09-28_104219.png "alt=" wkiom1nmykorlmjaaabvveql8-e990.png-wh_50 "src=" https:// "/>

Make a Web page with Notepad on Win7 test1.html

650) this.width=650; "title=" 2017-09-28_104454.png "alt=" wkiol1nmyicwexiaaaapeyoaiea283.png-wh_50 "src=" https:// "/>

and drag it to the webphp folder

650) this.width=650; "title=" 2017-09-28_104523.png "alt=" wkiol1nmyjvsdmxeaab9s3qmqzy455.png-wh_50 "src=" https:// "/>

Synchronizing on an nginx server

650) this.width=650; "title=" 2017-09-28_104600.png "alt=" wkiom1nmyp_g_s6waae6n8n95oy979.png-wh_50 "src=" https:// "/>

Synchronizing on a PHP server

650) this.width=650; "title=" 2017-09-28_104647.png "alt=" wkiom1nmytjgqa2paafebtqvkmo433.png-wh_50 "src=" https:// "/>

As you can see, it has been synchronized from SVN server to Nginx and PHP server

Iv. deployment of Nginx server
1. Installing Nginx Server

650) this.width=650; "title=" 2017-09-28_104735.png "alt=" wkiom1nmywcs1to7aaa8adwtfx0462.png-wh_50 "src=" https:// "/>

650) this.width=650; "title=" 2017-09-28_104830.png "alt=" wkiol1nmy7tgs0hwaadxtfoztoe859.png-wh_50 "src=" https:// "/>

650) this.width=650; "title=" 2017-09-28_104858.png "alt=" wkiol1nmy7_jtosfaaau8ajfe5m355.png-wh_50 "src=" https:// "/>

2. Modify Nginx Configuration
1) Configure the FastCGI access interface for the back-end PHP Program

or yum install vim/usr/local/nginx/cond/defautlt.conf

650) this.width=650; "title=" 2017-09-28_105241.png "alt=" wkiom1nmzdcs3_akaabo6geozvy232.png-wh_50 "src=" https:// "/>

650) this.width=650; "title=" 2017-09-28_105321.png "alt=" wkiom1nmzfyrfkuqaadnin0ldxk657.png-wh_50 "src=" https:// "/>

2) Optimize and open the service

650) this.width=650; "title=" 2017-09-28_105401.png "alt=" wkiol1nmzetbssixaacvonhpzxu938.png-wh_50 "src=" https:// "/>

V. Deployment of PHP Server
1. Install PHP
1) Install the support package

650) this.width=650; "title=" 2017-09-28_105450.png "src=" Wkiol1nmzkixn7ncaadjhn4poic194.png-wh_500x0-wm_3-wmp_4-s_2949951486.png "alt=" Wkiol1nmzkixn7ncaadjhn4poic194.png-wh_50 "/>

2) Create a user

3) Copy the MySQL module to/usr/lib (because PHP defaults to/usr/lib search

4) Compile and install PHP

650) this.width=650; "title=" 2017-09-28_105636.png "src=" Wkiom1nmzr7tv5-xaadkiys0y1g669.png-wh_500x0-wm_3-wmp_4-s_3216809905.png "alt=" Wkiom1nmzr7tv5-xaadkiys0y1g669.png-wh_50 "/>

650) this.width=650; "title=" 2017-09-28_105740.png "src=" Jidaabf3c6fef4497.png-wh_500x0-wm_3-wmp_4-s_492439555.png "alt=" Wkiom1nmzwqs_jidaabf3c6fef4497.png-wh_50 "/>

650) this.width=650; "title=" 2017-09-28_105832.png "src=" Wkiom1nmzzgsrma6aabhef3j1ma148.png-wh_500x0-wm_3-wmp_4-s_1739550017.png "alt=" Wkiom1nmzzgsrma6aabhef3j1ma148.png-wh_50 "/>

650) this.width=650; "title=" 2017-09-28_105909.png "src=" Wkiol1nmzxxc3poyaabz9ofeobu491.png-wh_500x0-wm_3-wmp_4-s_692247512.png "alt=" Wkiol1nmzxxc3poyaabz9ofeobu491.png-wh_50 "/>

3. Start PHP-FPM

650) this.width=650; "title=" 2017-09-28_105952.png "src=" Wkiom1nmzegsd9tkaabm8cv-cn0884.png-wh_500x0-wm_3-wmp_4-s_837533050.png "alt=" Wkiom1nmzegsd9tkaabm8cv-cn0884.png-wh_50 "/>

4. Create a website home directory and write a PHP test page

650) this.width=650; "title=" 2017-09-28_110034.png "src=" N9zaaaohnxaz5o423.png-wh_500x0-wm_3-wmp_4-s_483889113.png "alt=" Wkiol1nmzcrz_n9zaaaohnxaz5o423.png-wh_50 "/>

5. Visit the test page

650) this.width=650; "title=" 2017-09-28_110108.png "src=" Wkiol1nmze3d3vq4aackmimk678929.png-wh_500x0-wm_3-wmp_4-s_156973217.png "alt=" Wkiol1nmze3d3vq4aackmimk678929.png-wh_50 "/>

6, then in the Nginx website home directory to make static Web page index.html

650) this.width=650; "title=" 2017-09-28_110215.png "src=" Wkiol1nmzjijw99oaadjkbpiyo0717.png-wh_500x0-wm_3-wmp_4-s_143090188.png "alt=" Wkiol1nmzjijw99oaadjkbpiyo0717.png-wh_50 "/>

The static webpage is handled by Nginx server, and the dynamic webpage is processed by PHP server, which realizes the separation of motion and movement.

VI. deployment of MySQL server
Installation steps are slightly (exactly the same as the previous installation)
Note: If you are deploying a Web site, you need to create a database on the MySQL server and authorize
Create Database xxx
Grant all privileges the xxx.* to ' php ' @ ' 192.168.0.% ' identified by ' 123456 '

Seven, take the Discuz forum as an example, deployed on the platform, and finally able to browse
Procedure (refer to the previous document)

Note: Usually Web site developers to modify the Web page generally operating on the Windows system, modified after the completion of the SVN server passed to Nginx and PHP.

This article from "Li Shilong" blog, declined reprint!

Deploy social networking sites

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: 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.