Data packet transmission in LAMP Architecture

Source: Internet
Author: User

After the customer enters the website address in the browser, DNS resolution is performed first. After the client obtains the IP address corresponding to the website address, the browser sends the customer request to the server apache). When apache receives the customer request, will look for the page requested by the customer. If the page is an html file, the code of the page is passed to the client, which is translated and displayed by the browser of the client. If the page requested by the client is a file that cannot be explained by apache, apache searches for the module required to explain the file in the configuration file and requests the module to explain the page. When the user request is a php file, apache obtains the module name required to explain the php file through the configuration file. At this time, apache sends a request to the php module to explain its page. When a single php receives the request, then, execute the php code on the php page and feed back the html code of the execution result to apache, while apache returns the feedback to the user, which is translated by the user's browser and displayed to the user. When the php code is executed, if the php code needs to be called to the mysql database, the php module will execute the Connection database command mysql_connect ("SQLhostIP ", "username", "passwd");) when the database connection is complete, php sends its own request to the mysql server, the mysql server executes the request to query or modify the content in the database. After the query or modification is completed, mysql returns the query results or modifications to php, in php, different php codes are interpreted as html code and fed back to the apache server. These are all my own ideas, and there will certainly be some errors, and the statement organization is also very scum. Let's take a look at this. Don't take it seriously. Du Niang has a picture. You can refer to it. This is a LAMP architecture diagram, but it can also explain the relationship between data requests in LAMP.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/025A212U-0.jpg "border =" 0 "alt =" "/>

@ Du Niang the PHP application obtains information from the client through the requested URL, all form data, and any captured session information to determine what operations should be performed. If necessary, the server will also run from the MySQL database on Linux), combine the information with some Hypertext Markup LanguageHTML templates, and return the results to the client. This process is repeated when a user directs an application. When multiple users access the system, this process is performed concurrently. However, the data stream is not unidirectional, because the database can be updated with information from the user, including session data, statistical data including voting) and user-submitted content such as comments or site updates ). In addition to dynamic elements, there are also static elements, such as images, JavaScript code, and Cascading Style Sheet CSS ). LAMP Architecture Uses Open-source software packages such as Linux + Apache + MySql + PHP/Python/Perl to build dynamic websites or servers. Linux is a free open-source software, which means that the source code is available in the operating system. Apache is the most popular open source WEB server software. MySQL is a multi-threaded, multi-user SQL database management system. MySQL is already purchased by Oracle from SUN in January 27, 2010. SUN initially acquired MySQL in February 26, 2008. PHP, Perl, or Python PHP is a programming language originally designed to produce dynamic websites. PHP is mainly used for server applications. Perl is similar to Python. Typical LAMP architecture website: Ghost + ghost + LighttpdMySQL + ghost LinuxApacheMySQL + MemcachedPHP + PerlSinaFreeBSD + SolarisApache + NginxMySQL + MemcachedPHPYouTubeSuse LinuxApache + LighttpdMySQLPython

 

This article is from the "smileliuyb" blog, please be sure to keep this source http://smileliuyb.blog.51cto.com/6235781/1102654

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.