lamp平台部署
LAMP简介
LAM(M)P:
L:linux
A:apache (httpd)
M:mysql, mariadb
M:memcached(缓存数据库数据)
P:php, perl, python
WEB资源类型:
静态资源:原始形式与响应内容一致,在客户端浏览器执行
动态资源:原始形式通常为程序文件,需要在服务器端执行之后,将执行结果返回给客户端
注:动静资源不是视觉上的动和静,而是看服务器端的文件和客户端看到的文件是否相同。右键单击看源代码和服务器的资源文件内容一样==>静态资源。
Web相关语言
客户端技术: html,javascript,css,jpg等
服务器端技术:php, jsp,python,asp,perl等
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-YF4fDvCf-1632401865357)(https://s3.bmp.ovh/imgs/2021/09/843492fb72c83028.png)]
lamp平台部署步骤
环境说明
系统平台 | IP | 需要安装的服务 |
---|---|---|
centos8 | 192.168.240.60 | httpd-2.4 mysql-5.7 phpbr php-mysql |
lamp平台软件安装次序:
httpd --> mysql --> php
安装httpd
##准备安装包与依赖包
[root@localhost lamp]# ls
apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.48.tar.gz
[root@localhost lamp]# yum -y install mark 'Development Tools' openssl-devel pcre-devel expat-devel libtool gcc gcc-c++
##创建用户和组
[root@localhost lamp]# useradd -r -M -s /sbin/nologin apache
[root@localhost lamp]# id apache
uid=993(apache) gid=990(apache) 组=990(apache)
##将安装包进行解压
[root@localhost lamp]# tar xf apr-1.7.0.tar.gz -C /usr/local/
[root@localhost lamp]# tar xf apr-util-1.6.1.tar.gz -C /usr/local/
[root@localhost lamp]# tar xf httpd-2.4.48.tar.gz -C /usr/local/
[root@localhost lamp]# ls /usr/local/
apr-1.7.0 bin games include lib64 sbin src
apr-util-1.6.1 etc httpd-2.4.48 lib libexec share
##将$RM "$cfgfile" 删除
[root@localhost local]# cd apr-1.7.0/
[root@localhost apr-1.6.5]# vim configure
cfgfile="${ofile}T"
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
##编译安装
[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr
[root@localhost apr-1.6.5]# make && make install
[root@localhost apr-1.7.0]# cd ../apr-util-1.6.1/
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@localhost apr-util-1.6.1]# make && make install
[root@localhost apr-util-1.6.1]# cd ../httpd-2.4.48/
[root@localhost httpd-2.4.48]# ./configure --prefix=/usr/local/apache \
> --enable-so \
> --enable-ssl \
> --enable-cgi \
> --enable-rewri