@f4Nm1Z9k2P Ist möglich, jedoch nicht zu empfehlen, da jede Domain einzeln eingetragen und entfernt werden muss. Der Weg eines Listener-Files ist sauberer und unter 5 Minuten zu bewerkstelligen. Inspirieren kann man sich von denen hier:
https://github.com/i-MSCP/imsc…contrib/Listeners/Apache2
Perl: /etc/imscp/listeners.d/40_apache2_bw.pl
- # i-MSCP Listener::Apache2::bw
- # Copyright (C) 2015 Ninos Ego <me@ninosego.de>
- #
- # This library is free software; you can redistribute it and/or
- # modify it under the terms of the GNU Lesser General Public
- # License as published by the Free Software Foundation; either
- # version 2.1 of the License, or (at your option) any later version.
- #
- # This library is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- # Lesser General Public License for more details.
- #
- # You should have received a copy of the GNU Lesser General Public
- # License along with this library; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- #
- ## Listener file which adds enties for the bw module.
- #
- package Listener::Apache2::bw;
- use iMSCP::EventManager;
- sub addbwEntries
- {
- my ($cfgTpl, $tplName) = @_;
- if($tplName =~ /^domain(?:_ssl)?\.tpl$/) {
- $cfgTpl = replaceBloc(
- "# SECTION addons BEGIN.\n",
- "# SECTION addons END.\n",
- "# SECTION bw BEGIN.\n" .
- getBloc(
- "# SECTION addons BEGIN.\n",
- "# SECTION addons END.\n",
- $cfgTpl
- ) .
- "BandwidthModule On\n" .
- "ForceBandWidthModule On\n" .
- "Bandwidth all 5485760\n"
- "MaxConnection all 25\n" .
- "# SECTION bw END.\n",
- $cfgTpl
- );
- }
- 0;
- }
- iMSCP::EventManager->getInstance()->register('beforeHttpdBuildConf', \&addbwEntries);
- 1;
- __END__
Ich habs nicht getestet, sollte aber laufen.
PS: Alternativ kann man ganz leicht noch nen Domaincheck hinzufügen, sofern man die Einträge nicht bei allen Domains drin haben möchte...