手动部署lamp(最新版本)

lamp部署

lamp平台软件安装次序:

httpd-->mysql-->php
顺序很重要,不能颠倒顺序

安装httpd

//下载安装包并解压
[root@localhost src]# wget https://dlcdn.apache.org/httpd/httpd-2.4.49.tar.gz

[root@localhost src]# wget https://dlcdn.apache.org/apr/apr-1.7.0.tar.gz
[root@localhost src]# wget https://dlcdn.apache.org/apr/apr-util-1.6.1.tar.gz

[root@localhost src]# tar xf httpd-2.4.49.tar.gz 
[root@localhost src]# tar xf apr-1.7.0.tar.gz 
[root@localhost src]# tar xf apr-util-1.6.1.tar.gz 

//安装源epel
[root@localhost src]# yum -y install epel-release
[root@localhost ~]# yum clean all
21 files removed
[root@localhost ~]# yum makecache

//安装开发者工具包
[root@localhost ~]# yum -y groups mark install 'Development Tools'

//安装依赖包
[root@localhost ~]# yum -y install openssl-devel pcre-devel expat-devel libtool gcc gcc-c++ make

//创建用户
[root@localhost ~]# useradd -r -M -s /sbin/nologin apache

//编辑apr的配置文件
[root@localhost apr-1.7.0]# vim configure
    cfgfile="${ofile}T"
    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
    # $RM "$cfgfile"        //将此行加上注释,或者删除此行

//编译安装apr
[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr
[root@localhost apr-1.7.0]# make 
[root@localhost apr-1.7.0]# make install

//编译安装apr-util
[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
[root@localhost apr-util-1.6.1]# make install

//编译安装httpd
[root@localhost apr-util-1.6.1]# cd ../httpd-2.4.49
[root@localhost httpd-2.4.49]# ./configure --prefix=/usr/local/apache \
 --enable-so \
 --enable-ssl \
 --enable-cgi \
 --enable-rewrite \
 --with-zlib \
 --with-pcre \
 --with-apr=/usr/local/apr \
 --with-apr-util=/usr/local/apr-util/ \
 --enable-modules=most \
 --enable-mpms-shared=all \
 --with-mpm=prefork
[root@localhost httpd-2.4.49]# make
[root@localhost httpd-2.4.49]# make install

//安装后配置
[root&
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值