域名和 DNS 问题
子域名显示"404 Not Found"
问题: 访问 tenant.yoursite.com 显示 404 错误。
解决方案:
Apache
- 检查虚拟主机配置中是否有
ServerAlias *.yoursite.com - 确保
mod_rewrite已启用:sudo a2enmod rewrite - 重启 Apache:
sudo systemctl restart apache2
Nginx
- 检查服务器块中是否有
server_name yoursite.com *.yoursite.com; - 测试配置:
sudo nginx -t - 重启:
sudo systemctl restart nginx
cPanel
- 验证 cPanel → Domains 中是否存在通配符子域名
- 确保它指向正确的目录
DNS
- 验证通配符 DNS 记录是否存在:
*.yoursite.com → 您的服务器 IP - 在 dnschecker.org 检查传播情况
- 等待最多 48 小时完全传播