找回密码
 注册
查看: 3231|回复: 0

httpd: Could not reliably determine the server's fully qualified domain name, us

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2020-6-5 17:08:36 | 显示全部楼层 |阅读模式
启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name

  x$ n1 X* h/ P2 r3 r[root@centos6 httpd-2.2.31]# /usr/local/apache/bin/apachectl start- ~- x1 V* r' w: z  p
httpd: apr_sockaddr_info_get() failed for centos6
2 X3 a! Y: T% h3 v) d% g% ^. Ihttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

* g6 y! q! a2 t  Y& t8 @) t' P9 ]7 N4 Z# g
( n9 t0 O+ s0 Y) s) o
& ?1 y' p# e1 l
1)进入apache的安装目录:(视个人安装情况而不同)
# p& W& B" z+ g3 c* l5 v! c9 I6 v
[root@centos6 httpd-2.2.31]# cd /usr/local/apache/conf/
* ?/ K2 \2 Z' O$ L[root@centos6 conf]# pwd/ ?& ~& v$ [# L2 u' b1 {
/usr/local/apache/conf

8 r( i- r, g3 L9 u. \  U- C1 r
2)编辑httpd.conf文件,搜索"#ServerName",添加
#ServerName www.example.com:80    复制到下面,修改www.example.com:80为localhost:80
如下:
ServerName localhost:80
& c# `3 F# b* F" l6 U( L* u/ L9 N4 P! g5 j1 E% E/ Q9 }$ g; p
[root@centos6 httpd-2.2.31] # ls9 \. t( [1 ~% Q7 h
extra  httpd.conf  magic  mime.types  original
4 S( ]' Z- N1 D! f( h[root@server conf]# vi httpd.conf
0 C% b% G# ~) o- Z1 O#ServerName www.example.com:80
( o/ y0 X' e0 a, P3 C: s3 eServerName localhost:80
3)再重新启动apache 即可。
/ j" g6 }" F: Y$ z4 Z0 b7 [4 W
: d7 S; r6 {7 n. \' U. a, w7 o
[root@centos6 httpd-2.2.31]# /usr/local/apache/bin/apachectl restart
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 03:24 , Processed in 0.025088 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表