设为首页 收藏本站
查看: 1102|回复: 0

[经验分享] postfix安装(二)-- apache

[复制链接]

尚未签到

发表于 2015-11-24 10:14:07 | 显示全部楼层 |阅读模式
  安装apache有点曲折,主要是apr导致的
  安装包: httpd-2.4.1.tar.bz2
  下载地址:
http://www.apache.org

  

首先要定义一个完整的主机名 :
否则在启动apache的时候会有这样的报错:
  AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
  

  编辑 /etc/sysconfig/network 文件,然后重启才能生效
  开始安装
  ]# chmod +x httpd-2.4.1.tar.bz2

]# tar jxf httpd-2.4.1.tar.bz2



]# cd httpd-2.4.1

]# ./configure --prefix=/usr/local/apache

checking for APR... no

configure: error: APR not found.  Please read the documentation.




发现没有安装apr相关包,然后就用yum批量安装

]# yum install apr apr-util apr-devel apr-util-devel apr-util-mysql -y





再次运行configure出现这个报错:

checking for pcre-config... false

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/




解救措施就是安装pcre相关包

]# yum install pcre pcre-devel pcre-static -y





]# rpm -qa |grep pcre

pcre-7.8-3.1.el6.x86_64

pcre-devel-7.8-3.1.el6.x86_64





]# make

rotatelogs.c:(.text+0x5ed): undefined reference to `apr_file_link'

collect2: ld returned 1 exit status

make[2]: *** [rotatelogs] Error 1




检查apr包是否已经安装,事实证明已经安装过了

[iyunv@Webmail httpd-2.4.1]# rpm -qa |grep apr

apr-1.3.9-3.el6.x86_64

apr-util-1.3.9-3.el6.x86_64

apr-devel-1.3.9-3.el6.x86_64

apr-util-devel-1.3.9-3.el6.x86_64

apr-util-ldap-1.3.9-3.el6.x86_64


  试了几次都是同样的报错,把rpm包都卸载了,安装apr源码包

apr-1.3.8.tar.gz

apr-util-1.3.8.tar.gz



安装apr-util的时候需要指定apr的路径 --with-apr=/usr/local/apr





重新安装apache
  ./configure --prefix=/usr/local/apache --with-apr-util=/usr/local/apr-util
  在make install的时候,SB错误又出现了
  .libs/rotatelogs.o: In function `post_rotate':

/home/software/httpd-2.4.1/support/rotatelogs.c:298: undefined reference to `apr_file_link'

collect2: ld returned 1 exit status



  


  看来不是apr包的问题了,难道是哪个地方没有配置么 ?
  ]# ./configure --prefix=/usr/local/apache/ --with-apr=/usr/local/apr/bin/apr-1-config --with-lib=/usr/local/apr/lib/ --with-apr-util=/usr/local/apr-util/


  再续!!!!
  今天又回来继续这个问题
  我把apr和apr-util全都make clean然后删掉安装路径相关的文件/usr/local/apr
  在apache官方网站上重新下载的apr包 apr-util包和httpd包
  http://mirror.bit.edu.cn/apache//apr/


  apr-1.4.5.tar.gz


  apr-util-1.3.8.tar.gz


  


  http://mirror.bit.edu.cn/apache//httpd/


  

httpd-2.4.1.tar.gz   

  
  在中途中除了遇到这样一个蹩脚错误,我也不知道什么原因导致的,就用yum install libtool -y 就ok了
  info.lo   -lrt -lcrypt  -lpthread

libtool: link: `strings/apr_strings.lo' is not a valid libtool object

make: *** [libapr-1.la] 错误 1

[iyunv@Webmail apr-1.4.5]# libtool: link: `strings/apr_strings.lo' is not a valid libtool object

make[1]: *** [libapr-1.la] 错误 1

make[1]: Leaving directory `/home/software/apr-1.4.5'

make: *** [all-recursive] 错误 1



  


  重新整理一下安装思路:
  安装环境:
  ]# yum install libtool apr apr-util apr-devel apr-util-devel apr-util-mysql  pcre pcre-devel pcre-static -y


  安装apr
  ./configure --prefix=/usr/local/apr
  make && make install
  


  安装apr-util
  ./configure --with-apr=/usr/local/apr
  make && make install
  


  安装http
  ./configure --prefix=/usr/local/apache  --with-apr=/usr/local/apr/bin/apr-1-config --with-lib=/usr/local/apr/lib
  make && make install


  


  如果apr和apr安装完整的话,再安装http,应该没问题,我觉得我的apr和apr-util没有安装完整
  功夫不负有心人哟,O(∩_∩)O
  -------------------------------------------------------
  ]# cp /home/software/httpd-2.4.1/support/apachectl /etc/init.d/httpd


  开机自启动
  将service httpd start 加入文件 /etc/rc.d/rc.local
  启动服务
  ]# service httpd start

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message




  ]# ps aux |grep http

root      8571  0.0  0.1  71228  2588 ?        Ss   17:03   0:00 /usr/local/apache/bin/httpd -k start

daemon    8572  0.0  0.2 415488  4460 ?        Sl   17:03   0:00 /usr/local/apache/bin/httpd -k start

daemon    8573  0.0  0.2 415488  4464 ?        Sl   17:03   0:00 /usr/local/apache/bin/httpd -k start

daemon    8574  0.0  0.2 415488  4468 ?        Sl   17:03   0:00 /usr/local/apache/bin/httpd -k start

root      8658  0.0  0.0 105388   888 pts/0    S+   17:03   0:00 grep http




  ]# netstat -anpt |grep 80

tcp        0      0 :::80                       :::*                        LISTEN      8571/httpd


  


  另外chkconfig不支持httpd,那么可以用以下方式实现开机自动启动:
  

]# vi /etc/init.d/httpd   在#/bin/sh下加入下列两行


       #chkconfig:2345 57 57


       #description:Apache


    PS:开头必须得加#,要不然还是不支持chkconfig


  

]# ln -s /etc/init.d/httpd /etc/rc.d/rc2.d/S57httpd


]# ln -s /etc/init.d/httpd /etc/rc.d/rc53d/S57httpd


]# ln -s /etc/init.d/httpd /etc/rc.d/rc4.d/S57httpd


]# ln -s /etc/init.d/httpd /etc/rc.d/rc5.d/S57httpd


]#
chkconfig --add httpd


]#
chkconfig --list |grep httpd



  


  检测服务
  然后在本机的浏览器地址栏中输入localhost:80,看一下是否显示“It Works”的提示
DSC0000.gif


  


  


  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-142976-1-1.html 上篇帖子: EMOS postfix日志相关操作介绍 下篇帖子: ubuntu下,使用postfix实现php发送mail功能
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表