我正在尝试将我的 16.04 服务器迁移到 18.04,但我的一个 wordpress 网站遇到了问题。在设置 letsencrypt 之前,我想确保网站可以通过普通 http 运行,我的一个网站运行正常,但第二个网站无论如何都强制使用 https,导致无法访问网站的错误。我比较了两个 .conf 文件,两者之间的唯一区别是目录/服务器名称,所以我不确定为什么它在一个上强制使用 https,而在另一个上不强制使用。我尝试删除 chrome 和 safari 中的缓存,但两个浏览器仍然强制使用 https。我查看了日志,也没有看到任何错误。下面您将找到我的 .conf 文件。谢谢。
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName jojo.mydomain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/jojo
<Directory /var/www/html/jojo>
AllowOverride All
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf