LAMP/LNMP源码搭建(rockylinux8.6+php7.4.32+mysql8.0.30)

 序号 主机 系统 作用 备注
1 stu:192.168.3.81 rockylinux8.6最小化安装 LAMP
2 stu:192.168.3.82 rockylinux8.6最小化安装 LNMP

一、环境准备

1、关闭selinux及防火墙

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
systemctl disable firewalld
reboot

2、安装软件包

yum install  -y  wget vim net-tools bash-completion

二、LAMP搭建

1、下载源码包并安装aparch

wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.7.0.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.54.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
wget https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.38/pcre2-10.38.tar.gz
yum install make gcc gcc-c++ openssl openssl-devel expat-devel -y
tar -xvf apr-1.7.0.tar.gz -C /usr/local/src/
cd /usr/local/src/apr-1.7.0/
./configure --prefix=/usr/local/apr
make -j 4 && make install && cd
cd /usr/local/src/apr-util-1.6.1/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
tar -xvf pcre2-10.38.tar.gz -C /usr/local/src
cd  /usr/local/src/pcre2-10.38/
 ./configure --prefix=/usr/local/pcre
make -j 4 && make install && cd
tar -xvf httpd-2.4.54.tar.gz -C /usr/local/src/
cd /usr/local/src/httpd-2.4.54/
./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --enable-ssl \
--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre \
--enable-modules=most --enable-mpms-shared=all --with-mpm=event
make -j 4 && make install && cd
/usr/local/apache/bin/apachectl -V
cat /usr/local/apache/build/config.nice

 生成启动脚本

cp /usr/local/apache/bin/apachectl /etc/init.d/
chmod +x /etc/init.d/apachectl

cat > /usr/lib/systemd/system/apache.service << EOF

[Unit]
Description=apache
After=network.target
[Service]
Type=forking
ExecStart=/etc/init.d/apachectl start
ExecReload=/etc/init.d/apachectl restart
ExecStop=/etc/init.d/apachectl stop
PrivateTmp=tru
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值