当前位置:网站首页>Lamp architecture that your girlfriend can read
Lamp architecture that your girlfriend can read
2022-06-23 16:39:00 【User 7353950】
1、LAMP What do they stand for
•L Use... On behalf of the server operating system Linux
•A On behalf of the website service, we use Apache In the software foundation httpd Software for
•M When representing the database used in the background of the website MySQL database
•P The representative website is using PHP/Perl/Python Wait for language development
2、Apache/MySQL/PHP What is the function of each
Said in the previous :
We can LAMP Architecture is understood as a hotel ! The hotel ! The hotel !
Our restaurant is very special , Our little sister at the front desk is very beautiful , Our waiter and chef are ugly
Waiters and chefs are so ugly that they can't be seen ( Self brain tonic ), So when you go to the hotel, you can only see the little sister at the front desk
㈠ Chat Apache(httpd)
• It looks like the front desk
• effect : Provide web service , Accept the user's connection request !
Be careful :Apache or Nginx Only static page parsing is supported
When the client requests static resources ,web service (httpd Program ) It will directly return static resources to the client
① Static web page
• Static web pages refer to the use of HTML( Hypertext markup language ) To write , The general suffix is .htm、.html etc. ; There is no program code in the web page file
• Static web page , The user double clicks to open , See the effect and web The server is the same , Because the content of the web page is before the user visits , That's for sure
② Dynamic web pages
• Dynamic web pages refer to websites written in a specific programming language , In the web file except HTML Beyond the mark , It also includes some program code to realize specific functions
• The server can dynamically generate web page content according to different requests of the client
• Dynamic web page suffix is generally .php、.asp、.aspx、cgi、.perl、.jsp etc.
• Common message boards 、 Forum 、 register 、 Posting is realized by dynamic web pages
③ Summary
1) What is? web service ?
answer : A web service that provides Web browsing .
Installed web Service software such as ,httpd/nginx Such as software , And start the . Customers can access the website through the browser .
2) What is? Web The server ?
answer : To understand it simply is to install web Service Software , And can provide Web Machines served .
3)Web It is generally divided into client and server , How do the two interact ?
answer : adopt HTTP agreement http://www.itcast.cn
4)Apache(httpd) Function and characteristics of ?
answer :Apache Used to accept user connection requests ; Only responsible for static page parsing .
㈡ Chat PHP
• Like a waiter
• effect :PHP Mainly responsible for PHP The analysis and implementation of script program MySQL Database interaction , Registration in our project / Sign in / Place an order / Most functions such as payment are based on PHP+MySQL To implement .PHP Is a general open source scripting language .
1. When the client requests a dynamic resource ,Apache(httpd Program ) Would call libphpX.so Module for corresponding analysis
2. If the parsing process needs to use the relevant data of the background database , here php The program will also connect to the background database
3. Final php The program returns the parsed results to Apache(httpd Program ), Give Way Apache Return to the client
㈢ Chat MySQL
• Like a chef
• effect :MySQL Is a relational database management system , The Swedish MySQL AB Companies to develop , At present belongs to the Oracle Its products . Its main function is to store data permanently .
3、LAMP What is architecture
• It's like a hotel
( One )Apache It's like a hotel front desk , Specifically used to accept customer requests , And do some static page processing ( Buy only drinks )
( Two )PHP It's like a server , It is specially used to parse and handle what cannot be handled by the front desk ” Order ”, If the user wants to eat a bowl of spaghetti , The waiter needs to communicate with the kitchen , And make corresponding arrangements . Then return the processed result to the foreground , The front desk will give it to the user , Because the waiter is so ugly , No one can see .
( 3、 ... and )MySQL It looks like a kitchen , It is specially used for storing food materials , And only the middle waiter can communicate with the kitchen , To get what ingredients
• The professional explanation is as follows
( One ) Client sends request connection web Server's 80 port , from Apache Respond to and process the user's static requests
( Two ) If the client requests dynamic resources , from Apache Load calls libphpX.so modular ( install php Program bring ) Do parsing
( 3、 ... and ) If the processing needs to communicate with the background database , So by the php Program to complete
( Four )Php The program returns the processed results to Apache, from Apache Return to the client
Two 、 One key deployment LAMP Environmental Science
Environmental statement : The current system version is RedHat8.0 System
1、 Basic environment configuration
㈠ Close the firewall and selinux
Turn off firewall temporarily
[[email protected] ~]# systemctl stop firewalld.service
The next boot will not start automatically
[[email protected] ~]# systemctl disable firewalld.service
[[email protected] ~]# systemctl list-unit-files |grep firewalld
firewalld.service disabled
close selinux
[[email protected] ~]# setenforce 0
[[email protected] ~]# getenforce
Permissive
[[email protected] ~]# vim /etc/selinux/config
...
SELINUX=disabled
....
㈡ Configure the local software warehouse
Manually mount the disc locally /mnt Next
[[email protected] ~]# mount -o ro /dev/sr0 /mnt
Boot up automatically
[[email protected] ~]# echo "mount -o ro /dev/sr0 /mnt" >> /etc/rc.local
[[email protected] ~]# chmod +x /etc/rc.d/rc.local
Modify the configuration file to specify the software warehouse
[[email protected] ~]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# cat local.repo
[BaseOS]
name=BaseOS yum
baseurl=file:///mnt/BaseOS/
enabled=1
gpgcheck=0
[App]
name=Appstream yum
baseurl=file:///mnt/AppStream/
enabled=1
gpgcheck=0
2、 One click build LAMP Environmental Science
㈠ install Apache(httpd) Software
explain :RedHat8 Default by oneself httpd-2.4.37 edition
[[email protected] ~]# yum install httpd -y
㈡ install PHP Related software
explain :RedHat8 Default php-7.2 edition
yum -y install php-xml-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-json-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-mysqlnd-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-common-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-fpm-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-bcmath-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-cli-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-gd-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-pdo-7.2.11-1.module+el8+2561+1aca3413.x86_64
php-devel-7.2.11-1.module+el8+2561+1aca3413.x86_64
㈢ install Mariadb Database software
explain : from RedHat7 in the future , System default Mariadb database
[[email protected] ~]# yum install mariadb-server mariadb
3、 Start the corresponding service
㈠ Start the background database
[[email protected] ~]# systemctl start mariadb.service
[[email protected] ~]# systemctl enable mariadb.service
[[email protected] ~]# netstat -nltp|grep 3306
tcp6 0 0 :::3306 :::* LISTEN 45368/mysqld
[[email protected] ~]# mysqladmin -u root password '123'
㈡ Start the front end web service
[[email protected] ~]# systemctl start httpd.service
[[email protected] ~]# systemctl enable httpd.service
[[email protected] conf]# netstat -nltp|grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 45593/httpd
4、 Test whether it can be parsed php page
[[email protected] ~]# vim /var/www/html/index.php
[[email protected] ~]# cat /var/www/html/index.php
<?php
phpinfo();
?>
3、 ... and 、 Online shopping mall project
1、 Upload the website source code to web The server
[[email protected] ~]# mkdir /lamp
[[email protected] ~]# ls /lamp/
phpshe1.7.zip
2、 Unzip and copy it to the specified location
• Unzip and copy the source file of the website to the specified location
[[email protected] ~]# cd /lamp/
[[email protected] lamp]# unzip phpshe1.7.zip
[[email protected] lamp]# mv phpshe1.7/* /var/www/html/
• Change the permission of the source file of the website
[[email protected] lamp]# chown -R apache.apache /var/www/html/
3、 Install mall system
http://192.168.159.100/install
4、 restart web service ( Optional )
Four 、 Test verification
1、 Front desk visit
http://192.168.159.100
2、 Backstage access
http://192.168.159.100/admin.php
边栏推荐
- ADC数字地DGND、模拟地AGND的谜团!
- The R language uses the RMSE function of the yardstick package to evaluate the performance of the regression model, the RMSE of the regression model on each fold of each cross validation (or resamplin
- SaaS cloud tool, a sharp tool for change under the industrial Internet
- Implementation of golang bubble sort code
- 泰山OFFICE技术讲座:使用字体斜体的四种情形
- Solution: in the verification phase, the first batch does not report errors, and the second batch reports CUDA exceeded errors
- Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
- Improving efficiency or increasing costs, how should developers understand pair programming?
- leetcode:30. 串联所有单词的子串【Counter匹配 + 剪枝】
- R语言使用magick包的image_scale函数对图像进行缩放(resize)、可以自定义从宽度或者高度角度进行缩放
猜你喜欢

再突破!阿里云进入Gartner云AI开发者服务挑战者象限

Counter attack by flour dregs: MySQL 66 question! Suggested collection

npm install 问题解决(nvm安装与使用)

科大讯飞神经影像疾病预测方案!
![[solution] NPM warn config global ` --global`, `--local` are deprecated Use `--location=global`](/img/14/a2b3df1e8d0cf06ec96d6df9104a4a.png)
[solution] NPM warn config global ` --global`, `--local` are deprecated Use `--location=global`
![Leetcode: question d'entrevue 08.13. Empiler la boîte [DFS en haut + mémoire ou tri en bas + DP]](/img/22/220e802da7543c2b14b7057e4458b7.png)
Leetcode: question d'entrevue 08.13. Empiler la boîte [DFS en haut + mémoire ou tri en bas + DP]

A tour of grpc:01 - Basic Theory

JS常见的报错及异常捕获

Golang data type diagram

JS common error reporting and exception capture
随机推荐
泰山OFFICE技术讲座:使用字体斜体的四种情形
科大讯飞神经影像疾病预测方案!
读书郎通过上市聆讯:平板业务毛利率走低,2021年利润同比下滑11%
安全舒适,全新一代奇骏用心诠释老父亲的爱
ABP框架之——数据访问基础架构(下)
ELK日志收集系统部署
How to configure PostgreSQL data source on SSRs page
再突破!阿里云进入Gartner云AI开发者服务挑战者象限
R语言使用tidyquant包的tq_transmute函数计算持有某只股票的天、月、周收益率、ggplot2使用条形图(bar plot)可视化股票月收益率数据、使用百分比显示Y轴坐标数据
SaaS cloud tool, a sharp tool for change under the industrial Internet
leetcode:面试题 08.13. 堆箱子【自顶而下的dfs + memory or 自底而上的排序 + dp】
Code implementation of golang binary search method
Coatnet: marrying revolution and attention for all data sizes
R language uses the image of magick package_ The scale function resizes the image. You can customize the scaling from the angle of width or height
Innovation strength is recognized again! Tencent security MSS was the pioneer of cloud native security guard in 2022
Image saving: torchvision utils. save_ image(img, imgPath)
Batch registration component
Thinking analysis of binary search method
R language uses colorblinr package to simulate color blind vision, and uses edit to visualize the image of ggplot2_ The colors function is used to edit and convert color blindness into visual results
Can the hbuilderx light theme be annotated?