自行编译安装的软件 rpm-qa 查询不到。
通过 find / -name httpd -type f 查找,然后指定绝对路径执行命令
安装过程中会提示需要 apr、apr-util、pcre,所以一并下载了前两个可以在Apache的镜像源http://mirrors.cnnic.cn/apache/ 中找到,后一个需要去官网的sourceforge地址下载http://sourceforge.net/projects/pcre/files/pcre/
以下是截止到2015/05/08 最新稳定版:
[root@httpproxy src]# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.12.tar.gz
[root@httpproxy src]# wget http://mirrors.cnnic.cn/apache/apr/apr-1.5.2.tar.gz
[root@httpproxy src]# wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.4.tar.gz
[root@httpproxy src]# wget http://ncu.dl.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz
[root@localhost src]# for tar in *.tar.gz; do tar zxf $tar;done #批量解压 tar包
[root@httpproxy src]#cd apr-1.5.2.
[root@httpproxy apr-1.5.2]# ./configure --prefix=/usr/local/apr
[root@httpproxy apr-1.5.2]#make && make istall
[root@httpproxy src]# cd apr-util-1.5.4
[root@httpproxy apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@httpproxy apr-util-1.5.4]# make && make istall
[root@httpproxy src]#cd pcre-8.36
[root@httpproxy pcre-8.36]# ./configure --prefix=/usr/local/pcre
[root@httpproxy pcre-8.36]#make && make istall
[root@httpproxy src]#cd httpd-2.4.12
[root@httpproxy httpd-2.4.12]# ./configure -prefix=/usr/local/apache --with-apr=/usr/local/apr/ --with-pcre=/usr/local/pcre/ --with-apr-util=/usr/local/apr-util/
[root@httpproxy httpd-2.4.12]#make && make istall
[root@httpproxy src]#htpasswd -b /etc/squid/squid_passwd oemuser1 Yor84obR
-bash: htpasswd: command not found
[root@httpproxy src]# find / -name htpasswd -type f
/usr/local/src/httpd-2.4.12/support/htpasswd
/usr/local/apache/bin/htpasswd
[root@httpproxy src]#/usr/local/apache/bin/htpasswd -c /etc/squid/passwd squid Yor84obR
[root@localhost NCSA]# /sbin/iptables -I INPUT -p tcp --dport 80-j ACCEPT
[root@localhost NCSA]# /etc/init.d/iptables save
[root@localhost NCSA]# /etc/init.d/iptables restart
------------------------------------------------------------------------------------
问题1:
./configure --prefix=/usr/local/apr 提示 rm: cannot remove `libtoolT': No such file or directory
[root@localhost apr-1.5.2]# yum -y install libtool #安装libtool
[root@localhost apr-1.5.2]# vim configure
#定位到$RM "$cfgfile",注释掉这行或者修改为 $RM -f "$cfgfile"
问题2:启动Apache报错
[root@localhost NCSA]# /usr/local/apache/bin/httpd
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
[root@localhost NCSA]# vim /usr/local/apache/conf/httpd.conf
#ServerName www.example.com:80
ServerName 172.17.35.38:80
问题3:
[root@localhost NCSA]# service httpd start
httpd: unrecognized service
[root@localhost NCSA]# cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
[root@localhost NCSA]# service httpd start
httpd (pid 5716) already running
[root@localhost NCSA]#
结束。