2012-02-19 87 views
0

我們正試圖在Linode Ubuntu 10.04 Lucid框中使用Passenger和Nginx來部署我們的Rails應用程序。無法在Linode Ubuntu 10.04上設置主機名Lucid Lynx

我們似乎不能從我們的Ubuntu盒子的根IPv6地址設置主機名。

我們得到的錯誤:

[email protected]`ourIPv6`:~# hostname -f 
hostname: Name or service not known 

當我hostname鍵入它返回myhost 但是當我在hostname -f鍵入它返回hostname: Name or service not known

什麼是必要的行動,採取設置主機名?

hosts file: 
    ## 
    # Host Database 
    # 
    # localhost is used to configure the loopback interface 
    # when the system is booting. Do not change this entry. 
    ## 
    127.0.0.1 localhost 
    255.255.255.255 broadcasthost 
    ::1 localhost 
    fe80::1%lo0 localhost 

    97.107.128.97 plato.example.com plato 
+1

要設置主機名,只需運行'hostname new_hostname'。你想做什麼? – Blender 2012-02-19 20:04:07

+0

好的。我們會嘗試。遵循此[Linode入門指南](http://library.linode.com/getting-started#sph_set-the-hostname)。只是試圖部署 – 2012-02-19 20:06:09

+1

運行指南中列出的命令。它應該工作。 – Blender 2012-02-19 20:07:06

回答

2

編輯/etc/hostname/etc/hosts並確保你想要的主機名是在您的主機文件那裏,然後做#: hostname -F /etc/hostname

+0

我們這樣做了,即時將添加到上面的實際問題的主機文件的內容。我們去了etc目錄,沒有'hostname'文件,只有'hosts'。只是爲了澄清,這是在計算機上的等文件部署,對嗎?或者它在linode的ubuntu盒子上? – 2012-02-19 20:35:54

+1

在林德盒上。在你的計算機上執行它沒有任何區別。 – 2012-02-19 20:37:09

+0

好的。我們如何編輯盒子上的文件?通過終端?我不明白 – 2012-02-19 20:40:10