阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS下源代码编译和安装Apache

171次阅读
没有评论

共计 849 个字符,预计需要花费 3 分钟才能阅读完成。

如何从 CentOS 中源码编译和安装 Apache

1、下载最新的 Apache 版本

wget http://mirror.downloadvn.com/apache//httpd/httpd-2.4.41.tar.gz

2、安装软件包

yum install apr* gcc

3、编译安装

tar -zxvf httpd-2.4.41.tar.gz
cd httpd-2.4.41
./configure –prefix=/usr/local/apache –enable-vhost-alias –enable-rewrite –enable-info
make
make install

复制初始化文件并将 Apache 设置为启动

cp build/rpm/httpd.init /etc/init.d/httpd
chmod 755 /etc/init.d/httpd
chkconfig –add httpd
chkconfig –level 35 httpd on

创建一个符号链接

ln -s /usr/local/apache/ httpd
cd /usr/sbin/
ln -fs /usr/local/apache/bin/httpd
ln -fs /usr/local/apache/bin/apachectl
cd /var/log
rm -rf httpd/
/etc/init.d/httpd start

启动 / 停止 httpd 服务

service httpd restart
service httpd start
/usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl status
/etc/init.d/httpd start
/etc/init.d/httpd stop
/etc/init.d/httpd restart

使用 pgrep 查找启动的进程

pgrep httpd

CentOS 下源代码编译和安装 Apache

Apache 配置文件

vi /usr/local/apache/conf/httpd.conf

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-21发表,共计849字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中