rocky8 安装apache2.4.37

1、依赖

yum install gcc
yum install -y expat-devel 
yum install openssl-devel
yum install -y pcre pcre-devel

2、创建文件夹

mkdir /usr/local/install/apr
mkdir /usr/local/install/apr-util
mkdir /usr/local/install/httpd

3、下载apr

# 下载地址
http://archive.apache.org/dist/apr/

tar -zxvf apr-1.7.0.tar.gz
cd apr-1.7.0/
./configure --prefix=/usr/local/install/apr
make && make install

4、apr-util

http://archive.apache.org/dist/apr/

./configure --prefix=/usr/local/install/apr-util/ --with-apr=/usr/local/install/apr
make
make install

5、httpd

./configure \
--prefix=/usr/local/install/httpd/ \
--with-apr=/usr/local/install/apr/ \
--with-apr-util=/usr/local/install/apr-util/ \
--enable-so \
--enable-ssl\
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--enable-static-support
make
make install

6、配置文件

 vim /usr/local/install/httpd/conf/httpd.conf
 ServerName wx.xxxx.club (就是增加域名)

7、啟動apache

cd /usr/local/apache/bin/

# 啟動
./apachectl start

# 重啟
./apachectl restart

# 检测apache配置文件语法是否正确 
./apachectl configtest

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值