LAMP

本文详细介绍了通过RPM包方式安装LAMP环境的过程,包括基于域名的虚拟主机配置,以及如何部署PhpMyAdmin、WordPress和Discuz等应用。同时,探讨了HTTP的工作原理和通信流程,深入讲解了从地址解析到TCP连接建立的全过程。

1、讲述httpd工作原理以rpm包的方式安装LAMP,配置基于域名的虚拟机主机并部署PhpMyAdmin、WordPress(提供https)、discuz

Httpd:HyperText Transer Protocol,超文本传输协议

HTTP服务通信过程

http的工作原理
客户机与服务器建立连接后,发送一个请求给服务器,请求格式为:统一资源标识符、协议版本号。
服务器接收到请求后,给予相应的响应信息,格式为一个状态行(包括响应行,响应头,响应体)。

在internet上,http通讯通常发生在TCP/IP连接之上。缺省端口是TCP的80端口。HTTP是应用层的协议。

HTTP的工作过程:
一次HTTP操作称为一个事务,其工作整个过程如下:
1)、地址解析
如用客户端浏览器请求这个页面:http://localhost.com:8080/index.htm
从中分解出协议名、主机名、端口、对象路径等部分,对于我们的这个地址,解析得到的结果如下:
协议名:http
主机名:localhost.com
端口:8080
对象路径:/index.html
在这一步,需要域名系统DNS解析域名localhost.com,得主机的IP地址。

DNS解析的话
1、先在本机/etc/hosts(优先级最高)里面寻找域名对应IP地址,
2、再找/etc/resolv.conf里写的域DNS解析服务器
3、还是没有的话就到公网里寻找DNS服务器了

2)、封装HTTP请求数据包
把以上部分结合本机自己的信息,封装成一个HTTP请求数据包

3)封装成TCP包,建立TCP连接(TCP的三次握手)

4)客户机发送请求命令
建立连接后,客户机发送一个请求给服务器,请求方式的格式为:统一资源标识符(URL)、协议版本号,后边是MIME信息包括请求修饰符、客户机信息和可内容。

5)服务器响应
服务器接到请求后,给予相应的响应信息,其格式为一个状态行,包括信息的协议版本号、一个成功或错误的代码,后边是MIME信息包括服务器信息、实体信息和可能的内容。
实体消息是服务器向浏览器发送头信息后,它会发送一个空白行来表示头信息的发送到此为结束,接着,它就以Content-Type应答头信息所描述的格式发送用户所请求的实际数据

6)服务器关闭TCP连接
一般情况下,一旦Web服务器向浏览器发送了请求数据,它就要关闭TCP连接,然后如果浏览器或者服务器在其头信息加入了这行代码
Connection:keep-alive
TCP连接在发送后将仍然保持打开状态,于是,浏览器可以继续通过相同的连接发送请求。保持连接节省了为每个请求建立新连接所需的时间,还节约了网络带宽。

服务器将响应信息传给客户端,响应体中的内容可能是一个html页面,也可能是一张图片,通过输入流将其读出,并写回到显示器上。

restart:先stop 再 start,就像关闭浏览器再打开一样。

PhpMyAdmin
yum install php















WordPress






discuz


安装完记得取消acl权限



取消acl权限

2、编译安装LAMP且PHP以FASTCGI的方式工作并使用XCache为php加速



.7编译httpd



后面应该是两个& 不然就是放在后台执行了


.17二进制编译mariadb











.7启动服务

建立apache用户




.7编译fastcgi方式的php










可以不修改



安装WordPress









apachectl stop
apachectl start

XCache为php加速














03-08
### LAMP Stack Information #### Definition of LAMP Stack The term **LAMP** stands for Linux, Apache, MySQL (or MariaDB), and PHP. This combination forms a powerful platform for developing dynamic websites and applications[^2]. #### Components Overview - **Linux**: The operating system layer which provides the foundation on which all other components run. - **Apache HTTP Server**: A robust, commercial-grade, featureful, and freely-available source code implementation of an HTTP (Web) server. After setting up, one can verify successful installation by accessing `http://<Your_IP_Address>/` through any web browser[^4]. - **MySQL or MariaDB Database Management System**: Used as the database management component responsible for managing data storage and retrieval. - **PHP Scripting Language**: An open-source general-purpose scripting language particularly suitable for web development due to its ability to be embedded within HTML. For enhancing functionality like handling URLs via network protocols, enabling specific modules such as cURL might become necessary; this requires modification in the configuration file (`php.ini`) followed by restarting the Apache service using commands similar to `sudo systemctl restart apache2`[^3]. #### Configuration Steps Post Installation Once these elements are properly configured together forming what's known as a 'stack', further steps involve configuring virtual hosts under Apache settings so that directories intended for hosting sites' contents get correctly mapped out ensuring optimal performance when serving pages over HTTP requests made against those locations specified during setup procedures[^1]. ```bash # Restart Apache Service Command Example sudo systemctl restart apache2 ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值