檢查你正在試用的hostname
[root@test ~]# hostname
yourname
1. 使用hostname命令
[root@test ~]# hostname yourNewHostname
暫時更改你個hostname
重新啟動系統就會還原
2. 修改設定檔 /etc/sysconfig/network 和 /etc/hosts
-
[root@test ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=yourname #在這裡修改hostname -
[root@test ~]# vi /etc/hosts
127.0.0.1 newhostname localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 newhostname localhost localhost.localdomain localhost6 localhost6.localdomain6
#在這裡修改2個hostname
完成修改後請restart network & apache[root@test ~]# service network restart
[root@test ~]# service httpd restart