Centos安装Apache启动错误:

Apache启动错误:httpd.exe: Could not reliably determine the server‘s fully qualified

在自己电脑配置Apache开发环境问题的时候,可能会遇到apache的启动错误:httpd.exe: Could not reliably determine the server‘s fully qualified domain name, using 192.168. x. x for ServerName,这个错误在error.log也会有输出。

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn‘t have a registered DNS name, enter its IP address here.
#
#ServerName www.xizhilang.com:8080
# 在httpd.conf文件中添加下面这行,就能避免这个启动错误
ServerName localhost:8080

正如注释推荐的做法,直接将本机的名称指定为你的IP地址,而报出的那个错误就是因为未配置域名服务器或者域名服务器未能找到该域名的地址。把Apache服务的名称指定为本地IP地址,就不需要去通过DNS服务器去得到本机的IP地址,而localhost这个特殊的地址是由DNS自己本身实现的一个内置配置,所以这里用localhost也可以在本地完成地址的转换。

我试着修改本地的hosts文件和httpd.conf文件,也能避免那个错误的出现,具体方法如下。

首先,修改httpd.conf文件,在配置文件中添加该项配置 ServerName xizhilang.com:8080 ,即上面的那个配置。

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn‘t have a registered DNS name, enter its IP address here.
#
#ServerName www.xizhilang.com:8080
ServerName xizhilang.com:8080

然后,修改hosts文件,hosts文件的位置是 “系统盘符:\Windows\System32\drivers\etc\hosts” ,打开之后在最后添加两行,配置如下:

# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1  localhost
# ::1   localhost
# 添加如下两行,将 xizhilang.com 域名解析成本地地址
 127.0.0.1  xizhilang.com
 ::1   xizhilang.com

添加完后,打开apache之后,OK搞定,警告信息不再出现!

时间: 2024-11-08 23:22:17

Centos安装Apache启动错误:的相关文章

解决apache启动错误:Could not reliably determine the server's fully qualified domain name

启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name [[email protected] httpd-2.2.4]# /usr/local/apache2/bin/apachectl start httpd: Could not reliably determine the server's fully qualified domain name, using ::1

Centos 安装Apache软件

检查rpm    -qa    httpd [[email protected] icons]# rpm    -qa   |grep  httpd httpd-2.2.15-30.el6.centos.i686 查看安装路径 rpm -ql httpd-2.2.15-30.el6.centos.i686 确保安装完 [[email protected] icons]#  yum   -y  install      httpd 或者也可以 rpm -qa  httpd rmp -ql http

CentOS安装软件出现错误:bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

CentOS安装软件出现错误: bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directorygoogle了一把才发现是64位系统中安装了32位程序解决方法:yum install glibc.i686 重新安装以后还有如下类系错误 再继续安装包 error while loading shared libraries: libstdc++.so.6: cannot open

解决apache启动错误httpd: Could not reliably determine the server's fully qualified domain name

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this messagehttpd (pid 1068) already running 编辑httpd.conf文件,搜索"#ServerName",添

centOS下msyql启动错误-Multiple MySQL running but PID file could not be found

今天在centOS下装mysql时出现了一个错误: 解决方案就是如图所示kill 4734 kill 4839 最后再执行[[email protected] src]# service mysql start就可以了 centOS下msyql启动错误-Multiple MySQL running but PID file could not be found

python(2.7.10) 安装后启动错误:IDLE's subprocess didn't make connection

问题:启动Python提示错误:IDLE's subprocess didn't make connection.Either IDLE can't start a subprocess or personal firewall software is blocking the connection . 原因: That usually means that your firewall is blocking IDLE, so  enable it in your firewall. If th

光盘上CentOS 安装程序启动过程

光盘上CentOS 安装程序启动过程 MBR:boot.cat stage2: isolinux/isolinux.bin 配置文件:isolinux/isolinux.bin 每个对应菜单选项 加载内核:isolinuz/vmlinuz 向内核传递参数:append initrd=initrd.img .. 随后装载根文件系统,并启动anaconda ##anaconda应用的工作过程 安装前的配置 键盘类型 语言 .. 安装阶段 在目标磁盘创建分区.格式化.安装bootloader.. 首次

解决apache启动错误:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

启动apache遇到提示: [[email protected] conf]# ../bin/apachectl -thttpd: apr_sockaddr_info_get() failed for bqh-119httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerNameSyntax OK[[email protected] conf]#

CentOS 安装Apache服务

Centos基于Redhat, 通过yum可以安装所需要的软件包. 1. yum -y install httpd , 这个会将httpd安装在 /etc/目录下. 2. 安装成功后,执行以下命令来启动httpd服务 service httpd start 3. 在浏览器中访问, 下面这个IP是我的IP地址,需要替换为你自己的IP地址. http://10.64.246.152/ 会看到如下页面. 看到这个页面就说明apache启动成功了! 4. 要想查看安装的apahche版本,执行以下命令,