Where best to put Apache directives?

Discussion in 'General' started by crypted, Mar 11, 2011.

  1. crypted

    crypted New Member

    Allright, I'm setting up mod_spamhaus and mod_slotlimit as per HOWTO's on this site. Each require "IfModule" code but the instructions say to put it in /etc/apache2/apache2.conf.

    I'm thinking it would be better to put mod_spamhaus in ISPC's interface under Apache Directives possibly. Can I have custom IFMODULES per website in the directives? That way spamhaus wouldn't be used on smaller websites.
    <IfModule mod_spamhaus.c>
    MS_WhiteList /etc/spamhaus.wl
    MS_CacheSize 256
    Mod_slotlimit requires the following to be in the apache2.conf. Is it wise to put it in there? Or, does ISPC need it to be elsewhere? This is a global setting.
    <IfModule mod_slotlimit.c>
    AvailableSlotsPercent 15
    MaxConnectionsPerSite 30
    LimitSite www.BadSite.xxx
    LimitSiteConnections 15
    ClientIpLimit 15
    ForceVhostName On
  2. falko

    falko Super Moderator ISPConfig Developer

    I *think* you can put this in virtual hosts as well, but I haven't tried.

    Yes, you can put it in the apache2.conf if this should be a global setting.
  3. Sorry to wake up this old thread, but I'd need confirmation that a global directive setup into /etc/apache2/apache2.conf will well be applied to all websites on ISPConfig websites.
    And what if a similar directive is applied on a particular website ? Which one will be taken by Apache ?
    Thanks !
  4. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    Options you set in global config ( apache2.conf ) are usually valid everywhere.
    If you overwrite these options on vhost level ( or just later in the config ) they're going to "take over" if they match the request ( virtualhost, directory, htaccess ... ).
    electronico_nc likes this.

Share This Page