|
启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name
7 H" `8 S* w: _0 I[root@centos6 httpd-2.2.31]# /usr/local/apache/bin/apachectl start8 L. m+ w7 k6 x! ^
httpd: apr_sockaddr_info_get() failed for centos63 \- `5 q( F N2 D" t1 F! M* c! Q
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
0 f& B- w3 c& |3 X* Q+ E2 v* C8 O9 i4 @: c/ Y- W
9 K& t, F& A( {. s4 x
3 W. v/ h( d0 m, o# Y) [' h- }
1)进入apache的安装目录:(视个人安装情况而不同) 3 d' a4 O# w7 G3 J' U
[root@centos6 httpd-2.2.31]# cd /usr/local/apache/conf/
) I4 ]) I4 x& w3 H[root@centos6 conf]# pwd9 T+ Z& @ [( q: Z
/usr/local/apache/conf/ I0 A5 Z3 ` B l% u) Q
|
2)编辑httpd.conf文件,搜索"#ServerName",添加 如下: ServerName localhost:80
6 x4 N& I; k" u& U: p9 T' r" J" Q9 W9 Q/ M
[root@centos6 httpd-2.2.31] # ls
( `* [1 P- K2 V$ P/ z5 ]; e! @extra httpd.conf magic mime.types original3 a7 e8 R# z$ z D4 y8 ]; ~' z
[root@server conf]# vi httpd.conf
2 Z: L: P( t7 L- ~' x8 E9 T c6 P) B#ServerName www.example.com:80
! A9 g/ R6 x$ zServerName localhost:80 |
3)再重新启动apache 即可。
# P9 W# A6 d$ H2 G3 v- ~& `) c% X7 @/ Y4 E6 r3 w* o
| [root@centos6 httpd-2.2.31]# /usr/local/apache/bin/apachectl restart |
|