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 前面的注释去掉。

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

被折叠的 条评论
为什么被折叠?



