简介
该框架包括:Linux操作系统,Apache服务器,MySQL数据库,PHP及Python语言。
所组成产品均是开源,是国际上成熟的架构框架,很多流行的应用都是采取这个架构,和 Java/J2EE架构相比,LAMP具有Web资源丰富、轻量、快速开发等特点,LAMP具有通用、跨平台、高性能、低价格的优势,因此LAMP无论是性能、质量还是价格都是企业搭建网站的首选平台。
LAMP-Apache的安装
a、有部分linux版本中已经安装了apache,先检查系统中是否已经存在httpd的服务
#查看是否存在 存在的话根据自己电脑上的版本卸载
[root@localhost~]#rpm -qa|grep httpd
httpd-2.2.15-60.el6.centos.4.x86_64
httpd-tools-2.2.15-60.el6.centos.4.x86_64
#存在,请将apache停止服务并删除
service httpd stop
#删除:如果出错,是因为有依赖关系,必须先删除依赖的应用,但是我们也可以忽略 使用–nodeps 忽略依赖[root@localhost ]# rpm -e httpd-2.2.15-60.el6.centos.4.x86_64
error:Faileddependencies:httpd>=2.2.0isneededby(installed)gnome-user-share-2.28.2-3.el6.x86_64
[root@localhost]# rpm -e --nodeps httpd-2.2.15-60.el6.centos.4.x86_64
[root@localhost ~]# rpm -e --nodeps httpd-tools
b、 软件下载安装
需要分别下载Apache Http Server、APR和APR-util、PCRE并进行安装
接下来分别进行安装
1、首先要检测有没有gcc/gcc-c++,如果没有必须安装
[root@bogon ~]# gcc -v
使用内建 specs。
目标:x86_64-redhat-linux
配置为:…/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
–with-bugurl=http://bugzilla.redhat.com/bugzilla
–enable-bootstrap --enable-shared
–enable-threads=posix
–enable-checking=release
–with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
–enable-gnu-unique-object
–enable-languages=c,c++,objc,obj-c++,java,fortran,ada
–enable-java-awt=gtk --disable-dssi
–with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
–enable-libgcj-multifile --enable-java-maintainer-mode
–with-ecj-jar=/usr/share/java/eclipse-ecj.jar
–disable-libjava-multilib --with-ppl --with-cloog
–with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
#没有安装,则安装
yum install -y gcc-c++
2、下载并安装apr
#下载
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.5.tar.gz
#解压
tar -zxvf apr-1.6.5.tar.gz
#配置并编译安装
cd apr-1.6.5
./configure --prefix=/usr/local/apr
#–prefix 选择软件的安装路径
make
make install
3、安装apr-util
#安装前需要先安装expat 库,否则只会会报错
yum install expat-devel
#下载
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
#解压
tar -zxvf apr-util-1.6.1.tar.gz
#配置并编译安装
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
#–prefix 选择软件的安装路径 --with-apr选择依赖包的安装路径
make
make install
4、安装pcre
下载的网址 http://ftp.pcre.org/pub/pcre/
#解压
tar -zxvf pcre-8.42.tar.gz
#配置并编译安装
cd pcre-8.42
./configure --prefix=/usr/local/pcre --with-apr=/usr/local/apr/bin/apr-1-config
make
make install
5、安装apache
#下载
wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.38.tar.gz
#解压
tar -zxvf httpd-2.4.38.tar.gz
#配置并编译安装
cd httpd-2.4.38
./configure --prefix=/usr/local/apache --with-pcre=/usr/local/pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
make
make install