Linux下安装Apache httpd server

本文详细介绍了如何安装Apache HTTP服务器及其依赖库ARP、ARP-Util、PCRE,并配置监听特定IP地址,最后通过浏览器验证服务运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://httpd.apache.org/docs/2.4/install.html

1. 安装依赖库 ARP, ARP-Util, PCRE

下载地址
http://apr.apache.org/download.cgi
http://www.pcre.org/

安装ARP
# tar zxf apr-1.5.2.tar.gz
# cd apr-1.5.2
# ./configure --prefix=/usr/local/apr
# make
# make install

安装ARP-Util
# tar zxf apr-util-1.5.4.tar.gz
# cd apr-util-1.5.4
# ./configure  --with-apr=/usr/local/apr
# make
# make install

安装PCRE
# tar zxf pcre-8.37.tar.gz
# cd pcre-8.37
# ./configure
# make
# make install

2. 下载及安装 Apache httpd

下载源码
http://httpd.apache.org/download.cgi#apache24

安装
# tar xzf httpd-2.4.18.tar.gz 
# cd httpd-2.4.18
# ./configure --enable-mods-shared=all #默认安装在/usr/local/apache2
# make
# make install

配置
# vim /usr/local/apache2/conf/httpd.conf
--------
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8088
--------

启动/停止
# /usr/local/apache2/bin/apachectl -k start
# /usr/local/apache2/bin/apachectl -k stop

在浏览器访问 {IP}:8088
It works!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值