linux nameserver参数,linux - apache配置文件中的ServerName究竟指什么?

我们给定一个具体的场景:

域名: xyz.com

dns服务器 ns1.xxx.com

将绑定的ip地址 123.123.123.123

apache2安装在 123.123.123.123

在apache2的配置文件/etc/httpd/conf/httpd.conf中,有两个地方会出现ServerName。

第一个地方:

ServerName gives the name and port that the server uses to identify itself.

This can often be determined automatically, but we recommend you specify

it explicitly to prevent problems during startup.

If your host doesn't have a registered DNS name, enter its IP address here.

ServerName localhost:80

这里的ServerName localhost:80 是否可以修改成

ServerName 123.123.123.123:80

我理解成这样,是根据英语

If your host doesn't have a registered DNS name, enter its IP address here.

问题来了:如果我的主机有registered DNS name,应当如何处理呢?

第二个地方

你需要写下面这样的代码

ServerName www.xyz.com

DocumentRoot "/var/www/html"

从上面,我们可以看出:都是ServerName,但是他们对应的具体值,不一样。

1。我的理解对吗?

2。两个地方,我都写对了吗?

3。还有个问题:如果我的主机有registered DNS name,应当如何处理呢?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值