浏览器通过ip更改域,Debian,Apache2

Browser change the domain by ip, Debian, Apache2

当我在网络浏览器中输入时https://myBuyDomain at the time the web is loaded, it is changed to https://my_Ip_static

-虚拟主机

<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    DocumentRoot /miPath/web
    ServerName zzzzzz.page
    ServerAlias www.zzzzzz.page

    <Directory /miPath/web>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>

    <FilesMatch \.php$>
        SetHandler "proxy:unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/"
    </FilesMatch>

    SSLCertificateFile      /otherPath.pem
    SSLCertificateKeyFile /otherPath.key
</VirtualHost>

此外,当我尝试安装 certbot 时,但由于我不知道在哪里更改的内容而失败:

Fetching https://my_ip_static: Invalid host in redirect target "my_ip_static". 
Only domain names are supported, not IP addresses

正确的方法是使用 .htaccess 更改域的 my_ip_static?我不知道我做错了什么,还有什么需要配置。

错误出在 google 域配置中。我创建了一个重定向到一个网站。这个选项是重定向到外部网站而不是你自己的服务器。

1 - 删除网站重定向

2 - 在 DNS 部分,创建 2 个自定义资源记录

第一个:

     name = @
     Type = A
     TTL = 1h
     Data = static ip of my server

第二个:

     name = www
     Type = A
     TTL = 1h
     Data = static ip of my server

就这样,几分钟后服务器就可以访问了,而且ip不换域名