在vhost中禁用Apache模块

我怎样才能使用Ubuntu 14 LTS服务器在VirtualHostconfiguration中禁用Apache 2.4模块?

这些模块放在/etc/apache2/mods-enabled/文件夹中,但是我想为某个VirtualHost禁用它。

编辑:这是Apache模块的mod_security。

改编自https://stackoverflow.com/questions/12928360/how-can-i-disable-mod-security-in-htaccess-file

  <VirtualHost *:80> ServerName example.com <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> </VirtualHost> 

正如Esa所说的,你不能仅仅为一个虚拟主机加载模块。 该模块在服务器范围内加载。 但是,根据模块的不同,您可以将其configuration为在vhostconfiguration中放置正确的指令。 例如,对于mod_rewrite,

 RewriteEngine on <VirtualHost *:80> ServerName example.com RewriteEngine off </VirtualHost>