linux apache 源码包安装与配置

本文提供了一个详细的步骤来安装Apache Web服务器,包括apr、apr-util及pcre等依赖组件的下载与配置过程。通过这些步骤,你可以从头开始设置并运行一个完整的Apache服务器环境。

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

1.    下载apr  apr-util 包

http://apr.apache.org/download.cgi  

2.  安装apr 和 apr-util 包

tar -vxzf apr-1.5.2.tar.gz

cd apr-1.5.2

./configure --prefix=/usr/local/apr

make

make install 

=========

tar -vxzf  apr-util-1.5.4.tar.gz

cd apr-util-1.5.4 

./configure  --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config

make

make install

3. 安装pcre 

下载pcre源码包 :http://sourceforge.net/projects/pcre/files/latest/download

tar vxzf pcre-8.31.tar.gz 

cd prce-8.31

./configure --prefix=/usr/local/pcre

make 

make install 

4. 安装apache

下载http的源码包

http://httpd.apache.org/download.cgi

tar -vxzf httpd-2.4.3.tar.gz 

cd httpd-2.4.3 

./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre 

make 

make install 

5. 启动apache

•启动Apache:/usr/local/apache2/bin/apachectl start
•停止Apache:/usr/local/apache2/bin/apachectl stop
•重启Apache:/usr/local/apache2/bin/apachectl restart

6. init.d service 

cp  /usr/local/apache2/bin/apachectl /etc/init.d/httpd 

7.错误解决

 AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message

修改httpd.conf文件

将#ServerName 前面的注释去掉。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值