centos6安装apache2.2
Posted 队长china
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos6安装apache2.2相关的知识,希望对你有一定的参考价值。
1. 从https://mirrors.tuna.tsinghua.edu.cn/apache/httpd下载httpd包
执行命令
wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.2.34.tar.gz

2. 解压到本地

3. 进入到 httpd-2.2.32目录
执行./configure --prefix=/usr/local/apache2 --sysconfdir=/usr/local/etc/httpd

4. 执行 make 命令
5. 执行make install 命令,安装完成
6. 进入到apache安装路径 /usr/local/apache2/bin ,执行启动脚本
./apachectl start

注意事项:
1. 检查80端口是否开启
netstat -tan

2. 检查防火墙配置是否开启80端口
重启防火墙
service iptables restart
3. 如果启动中报错 :
httpd: apr_sockaddr_info_get() failed for captian2(主机名)
httpd: Could not reliably determine the server\'s fully qualified domain name, using 127.0.0.1 for ServerName
方法 (1):
设置 /usr/local/etc/http2/httpd.conf 中的ServerName 为 ServerName localhost:80
方法(2)
在 /etc/hosts 文件中添加自己的主机名,如 127.0.0.1 captain2
启动之后,可以在浏览器中输入主机ip地址,即可访问apache页面
以上是关于centos6安装apache2.2的主要内容,如果未能解决你的问题,请参考以下文章