2012-02-19 69 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

相关问题