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

[经验分享] Red Hat Enterprise Linux Server release 5.5 (Tikanga) 配置Apache httpd-2.4.4

[复制链接]

尚未签到

发表于 2015-8-2 12:26:39 | 显示全部楼层 |阅读模式
  本文是在参见博友spinsoft的文章成功配置后整理。链接:http://www.iyunv.com/spinsoft/archive/2012/09/07/2675078.html
  感谢博友spinsoft的文章,我们环境不同,过程略有不同。
  红色文字为重点内容,蓝色文字为引用博友spinsoft内容。
  ====================================
  环境:
  [iyunv@luke soft]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel \r on an \m
  httpd-2.4.4.tar.gz
  下载地址:http://www.apache.org/
  ====================================
  解压httpd-2.4.4.tar.gz,编译
  [iyunv@luke soft]# tar jxvf httpd-2.4.4.tar.bz2
[iyunv@luke soft]# cd httpd-2.4.4
[iyunv@luke httpd-2.4.4]# ls
[iyunv@luke httpd-2.4.4]# ./configure  --prefix=/usr/local/apache  --enable-so  //配置apache路径 ,后面跟 --enable-so 参数表示让apache核心装载DSO
  Error
  checking for APR... no
configure: error: APR not found.  Please read the documentation.

  Apache官网下载apr-1.4.6.tar.gz,解压编译安装。
  [iyunv@luke soft]# tar zxf apr-1.4.6.tar.gz
[iyunv@luke soft]# cd apr-1.4.6
[iyunv@luke apr-1.4.6]# ./configure --prefix=/usr/local/apr
[iyunv@luke apr-1.4.6]# make
[iyunv@luke apr-1.4.6]# make install
  继续编译Apache
  [iyunv@luke httpd-2.4.4]# ./configure  --prefix=/usr/local/apache  --enable-so
  Error
  configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type:
  
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... Invalid configuration `
  ': machine `  ' not recognized
configure: error: /bin/sh build/config.sub
   failed
  上百度找到解决方法,虽然是解决问题了,但是原理我还不是很理解。
  [iyunv@luke httpd-2.4.4]# yum list | grep libtool*
libtool.i386                             1.5.22-7.el5_4                installed
libtool-ltdl.i386                        1.5.22-7.el5_4                base     
libtool-ltdl-devel.i386                  1.5.22-7.el5_4                base     
[iyunv@luke httpd-2.4.4]# yum install libtool-ltdl.i386 libtool-ltdl-devel.i386
  复制config.sub和config.guess到当前要configure目录下,比如安装Apache,进入解压后的文件夹(httpd-2.4.4)进行如下操作:
  cp /usr/share/libtool/config.sub ./
  cp /usr/share/libtool/config.guess ./
  然后添加configure参数:./configure --enable-shared --enable-static
  继续编译Apache
  [iyunv@luke httpd-2.4.4]# ./configure --prefix=/usr/local/apache --enable-so --enable-shared --enable-static
  Error
  checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.

  Apache官网下载apr-util-1.5.2.tar.gz,解压编译安装。
  [iyunv@luke soft]# tar zxf apr-util-1.5.2.tar.gz
[iyunv@luke apr-util-1.5.2]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
[iyunv@luke apr-util-1.5.2]# make && make install
  编译通过,继续编译Apache
  这时候要注意修改参数
  [iyunv@luke httpd-2.4.4]# ./configure --prefix=/usr/local/apache --enable-so --enable-shared --enable-static --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/
[iyunv@luke httpd-2.4.4]# make && make install
  Apache编译安装完毕
  停止&启动Apache
  [iyunv@luke bin]# pwd
/usr/local/apache/bin
[iyunv@luke bin]# apachectl stop
[iyunv@luke bin]# apachectl start
  查看Apache端口
  [iyunv@luke bin]# netstat -an | grep :80
tcp        0      0 :::80                       :::*                        LISTEN      
[iyunv@luke bin]# lsof -i :80
COMMAND   PID   USER   FD   TYPE DEVICE SIZE NODE NAME
httpd   22569   root    4u  IPv6  97220       TCP *:http (LISTEN)
httpd   22570 apache    4u  IPv6  97220       TCP *:http (LISTEN)
httpd   22571 apache    4u  IPv6  97220       TCP *:http (LISTEN)
httpd   22572 apache    4u  IPv6  97220       TCP *:http (LISTEN)
httpd   22573 apache    4u  IPv6  97220       TCP *:http (LISTEN)
httpd   22574 apache    4u  IPv6  97220       TCP *:http (LISTEN)
httpd   22575 apache    4u  IPv6  97220       TCP *:http (LISTEN)
httpd   22576 apache    4u  IPv6  97220       TCP *:http (LISTEN)
httpd   22577 apache    4u  IPv6  97220       TCP *:http (LISTEN)
  查看Apache服务启动情况
  [iyunv@luke bin]# ps -aux | grep httpd
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root     22569  0.0  3.7  24636  9460 ?        Ss   15:20   0:00 /usr/sbin/httpd -k start
apache   22570  0.0  1.8  24636  4800 ?        S    15:20   0:00 /usr/sbin/httpd -k start
apache   22571  0.0  1.8  24636  4800 ?        S    15:20   0:00 /usr/sbin/httpd -k start
apache   22572  0.0  1.8  24636  4800 ?        S    15:20   0:00/usr/sbin/httpd -k start
apache   22573  0.0  1.8  24636  4800 ?        S    15:20   0:00 /usr/sbin/httpd -k start
apache   22574  0.0  1.8  24636  4800 ?        S    15:20   0:00 /usr/sbin/httpd -k start
apache   22575  0.0  1.8  24636  4800 ?        S    15:20   0:00 /usr/sbin/httpd -k start
apache   22576  0.0  1.8  24636  4800 ?        S    15:20   0:00 /usr/sbin/httpd -k start
apache   22577  0.0  1.8  24636  4800 ?        S    15:20   0:00 /usr/sbin/httpd -k start
root     22735  0.0  0.2   3920   696 pts/3    S+   15:25   0:00 grep httpd
  访问一下apache默认页是否能打开,http://ip:80/index.html
  我虚拟机和宿主机使用的是桥接,也能成功从宿主机访问Apache默认页面和自己创建的页面。
DSC0000.jpg
  创建访问页面
  [iyunv@luke html]# pwd
/var/www/html
[iyunv@luke html]# ll
total 8
-rwxr--r-- 1 root root 5 Apr  7 15:34 index.html
-rwxr--r-- 1 root root 5 Apr  7 15:34 luke.html
  End
  

运维网声明 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-93312-1-1.html 上篇帖子: Apache Gzip设置 下篇帖子: Apache许可协议Open RIA Services
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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