Apache不响应configuration更改

我有一台运行在Ubuntu 12.04.4 LTS上的最新2.2版本的Apache服务器。 我没有改变大部分的configuration。 一切正常开始,但现在它没有注意到其configuration的任何改变。

例如,这里是一个.htaccess文件。

 <IfModule mod_rewrite.c> RewriteEngine on RewriteRule myfile [F] Header set X-Asdf rewrite_found </IfModule> 

这完全没有效果(即使我有mod_rewrite ),在.htaccess也没有任何其他的东西。

另外,我把这个添加到httpd.conf

 ServerSignature Off ServerTokens Prod 

根本没有效果。

我试过这些东西,没有任何影响:

  • service apache2 reload
  • service apache2 restart
  • 重启机器
  • 添加到httpd.conf

     <Directory *> AllowOverride All </Directory> 

Apache仍然在读取configuration,因为任何语法错误会在重新载入时报告错误。

什么可能导致这个?

编辑:

 root@my-server:~# apachectl -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server 127.0.0.1 (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost 127.0.0.1 (/etc/apache2/sites-enabled/000-default:1) Syntax OK 

我将这个答案作为Shane Madden发布 ,他在评论中告诉我这个没有。

解决的办法是对/etc/apache2/sites-enabled/000-default进行更改,而不是httpd.conf ,因为前者是在后者被读取的,所以在那里指令被覆盖。