Dynamic Site Architecture Case

Source: Internet
Author: User

1 "Dynamic website Architecture:

Lamp (Linux+apache+mysql+php/python/perl) architecture is a powerful web site solution, LAMP is an acronym for multiple open source projects, the lamp site architecture is mainly applied to the Web architecture of Dynamic Web sites, this web framework is universal, Cross-platform, high-performance, high-load, stable and other characteristics, is currently the preferred platform for enterprise deployment site, at the same time, we also need to see nginx in the domestic application more and more mature, compared to Apache, nginx response to static files is much higher than the Apache server, So in recent years has also raised the LNMP architecture, but for the load PHP site, Apache is still the preferred product, we will be the actual deployment of two open source Web site projects to explain the actual application of lamp, two open source projects are written in PHP code, respectively, discuz! Forum and WordPress Blog system, the site architecture case structure through the domain name-based virtual host implementation on an Apache server running two different web platforms, forum domain name for bbs.example.com, blog domain name for blog.example.com;

2 "Forum System application Case:

Discuz! is currently the most widely used community forum platform, the use of discuz! can achieve a one-stop building station services, discuz! from 2001 release has gone through 16 years of development history, a large number of application cases to prove that the system's maturity, stability and load capacity are worthy of the letter In addition, because discuz! uses PHP language development, and open source code, so discuz! is also a PHP programmer to learn PHP code template;

The software environment required to deploy the discuz! forum includes: www server (e.g., Apache,nginx, etc.), PHP software package (version requires more than 4.3.0), MySQL database (version requires 3.23 and above), here will use the Lamp platform to implement the Forum system deployment, with The body steps are as follows;

1> Download Package:

#wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.27.tar.gz

#wget http://mirror.bit.edu.cn/apache/apr/apr-1.6.2.tar.gz

#wget http://mirror.bit.edu.cn/apache/apr/apr-util-1.6.1.tar.gz

#wget http://cdn.mysql.com/Downloads/MySQL/mysql-5.6.31.tar.gz

#wget http://cn2.php.net/get/php-5.3.13.tar.gz

2> Deploying the AMP Environment:

1) Extract all source packages to a specific directory:

[Email protected] ~]# TAR-XVF httpd-2.4.27.tar.gz-c/usr/local/src/

[Email protected] ~]# TAR-XVF apr-1.6.2.tar.gz-c/usr/local/src/

[Email protected] ~]# TAR-XVF apr-util-1.6.1.tar.gz-c/usr/local/src/

[Email protected] ~]# TAR-XVF mysql-5.6.31.tar.gz-c/usr/local/src/

[Email protected] ~]# TAR-XVF php-5.3.13.tar.gz-c/usr/local/src/

2) Install the dependent packages:

3) Install Apache HTTP Server Software (specific installation view blogger related blog):

[Email protected] ~]# cd/usr/local/src/
[Email protected] src]# CD apr-1.6.2
[Email protected] apr-1.6.2]#/configure--PREFIX=/USR/LOCAL/APR

[[email protected] apr-1.6.2]# make && make install

[Email protected] apr-1.6.2]# cd/usr/local/src/apr-util-1.6.1
[Email protected] apr-util-1.6.1]#/configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/

[[email protected] apr-util-1.6.1]# make && make install

[Email protected] httpd-2.4.27]#/configure--prefix=/usr/local/apache--enable-so--enable-ssl--enable-rewrite--                                                                                                     With-mpm=worker--with-suexec-bin--with- apr=/usr/local/apr/--with-apr-util=/usr/local/apr-util

[[email protected] httpd-2.4.27]# make && make install

4) Install MySQL database (specific installation instructions see blogger related blog):

[Email protected] mysql-5.6.31]# CD mysql-5.6.31

[[email protected] mysql-5.6.31]# Groupadd MySQL

[[email protected] mysql-5.6.31]# useradd-r-s/sbin/nologin-g MySQL MySQL

[Email protected] mysql-5.6.31]# CMake. -denable_downloads=1

[[email protected] mysql-5.6.31]# make && make install

[[email protected] mysql-5.6.31] #chown-R mysql.mysql/usr/local/mysql

[Email protected] mysql-5.6.31]#/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql /--datadir=/usr/local/mysql/data

[Email protected] mysql-5.6.31]# CP/USR/LOCAL/MYSQL/MY.CNF/ETC/MY.CNF

[Email protected] mysql-5.6.31]# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

[[Email protected] mysql-5.6.31]# service mysqld start
Starting MySQL. Determine

[Email protected] mysql-5.6.31]# chkconfig--add mysqld
[Email protected] mysql-5.6.31]# chkconfig mysqld on
[Email protected] mysql-5.6.31]# echo "/usr/local/mysql/lib/" >>/etc/ld.so.conf
[Email protected] mysql-5.6.31]# Ldconfig

5) Create a forum database:

Discuz is a dynamic Web site based on PHP, a lot of data need to be stored in the database, so we need to create a database in the MySQL database for the forum, and create a database management account and the secret Code:

[Email protected] ~]#/usr/local/mysql/bin/mysql-u root

6) Install the PHP program:

[Email protected] ~]# cd/usr/local/src/php-5.3.13
[Email protected] php-5.3.13]#/configure--prefix=/usr/local/php5--with-mysql=/usr/local/mysql/--with-apxs2=/                                                                                   Usr/local/apache/bin/apxs--enable-mbstring--enable- Sockets

[[email protected] php-5.3.13]# make && make install

[email protected] php-5.3.13]# CP Php.ini-development/usr/local/php5/lib/php.ini

Modify the Apache Master Profile httpd.conf to ensure that the file has the following two instructions, the function of the two instructions is to load the module and set the file type:

LoadModule Php5_module modules/libphp5.so

AddType application/x-httpd-php. php

7) test (server generated PHP test page, Client access to test page via IP address):

[Email protected] php-5.3.13]# echo "<?php phpinfo ();? > ">/var/www/html/index.php

[email protected] php-5.3.13]# Firefox http://172.31.16.234/index.php

3 "Initialize Forum system:

1> first modify the Apache configuration file, set the default home page to index.php via the DirectoryIndex index.php index.html directive, remove the main profile include conf/extra/ The "#" symbol before the httpd-vhosts.conf instruction, the include directive reads the contents of the httpd-vhosts.conf file as part of the main configuration file:

[[Email protected] ~] #vim/usr/local/apache/conf/extra/httpd-vhosts.conf

<virtualhost *:80>

ServerAdmin [email protected]

DocumentRoot "/usr/local/apache/htdocs/bbs"

ServerName bbs.example.com

Errorlog "Logs/bbs.example..com-error_log"

Customlog "Logs/bbs.example.com-access_log" common

</VirtualHost>

[[Email protected] ~] #mkdir-P/usr/local/apache/htdocs/bbs/logs

2> next need to download the discuz! software package from the Http://download.comsenz.com/DiscuzX/2.5/Discuz_X2.5_SC_UTF8.zip, Download and unzip the files in the upload to the BBS directory:

[Email protected] src]# Mkdir/usr/local/src/discus

[Email protected] src]# Unzip discuz_x2.5_sc_utf8.zip-d/usr/local/src/discus/

[Email protected] src]# cp-r/usr/local/src/discus/upload/*/usr/local/apache/htdocs/bbs

[[email protected] src]# chmod-r 777/usr/local/apache/htdocs/bbs/{config/,data}

[Email protected] src]# chmod-r 777/usr/local/apache/htdocs/bbs/uc_client/data/cache

[Email protected] src]# chmod-r 777/usr/local/apache/htdocs/bbs/uc_server/data/

[[email protected] src]# iptables-i input-p TCP--dport 80-j ACCEPT
[[Email protected] src]# service Iptables Save

[Email protected] src]#/usr/local/apache/bin/apachectl restart

3> Finally, the client accesses the Http://bbs.example.com/install through the browser, completes the initialization operation, figure one to figure four shows the entire initialization process, where figure II is the installation environment check, including PHP version, disk space , File and directory permissions, check that no problem will show the tick, the problematic item is marked as a fork, only after fixing the problem can continue to complete the following operations, figure IV needs to fill in the database information, including database name, account and password information, so you need to advance in the MySQL database system To create the corresponding database and account password information, the Administrator password for the forum Administrator password;

                

After completing the above initialization, it is important to remove/usr/local/apache/htdocs/bbs/install/index.php to prevent multiple initialization operations, at which point the client accesses the forum domain name via the browser: http://bbs.example.com, you can login to the Forum home page, first login contains only a default plate;

4 "Forum system settings:

After the initialization of the Forum, and there is no specific section of the content, the administrator can login backstage to do some global, plate, content, user and other settings, login to the Forum home page click on the top right of the Admin center to enter the administrator account and password can enter the background management interface;

Global menu: Including site information, forum registration and access control, site functions, Performance and SEO optimization, user rights, forum points, anti-drip, upload and watermark settings;

Interface menu: Including Forum home page, navigation bar, site style, forum expression management, prompting messages and pop-up messages and other settings;

Content menu: Including post audit, forum theme Management, batch deletion, batch group management, language filtering, post optimization, log management, photo album and image management settings;

User menu: Including user groups, management groups, prohibit users, prohibit IP, bonus rewards and punishments, audit users, recommend attention and friends and other settings;

Forum Menu: including plate management, plate merging and classification information set, plate structure for partition plus plate design, a partition can create a plurality of plate content;

Dynamic Site Architecture Case

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.