源码安装Apache

一、下载Apache,源码安装Apache

go 复制代码
#下载
[root@localhost opt]# wget -c https://mirrors.aliyun.com/apache/httpd/httpd-2.4.58.tar.gz
[root@localhost opt]# ls
httpd-2.4.58.tar.gz
[root@localhost opt]# tar -xf httpd-2.4.58.tar.gz 
[root@localhost opt]# ls
httpd-2.4.58  httpd-2.4.58.tar.gz
[root@localhost opt]#
[root@localhost opt]# cd httpd-2.4.58

#安装PCRE APR相关优化模块
[root@localhost httpd-2.4.58]# yum  install  pcre-devel apr apr-devel apr-util apr-util-devel --y

#预编译Apache,启用rewrite规则,启用动态加载库。
[root@localhost httpd-2.4.58]# ./configure --prefix=/usr/local/apache2/ --enable-rewrite --enable-so

#编译安装
[root@localhost httpd-2.4.58]# make && make install

#启动服务
[root@localhost opt]# ps -ef |grep apache2
root      40275   7750  0 11:31 pts/0    00:00:00 grep --color=auto apache2
[root@localhost opt]# /usr/local/apache2/bin/apachectl start
[root@localhost opt]# ps -ef |grep apache2
root      40279      1  0 11:31 ?        00:00:00 /usr/local/apache2//bin/httpd -k start
daemon    40280  40279  0 11:31 ?        00:00:00 /usr/local/apache2//bin/httpd -k start
daemon    40281  40279  0 11:31 ?        00:00:00 /usr/local/apache2//bin/httpd -k start
daemon    40282  40279  0 11:31 ?        00:00:00 /usr/local/apache2//bin/httpd -k start
root      40365   7750  0 11:31 pts/0    00:00:00 grep --color=auto apache2
[root@localhost opt]#

二、浏览器测试

输入主机地址:http://192.168.145.129

相关推荐
阿眠15 小时前
vue3实现web端和小程序端个人签名
前端·小程序·apache
熊文豪1 天前
时序数据库选型指南 —— 为什么选择 Apache IoTDB?
apache·时序数据库·iotdb
lang201509281 天前
Apache Ignite 的 Pages Writes Throttling(页面写入节流)
apache
FreeBuf_2 天前
Apache CXF 漏洞曝光:存在拒绝服务与数据泄露双重风险
apache
星释2 天前
WAMP允许远程访问
php·apache·wamp
阿里云云原生2 天前
赠送 10 张三天通票,和我们来畅聊 CommunityOverCode Asia 2025
apache
阿里云云原生3 天前
Apache RocketMQ + “太乙” = 开源贡献新体验
apache·rocketmq
Rinleren3 天前
Apache部署
apache
家里有只小肥猫3 天前
开通保存图片权限
apache