lamp
目录
1. lamp简介
lamp,其实就是由Linux+Apache+Mysql/MariaDB+Php/Perl/Python的一组动态网站或者服务器的开源软件
LAMP指的是Linux(操作系统)、Apache(HTTP服务器)、MySQL(也指MariaDB,数据库软件)和PHP(有时也是指Perl或Python)的第一个字母,一般用来建立web应用平台。
2. web服务器工作流程
web服务器的资源分为两种,静态资源和动态资源
静态资源:当我们获取它的时候,它里面的源的表现形式与原文件相同不会发生什么改变。
动态资源:程序文件,我们日常执行的命令在不同的主机里面执行出来的结果是不一样的
当我们在客户端访问web服务器资源的时候,前端会把这个请求转发给应用服务器这里,然后应用服务器会到数据库里面进行查询并反馈给前端,前端再反馈给客户端
3. lamp平台构建
环境说明:
系统平台 | IP | 需要安装的服务 |
---|---|---|
centos8 redhat8 | 192.168.222.250 | httpd-2.4,mysql5.7,php,phpmysql |
lamp平台软件安装次序:
httpd --> mysql --> php
注意:php要求httpd使用prefork MPM
3.1 安装httpd
yum源的配置:
[root@lnh ~]# cd /etc/yum.repos.d/
[root@lnh yum.repos.d]#rm -rf *
[root@lnh yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
//在阿里云网站里面复制的仓库链接
[root@lnh yum.repos.d]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@lnh yum.repos.d]# ls
CentOS-Base.repo
[root@lnh yum.repos.d]# yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
[root@lnh yum.repos.d]# sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
[root@lnh yum.repos.d]# sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
//安装epel源,也是在阿里云网站里面复制链接
[root@lnh yum.repos.d]# ls
CentOS-Base.repo epel.repo epel-testing.repo
epel-modular.repo epel-testing-modular.repo
[root@lnh yum.repos.d]# cat epel.repo //查看里面地址是否改变
[epel]
name=Extra Packages for Enterprise Linux 8 - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=https://mirrors.aliyun.com/epel/8/Everything/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch&infra=$infra&content=$contentdir
enabled=1
gpgcheck=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 8 - $basearch - Debug
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=https://mirrors.aliyun.com/epel/8/Everything/$basearch/debug
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-8&arch=$basearch&infra=$infra&content=$contentdir
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 8 - $basearch - Source
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place it's address here.
baseurl=https://mirrors.aliyun.com/epel/8/Everything/source/tree/
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-8&arch=$basearch&infra=$infra&content=$contentdir
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
gpgcheck=1
[root@lnh yum.repos.d]# dnf makecache //缓存一下
[root@lnh ~]# dnf groups mark install 'Development Tools'
//安装开发工具包
Last metadata expiration check: 0:03:41 ago on Tue 02 Aug 2022 09:17:12 PM CST.
Module yaml error: Unex