apache

#./configure --prefix……检查编辑环境时出现:

checking for APR... no
configure: error: APR not found .  Please read the documentation

解决办法:

1.下载所需软件包:

  1. wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz  
  2. wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz  
  3. wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip   

2.编译安装:

  1. yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs 

具体步骤如下:

  a:解决apr not found问题>>>>>>

  1. [root@xt test]# tar -zxf apr-1.4.5.tar.gz  
  2. [root@xt test]# cd  apr-1.4.5  
  3. [root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr  
  4. [root@xt apr-1.4.5]# make && make install  
  5.  

  b:解决APR-util not found问题>>>>

  1. [root@xt test]# tar -zxf apr-util-1.3.12.tar.gz  
  2. [root@xt test]# cd apr-util-1.3.12  
  3. [root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config  
  4. [root@xt apr-util-1.3.12]# make && make install 


  c:解决pcre问题>>>>>>>>>

  1. [root@xt test]#unzip -o pcre-8.10.zip  
  2. [root@xt test]#cd pcre-8.10  
  3. [root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre  
  4. [root@xt pcre-8.10]#make && make install 

4.最后编译Apache时加上:

--with-apr=/usr/local/apr 

--with-apr-util=/usr/local/apr-util/ 

 --with-pcre=/usr/local/pcre

成功编译完成~

 如果找不到pcre-config 其实在pcre的bin目录下

--with-pcre=/u01/app/apache/pcre/bin/pcre-config

本文出自 “____哊.時^随记” 博客,请务必保留此出处http://xtony.blog.51cto.com/3964396/836508

 

Apache的配置文件则是conf目录下的httpd.conf文件,将其打开:

  1. 首先找到ServerName(约213行),将其设置为localhost:80,并将前面的井号删除,虽然这一步如果不修改的话也可以正常运行,但启动Apache服务时会有一条烦人的提示(AH00558: httpd.exe: Could not reliably determine the server's fully qualified do main name, using fe80::fc76:abca:e24b:d490. Set the 'ServerName' directive globally to suppress this message),洁癖者还是改一下吧。

 

service httpd restart   出现 httpd:unrecognized service 错误

vi /etc/rc.local #在/etc/rc.d/rc.local中增加启动apache的命令
添加:
/usr/local/apache2/bin/apachectl start
或者               

 #将apache注册为系统服务

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

#chmod 700 /etc/rc.d/init.d/httpd
#vi /etc/rc.d/init.d/httpd
   在第三行后增加
   #Comments to support chkconfig on RedHat Linux
   #chkconfig: 2345 90 90
   #description:http server
注意:没有这几行,在使用chkconfig时会提示你:service httpd does not support chkconfig。
chkconfig --add httpd
chkconfig --level 2345 httpd on

posted on 2016-01-02 20:24  阿卡贝拉  阅读(179)  评论(0)    收藏  举报