Apache忽略任何新的.conf文件

我有一个Linode服务器,我运行了超过30个网站! 今天,我想添加另一个网站,我在Apache2文件夹中的sites-available文件夹中创build了一个新的.conf文件。

启用它并重新启动我的Apache后,它似乎根本不起作用。 当去新configuration的域时,它会加载我以前启用的网站之一,而不是新的。

我通常复制一个旧的.conf文件来创build一个新的。 但是,如果这是我的.conf文件:

 # domain: bilitsaz.ir # public: /var/www/bilitsaz.ir/public_html/ <VirtualHost *:80> # Admin email, Server Name (domain name), and any aliases ServerAdmin [email protected] ServerName www.bilitsaz.ir ServerAlias bilitsaz.ir # Index file and Document Root (where the public files are located) DirectoryIndex index.html index.php DocumentRoot /var/www/bilitsaz.ir/public_html # Log file locations LogLevel warn ErrorLog /var/www/bilitsaz.ir/logs/error.log CustomLog /var/www/bilitsaz.ir/logs/access.log combined </VirtualHost> 

我检查了documentRoot,这一切似乎是正确的。 我想知道你们能否帮助我,谢谢。

更新:

apachectl -t响应: syntax OK并且apachectl -S网站日志是: port 80 namevhost www.bilitsaz.ir (/etc/apache2/sites-enabled/bilitsaz.ir.conf:4) alias bilitsaz.ir

更新2:

好吧,我启用了让我们encryption的HTTPS网站,它加载得很好,但由于某些原因,我需要网站是普通的HTTP,我想知道为什么服务器不再加载任何新的HTTP虚拟主机

你的configuration看起来很好。 也许你有一些其他的问题,如.htaccessredirect,或者你试图通过https访问你的域名,但它没有正确configuration。

当你进入新的域名时,还要查看access.log。

 tail -f /var/www/bilitsaz.ir/logs/access.log 

编辑1:如果您要强制域名转到https而没有为其安装证书,它将始终将您redirect到具有证书的相同IP上的其他域。

编辑2:看看你的htaccess文件的httpsredirect或在您的网站/ CMSconfiguration。

编辑3:我不使用让我们encryption,但从我的谷歌:它可以强制任何域到HTTPS:

在安装依赖关系之后,您将看到一步一步的指导来定制您的证书选项。 系统会要求您提供丢失密钥恢复和通知的电子邮件地址,您可以select启用http和https访问,或者强制所有请求redirect到https。

也许它已经改变了主要的apache.conf。 我想你应该去Let's Encript社区支持。 对不起,如果我不能帮助你。