浏览器通过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
- 服务器工作正常,使用ssl,但我总是通过静态ip访问
- 自签名 CA、Apache2、Debian 9,使用 google 计算引擎。
- 唯一的变化是购买了域名,我设置的重定向是:https://mi_ip_static
- 我的域名:zzzzzz.page 和 www.zzzzzz.page
- 我不使用任何.htaccess
-虚拟主机
<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>
- /etc/host
my_ip_static zzzzzz.page www.zzzzzz.page
127.0.0.1 localhost hostname_machine
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
xxx.xxx.xxx.xxx aaaaa.aaaa.a.aaaaa.aaaaa old_hostname # Added by Google
xxx.xxx.xxx.xx metadata.google.internal # Added by Google
此外,当我尝试安装 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不换域名
当我在网络浏览器中输入时https://myBuyDomain at the time the web is loaded, it is changed to https://my_Ip_static
- 服务器工作正常,使用ssl,但我总是通过静态ip访问
- 自签名 CA、Apache2、Debian 9,使用 google 计算引擎。
- 唯一的变化是购买了域名,我设置的重定向是:https://mi_ip_static
- 我的域名:zzzzzz.page 和 www.zzzzzz.page
- 我不使用任何.htaccess
-虚拟主机
<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>
- /etc/host
my_ip_static zzzzzz.page www.zzzzzz.page 127.0.0.1 localhost hostname_machine ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters xxx.xxx.xxx.xxx aaaaa.aaaa.a.aaaaa.aaaaa old_hostname # Added by Google xxx.xxx.xxx.xx metadata.google.internal # Added by Google
此外,当我尝试安装 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不换域名