a2ensite不显示/ etc / apache2 / sites-available中的所有站点

我刚刚重新安装了Apache2(Debian 2.4.4-6,libapache2-mod-php5 5.5.0〜rc3 + dfsg),当它重置时,我的所有虚拟主机都破了。 想知道如果我不小心清除了我的虚拟主机configuration,我去检查:

d8uv@ddd /etc/apache2/sites-available $ sudo ls -l total 32 -rw-r--r-- 1 root root 798 Jun 2 08:27 000-default.conf -rw-r--r-- 1 root root 394 Jul 9 2012 domain1.com -rw-r--r-- 1 root root 422 Jul 26 2012 domain2.com -rw-r--r-- 1 root root 427 Apr 28 2010 domain3.com -rw-r--r-- 1 root root 400 Apr 28 2010 domain4.com -rw-r--r-- 1 root root 393 Oct 26 2010 domain5.com -rw-r--r-- 1 root root 6432 Jun 2 08:27 default-ssl.conf 

所有在那里,让我们看看我能否启用它们:

 d8uv@ddd /etc/apache2/sites-available $ sudo a2ensite Your choices are: 000-default default-ssl Which site(s) do you want to enable (wildcards ok)? 

所以,configuration文件存在,但他们不被看到a2ensite。 也许在主configuration文件中closures虚拟主机?

 d8uv@ddd /etc/apache2/sites-available $ tail /etc/apache2/apache2.conf # Include of directories ignores editors' and dpkg's backup files, # see README.Debian for details. # Include generic snippets of statements IncludeOptional conf-enabled/*.conf # Include the virtual host configurations: IncludeOptional sites-enabled/*.conf # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 

仔细看看包含语句。 你看到了吗? 没有?

它包括sites-enabled/*.conf 。conf,所以重命名你的configfiles,使它们具有.conf扩展名。