|
启动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 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 |
|