Centos6.6安装apache2.4
安装apr请参考: http://www.cnblogs.com/yuzhaokai0523/p/4382974.html
1安装httpd-2.4.10.tar.gz
- tar -zxvf httpd-2.4.10.tar.gz
- cd httpd-2.4.10
- ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr/ --with-pcre=/usr/local/pcre/
- make
- make install
2.修改/usr/local/apache/conf/httpd.conf
找到#ServerName www.example.com:80修改为ServerName localhost:80
3.将http加入service
- cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
4.修改/etc/rc.d/init.d/httpd
在#!/bin/bash下加入
- # chkconfig: 2345 50 90
- # description:Activates/Deactivates Apache Web Server)
5.启动apache
- service httpd start
添加 chkconfig --add httpd
6.验证apache是否启动成功
- lsof -i:80
出现如下输出则证明apache启动
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 4158 root 4u IPv6 50349 0t0 TCP *:http (LISTEN)
httpd 4159 daemon 4u IPv6 50349 0t0 TCP *:http (LISTEN)
httpd 4160 daemon 4u IPv6 50349 0t0 TCP *:http (LISTEN)
httpd 4161 daemon 4u IPv6 50349 0t0 TCP *:http (LISTEN)
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。