1

How could I disable an Apache 2.4 module in a VirtualHost configuration using Ubuntu 14 LTS server?

The modules is placed in the /etc/apache2/mods-enabled/ folder but I want to disable it for one certain VirtualHost.

Edit: It's the mod_security Apache module.

1
  • 1
    You need to specify which module. Modules are loaded server wide, but depending on the module you can alter their behavior or do another settings to prevent the unwanted usage. You can also use AllowOverride directive to prevent changes to these module settings. Commented Apr 14, 2015 at 7:44

2 Answers 2

1

Adapted from 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>
3

As Esa says, you can't disable loading of the module for just one vhost; the module is loaded server-wide. But depending on the module, you can configure it to do nothing by putting the right directives inside the vhost configuration. For example, for mod_rewrite,

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .