在哪里编辑(文档的哪一部分)LAMP 服务器主机文件? [和正确的语法]
Where to edit (which part of the document ) a LAMP servers host file? [and correct synax]
尝试在 ubuntu 服务器上编辑主机文件时,文档建议更新系统的主机文件说
The hosts file creates static associations between IP addresses and
hostnames or domains which the system prioritizes before DNS for name
resolution. Open this file in a text editor and add a line for your
Linode’s public IP address. You can associate this address with your
Linode’s Fully Qualified Domain Name (FQDN) if you have one, and with
the local hostname you set in the steps above. In the example below,
203.0.113.10 is the public IP address, example-hostname is the local hostname, and example-hostname.example.com is the FQDN.
打开 SSH 连接后 运行
nano /etc/apache2/apache2.conf
现在可以编辑主机文件。滚动到页面底部添加新行后,我回顾了文档中的示例:
127.0.0.1 localhost.localdomain localhost
203.0.113.10 example-hostname.example.com example-hostname
这是正确的格式吗?
127.0.0.1 localhost.localdomain localhost
104.123.155.24 newhostuser.104.123.155.24 newhostuser
您可以在 /etc/hosts
文件中添加主机名条目。如果你想在 IP 地址上 运行 Apache 那么你可以编辑 apache2.conf 文件中的 Listen
条目。
尝试在 ubuntu 服务器上编辑主机文件时,文档建议更新系统的主机文件说
The hosts file creates static associations between IP addresses and hostnames or domains which the system prioritizes before DNS for name resolution. Open this file in a text editor and add a line for your Linode’s public IP address. You can associate this address with your Linode’s Fully Qualified Domain Name (FQDN) if you have one, and with the local hostname you set in the steps above. In the example below, 203.0.113.10 is the public IP address, example-hostname is the local hostname, and example-hostname.example.com is the FQDN.
打开 SSH 连接后 运行
nano /etc/apache2/apache2.conf
现在可以编辑主机文件。滚动到页面底部添加新行后,我回顾了文档中的示例:
127.0.0.1 localhost.localdomain localhost
203.0.113.10 example-hostname.example.com example-hostname
这是正确的格式吗?
127.0.0.1 localhost.localdomain localhost
104.123.155.24 newhostuser.104.123.155.24 newhostuser
您可以在 /etc/hosts
文件中添加主机名条目。如果你想在 IP 地址上 运行 Apache 那么你可以编辑 apache2.conf 文件中的 Listen
条目。