首页 > 代码库 > centos6安装apache2.2
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.32.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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。