我正在托管服务器上运行nextcloud。默认情况下,服务器在12345.hoster.com
上可访问。我还购买了域mysite.biz
,并将A记录设置为服务器的IP。
由于它运行的是Apache2,因此我更改了conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName mysite.biz
DocumentRoot /var/www/nextcloud
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/nextcloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
此conf(及其等效于端口443)是唯一启用的conf。但是,我仍然可以通过在浏览器中打开12345.hoster.com
来访问我的网站。
如何仅通过mysite.biz
来服务我的网站?
编辑-
我的/etc/hosts/
确实仅包含“旧”主机名:
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
# Auto-generated hostname. Please do not remove this comment.
123.123.123.123 12345.hoster.com 12345
据我所知,DNS条目还可以:
dig mysite.biz
; <<>> DiG 9.13.7 <<>> mysite.biz
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38461
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;mysite.biz. IN A
;; ANSWER SECTION:
mysite.biz. 150 IN A 123.123.123.123
;; Query time: 17 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sa Mär 09 15:51:29 CET 2019
;; MSG SIZE rcvd: 56
和
[...]
;mysite.biz. IN CNAME
;; AUTHORITY SECTION:
mysite.biz. 3109 IN SOA somename.dzone.com. hoster.datacenter.com. 2019030802 86400 7200 604800 7200
[...]