我有一个论坛网站停止加载,现在显示默认页。
这很奇怪,因为所有的设置文件都是自动生成的,直到最近重启之前都没有问题。
以下是 apache 的 conf 文件:
**all.conf**
<VirtualHost *:80>
DirectoryIndex index.html index.htm index.php
ServerAlias *blegends.ru
AssignUserID webserver webserver
DocumentRoot /var/www/html
DirectoryIndex index.php index.html
Alias /playvds-widget /home/webserver/widget
Alias /playvds-donate /home/webserver/donate
Alias /playvds-launcher /home/webserver/launcher
Alias /playvds-phpmyadmin /home/webserver/phpmyadmin
Alias /playvds-net2ftp /home/webserver/net2ftp
</VirtualHost>
<Directory /home/webserver/widget>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/donate>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/launcher>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/phpmyadmin>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/net2ftp>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
以及网站相关的conf文件:
**blegends.ru.conf**
<VirtualHost *:80>
DirectoryIndex index.html index.htm index.php
ServerName blegends.ru
AssignUserID webserver webserver
DocumentRoot /home/webserver/www/blegends.ru
DirectoryIndex index.php index.html
Alias /playvds-widget /home/webserver/widget
Alias /playvds-donate /home/webserver/donate
Alias /playvds-launcher /home/webserver/launcher
Alias /playvds-phpmyadmin /home/webserver/phpmyadmin
Alias /playvds-net2ftp /home/webserver/net2ftp
</VirtualHost>
<Directory /home/webserver/www/blegends.ru>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/widget>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/donate>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/launcher>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/phpmyadmin>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /home/webserver/net2ftp>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
该论坛位于目录 /home/webserver/www/blegends.ru/
是 apache 出了问题还是其他原因?我查看了 conf 文件,没有发现任何问题。
编辑1: 我删除了文件“all.conf”,现在它可以正常工作了。但我不明白为什么该文件之前不允许工作,我的解决方案是否正确?
答案1
似乎您配置不正确。似乎您在 apache conf 和网站 conf 中引用了多个 blegends.ru 条目,且位置不同。此外,在虚拟主机标签中,您可以提供以下内容
<VirtualHost blegends.ru:80>
像这样并设置_default_:80
为默认服务。
检查你的站点配置是否已启用。要启用它,请尝试 cmd
sudo a2ensite yoursite.conf
重新启动你的 apache 服务。