不知何故我的 Apache2 vhost.conf 文件被破坏了,现在所有网站都被重定向到一个

不知何故我的 Apache2 vhost.conf 文件被破坏了,现在所有网站都被重定向到一个

最近选择将我的所有网站合并到一台服务器上。我之前将它们拆分到两台机器上,每台机器都成功支持多个域。合并各自的 vhost.conf 文件后,我发现有些问题。现在对任何域的请求都被重定向到一个域:https://explorer.bitcoin-rebooted.xyz:3001

在 Gentoo linux 4.19.57 下运行 apache 2.4.41

希望有人能帮我解决这个问题,显然我忽略了一些基本的东西。

vhost.conf,进行了一些编辑以防止其被视为垃圾邮件:

<VirtualHost *:80>
Servername kevinsthoughts.com
Redirect "/" "https://www.kevinsthoughts.com"
</VirtualHost>

<VirtualHost *:80>
Servername www.kevinsthoughts.com
Redirect "/" "https://www.kevinsthoughts.com"
</VirtualHost>

<VirtualHost *:443>
Servername www.kevinsthoughts.com
DocumentRoot /home/thoughts/public_html/wordpress
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/www.kevinsthoughts.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.kevinsthoughts.com/privkey.pem
<Directory "/home/thoughts/public_html/wordpress">
    Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:443>
Servername forum.kevinsthoughts.com
DocumentRoot /home/thoughts/public_html/smf
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/forum.kevinsthoughts.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/forum.kevinsthoughts.com/privkey.pem
<Directory "/home/thoughts/public_html/smf">
    Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:443>
Servername web.carpenter-farms.us
DocumentRoot /var/www/localhost
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/web.carpenter-farms.us/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/web.carpenter-farms.us/privkey.pem
</VirtualHost>

<VirtualHost *:80>
Servername explorer.bitcoin-rebooted.xyz
Redirect "/" "http://explorer.bitcoin-rebooted.xyz:3001"
</VirtualHost>

<VirtualHost *:80>
Servername www.bitcoin-rebooted.xyz
Redirect "/" "https://www.bitcoin-rebooted.xyz"
</VirtualHost>

<VirtualHost *:443>
Servername bitcoin-rebooted.xyz
Redirect "/" "https://www.bitcoin-rebooted.xyz"
</VirtualHost>

<VirtualHost *:443>
Servername www.bitcoin-rebooted.xyz
DocumentRoot /coin/btr/public_html/wordpress
Setenv VLOG /var/logs
<Directory "/coin/btr/public_html/wordpress">
     AllowOverride all
     Require all granted
  </Directory>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/www.bitcoin-rebooted.xyz/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.bitcoin-rebooted.xyz/privkey.pem
</VirtualHost>

答案1

最终发现存在几个问题。

使用 代替 固定几个站点。

其中一个重定向服务器上的 php-fpm 配置文件已重置为默认值,这导致了一些错误。

其余错误是服务器之间端口遗留的 Wordpress 控制文件错误。

猜测 Memcached 的使用使事情变得复杂,因为需要多次刷新才能获得有意义的响应。

在 apache 中使用 LogLevel debug 有很大帮助。

相关内容