LAMP企业架构

简介
该框架包括:Linux操作系统,Apache服务器,MySQL数据库,PHP及Python语言。
所组成产品均是开源,和 Java/J2EE架构相比,LAMP具有Web资源丰富、轻量、快速开发等特点
LAMP优势:通用、跨平台、高性能、低价格
LAMP-Apache的安装:
软件下载安装
需要分别下载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
6、Apache设置为linux系统服务,并开机启动
a、将apache启动脚本复制到系统服务目录
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
#把文件复制到另外一个文件身上,这相当于,复制重命名
b、添加apache的环境变量
echo -e ‘\nexport PATH=/usr/local/apache/bin:/usr/local/apache/lib:$PATH\n’ >> /etc/profile
source /etc/profile
c、加入自启动服务
#编辑启动脚本
vim /etc/rc.d/init.d/httpd
#给脚本中添加注释
#chkconfig:2345 64 36
#当进行chkconfig --add httpd操作时,如果没有指定level那么就会来这个注释中取值
#添加到自启服务列表并开启自启
chkconfig --add httpd
chkconfig httpd on
d、修改配置文件
#编辑httpd.conf 文件
vim /usr/local/apache/conf/httpd.conf
#将ServerName前面的#去掉,
#ServerName www.example.com:80
e、启动服务
[root@localhost]# service httpd start
Starting httpd: [ OK ]
访问Apache服务器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值