Loading [MathJax]/jax/input/TeX/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >apache服务器启动时提示httpd: apr_sockaddr_info_get() faile

apache服务器启动时提示httpd: apr_sockaddr_info_get() faile

作者头像
院长技术
发布于 2020-06-13 03:22:08
发布于 2020-06-13 03:22:08
1.6K0
举报
文章被收录于专栏:院长运维开发院长运维开发

apache服务器启动时提示httpd: apr_sockaddr_info_get() failed for

在RedHat Linux 5 与 CentOS 5服务器上配置好apache后,启动或者关闭时总要报个错: httpd: apr_sockaddr_info_get() failed for XX(主机名)

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 虽然说并不影响apache的正常启动!但总感觉好像哪有问题。因为进程里会卡一个apache启动进程

找了下资料,原来是主机名设置不对造成的!没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName 所以它会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。 所以要解决这个问题可以设定 ServerName 或者在 /etc/hosts 中填入自己的主机名称 MYHOST,像这样:

vi /etc/hosts 127.0.0.1 localhost.localdomain localhost XX(主机名)

查看主机名的命令是:hostname

可能出现的另外的错误: [root@bogon xy]# service httpd restart Stopping httpd: [ OK ] Starting httpd: httpd: apr_sockaddr_info_get() failed for bogon httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

解决方法: 将httpd.conf中的ServerName 前面的 # 去掉。 RedHat 5 与 CentOS 中的配置文件在 /etc/httpd/conf/httpd.conf (这是操作系统默认安装路径)

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
smokeping网络监控
  我们在选择机房的时候,如何知道这个机房的网络情况,这个时候就要用到网络监控软件:smokeping  
全栈程序员站长
2022/09/06
1.6K0
smokeping网络监控
CentOS 6上编译安装httpd-2.4
必要程序 apr-1.6.2.tar.gz apr-util-1.6.0.tar.gz httpd-2.4.27.tar.gz 准备工作 准备编译工具 [root@httpd-server ~]# yum groupinstall "development tools" [root@httpd-server ~]# yum -y install openssl-devel pcre-devel expat-devel 创建Httpd用户 [root@httpd-server ~]# useradd -r -
用户1456517
2019/03/05
6420
CentOS 6上编译安装httpd-2.4
最小化安装Centos6.0之rpm安装LAMP环境
安装apache httpd-2.2.15-5.el6.centos.i686.rpm   F 提示: error: Failed dependencies: /etc/mime.types is needed by httpd-2.2.15-5.el6.centos.i686 apr-util-ldap is needed by httpd-2.2.15-5.el6.centos.i686 httpd-tools = 2.2.15-5.el6.centos is needed by httpd-2.
苦咖啡
2018/05/07
8810
CentOS6x下搭建Apache httpd服务器环境
首先我们需要把Apache httpd服务器安装在我们的CentOS6.5下面,输入命令:
用户8965210
2022/01/04
7930
CentOS 6.5编译安装httpd-2.4.7
[root@NFSServer ~]# yum groupinstall "Development tools"
星哥玩云
2022/06/29
3150
Apache httpd 几个报错的解决记录
今天在测试环境的 centos7.4 上使用 Docker 部署 httpd 服务时,遇到了以下3个报错:
耕耘实录
2021/12/07
9480
Apache主配置文件httpd.conf 详解《转载》
Apache的主配置文件:/etc/httpd/conf/httpd.conf 默认站点主目录:/var/www/html/ Apache服务器的配置信息全部存储在主配置文件/etc/httpd/conf/httpd.conf中,这个文件中的内容非常多,用wc命令统计一共有1009行,其中大部分是以#开头的注释行。 [[email protected] ~]# wc -l /etc/httpd/conf/httpd.conf 1009 /etc/httpd/conf/httpd.conf 配置文件
老七Linux
2018/05/09
1.8K0
CentOS Apache服务器安装与配置
一、安装Apache程序,一般有三种安装方式: 1.直接网络安装; 2.下载rpm包,上传至服务器进行安装; 3.通过原代码编译安装;
星哥玩云
2022/06/29
1.1K0
Apache主配置文件httpd.conf 详解
Apache的主配置文件:/etc/httpd/conf/httpd.conf 默认站点主目录:/var/www/html/ Apache服务器的配置信息全部存储在主配置文件/etc/httpd/conf/httpd.conf中,这个文件中的内容非常多,用wc命令统计一共有1009行,其中大部分是以#开头的注释行。 [root@justin ~]# wc -l /etc/httpd/conf/httpd.conf 1009 /etc/httpd/conf/httpd.conf [root@justin ~]#
botkenni
2019/09/03
5.4K0
Apache主配置文件httpd.conf 详解
Nginx+Apache
1、配置EPEL YUM源 rpm -ivh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm 2、检查是否安装成功 ll /etc/yum.repos.d/ 3、安装nginx并配置 yum -y install nginx 检查:whereis nginx 说明:配置文件在/etc/nginx目录下,主配置文件是/etc/nginx/nginx.conf (配置前先备份) cp /etc/nginx/ngi
苦咖啡
2018/05/08
9970
安装与配置Cobbler(Linux自动安装)
var xhr = new XMLHttpRequest(); xhr.open('get', 'https://v1.hitokoto.cn/'); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { var data = JSON.parse(xhr.responseText); var hitokoto = document.getElementById('hitokoto'); hitokoto.innerText = data.hitokoto; } } xhr.send();
TRY博客-简单的网络技术
2022/09/08
1.3K0
安装与配置Cobbler(Linux自动安装)
LAMP架构应用实战—Apache服务介绍与安装02
............................................................................................................................过程省略
民工哥
2020/09/16
6400
Centos7下多种方式配置 Apache虚拟主机
[root@localhost ~]# vim /etc/selinux/config
释然IT杂谈
2020/06/12
9630
Linux—搭建Apache(httpd)服务
注意:httpd-2.4版本在配置文件加入Requirt才是默认是拒绝所有主机访问的,所以安装以后必须做显示授权访问
Alone-林
2022/08/20
5.8K0
Linux—搭建Apache(httpd)服务
Apache Httpd 安装 AH00558错误
然后修改 ServerName localhost:80 为 localhost 或者取消注释这行。
HoneyMoose
2020/05/25
1.3K0
Apache Httpd 安装 AH00558错误
Linux(CenOS7与RHEL7)下的Apache HTTP 服务器 2.4.29的安装与配置
版权声明:本文为耕耘实录原创文章,各大自媒体平台同步更新。欢迎转载,转载请注明出处,谢谢。
耕耘实录
2018/12/20
1K0
国密SSL协议之Apache集成
Apache httpd自身支持标准的SSL协议,但并不支持国密SSL协议。本文描述了Apache httpd配置的国密SSL协议(单向)的完整过程,仅供学习和参考之用。
gmssl
2020/08/20
1.7K1
国密SSL协议之Apache集成
CentOS 6下安装Seafile 2
1. 环境准备 1.1 centos6.4_64 最小化安装 yum -y install httpd  ##部署在apache之后,参考https://github.com/haiwen/seafile/wiki/Deploy-Seafile-with-apache yum -y install install Python python-setuptools python-simplejson python-imaging sqlite3  ##系统默认是python2.6 yum -y install  apr apr-devel httpd-devel libtool  ##安装fastcgi需要用到 yum update -y chkconfig postfix off /etc/ini t.d/postfix stop  ##关闭邮件服务 reboot
星哥玩云
2022/07/03
3170
11.7/11.8/11.9 Apache安装
安装Apache Apache是一个基金会的名字,httpd才是我们要安装的软件包,早期它的名字就叫apache Apache官网www.apache.org wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz wget http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.ta
运维小白
2018/02/06
1.5K0
Centos7.9安装phpldapadmin
亲测可用,之前搜索了很多博客,啥样的都有,就是不介绍报错以及配置用处,根本不懂照抄那些配置是干啥的,稀里糊涂的按照博客搭完也跑不起来,因此记录这个。
刘大猫
2025/01/19
900
相关推荐
smokeping网络监控
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档