1.安装httpd
从http://httpd.apache.org/下载:httpd-2.4.10.tar.gz
tar zxvf httpd-2.4.10.tar.gzcd xx/httpd-2.4.10./configure --prefix=/home/soft/httpd-2.4.10
检查编辑环境时出现:checking for APR… noconfigure: error: APR not found . Please read the documentation. 用./configure –help | grep apr 查看帮助。–with-included-apr Use bundled copies of APR/APR-Util–with-apr=PATH prefix for installed APR or the full path to apr-config–with-apr-util=PATH prefix for installed APU or the full path to
2.安装apr
从http://apr.apache.org/download.cgi下载:apr-1.5.1.tar.gz
tar zxvf apr-1.5.1.tar.gz
cd xx/apr-1.5.1
./configure –prefix=/home/soft/apr-1.5.1
makemake install可选:make cleanmake distcleancd ..rm -rf apr-1.5.1
3.再次安装httpd
./configure –prefix=/home/soft/httpd-2.4.10 –with-apr=/home/soft/apr-1.5.1
再次检查编译环境出现checking for APR-util… noconfigure: error: APR-util not found . Please read the documentation.
用./configure –help | grep apr-util 查看帮助。
–with-apr-util=PATH prefix for installed APU or the full path to
4.安装apr-util
从http://apr.apache.org/download.cgi下载:apr-util-1.5.4.tar.gz
tar zxvf apr-util-1.5.4.tar.gz
cd xx/apr-util-1.5.4
./configure –prefix=/home/soft/apr-util-1.5.4–with-apr=/home/soft/apr-1.5.1 (apr-util依赖apr)
makemake install可选:make cleanmake distcleancd ..rm -rf apr-util-1.5.4
5.再次安装httpd
./configure –prefix=/home/soft/httpd-2.4.10 –with-apr=/home/soft/apr-1.5.1 –with-apr-util=/home/soft/apr-util-1.5.4
再次检查编译环境出现
configure: error: pcre-config for libpcre not found. PCRE is required and available fromhttp://pcre.org/
用./configure –help | grep pcre 查看帮助。
–with-pcre=PATH Use external PCRE library
6.安装pcre
从http://pcre.org/下载:pcre-8.36.tar.gz
tar zxvf pcre-8.36.tar.gz
cd xx/pcre-8.36
./configure –prefix=/home/soft/pcre-8.36
makemake install可选:make cleanmake distcleancd ..rm -rf pcre-8.36
注意:pcre安装过程出现了错误,提示需要安装:yum install gcc-c++
7.再次安装httpd./configure –prefix=/home/soft/httpd-2.4.10 –with-apr=/home/soft/apr-1.5.1 –with-apr-util=/home/soft/apr-util-1.5.4 –with-pcre=/home/soft/pcre-8.36
终于没有编译错误了,继续…
makemake install可选:make cleanmake distcleancd ..rm -rf httpd-2.4.10
试用一下:
查看80端口是否被占用[root@localhost conf]#netstat -an | grep :80 端口可能被占用,修改conf/httpd.conf 将 Listen 80 改为 Listen 7777[root@localhost bin]# apachectl start访问:http://localhost:7777/ 出现:It works!表示安装并启动成功。停止:[root@localhost bin]# apachectl stop一路艰辛,都是通过网络搜索答案,其实apache官方是有明确依赖说明的:http://httpd.apache.org/docs/2.4/en/install.html,搜索"Requirements"可以看到。自然而然不想去因为别人的努力而努力,