自行編譯安裝的軟件 rpm-qa 查詢不到。apache
經過 find / -name httpd -type f 查找,而後指定絕對路徑執行命令vim
安裝過程當中會提示須要 apr、apr-util、pcre,因此一併下載了前兩個能夠在Apache的鏡像源http://mirrors.cnnic.cn/apache/ 中找到,後一個須要去官網的sourceforge地址下載http://sourceforge.net/projects/pcre/files/pcre/ bash
如下是截止到2015/05/08 最新穩定版:dom
[root@httpproxy src]# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.12.tar.gztcp
[root@httpproxy src]# wget http://mirrors.cnnic.cn/apache/apr/apr-1.5.2.tar.gzui
[root@httpproxy src]# wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.4.tar.gzthis
[root@httpproxy src]# wget http://ncu.dl.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gzspa
[root@localhost src]# for tar in *.tar.gz; do tar zxf $tar;done #批量解壓 tar包.net
[root@httpproxy src]#cd apr-1.5.2.rest
[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]#
結束。