IvnSoft / mod_bw

Apache Module - Bandwidth Mod (mod_bw)
Apache License 2.0
9 stars 4 forks source link

bw mod not working on Debian GNU/Linux 11 (bullseye) ? #7

Open damirbax opened 8 months ago

damirbax commented 8 months ago

I'm trying to configure bwmod to work under debian, but no luck. Here are the current settings: Debian GNU/Linux 11 (bullseye) Release: 11 Apache version 2.4.56

instaling ok: apt-get update apt-get install libapache2-mod-bw enable ok: a2enmod bw

setings under virtual host:

<Location "/">
        SetHandler none
        Order Deny,Allow
        Deny from all
        Allow from 192.168.11.100 
    </Location>

    BandWidthModule On
    ForceBandWidthModule On
    BandWidth all 10240
    MaxConnectionsPerChild 40

checking OK apachectl configtest Syntax OK systemctl restart apache2

After that i have error 403 Forbidden You don't have permission to access this resource. It is same error on all virtual hosts. All permisions are OK. apache error log have no error jus usual notice:

[Wed Jan 17 11:05:59.795948 2024] [mpm_prefork:notice] [pid 2112495] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Jan 17 11:05:59.935236 2024] [:notice] [pid 2112739] mod_bw : Memory Allocated 0 bytes (each conf takes 48 bytes)
[Wed Jan 17 11:05:59.935338 2024] [:notice] [pid 2112739] mod_bw : Version 0.92 - Initialized [0 Confs]
[Wed Jan 17 11:05:59.981591 2024] [mpm_prefork:notice] [pid 2112739] AH00163: Apache/2.4.56 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1w mod_perl/2.0.11 Perl/v5.32.1 configured -- resuming normal operations
[Wed Jan 17 11:05:59.981631 2024] [core:notice] [pid 2112739] AH00094: Command line: '/usr/sbin/apache2'

Can you try this kind of setup and make new release which is be working under debian 11? Or I just doing something wrong ? :)

sosherof commented 8 months ago

You can turn up the module debug:

LogLevel Debug bw:trace6

But also looking at your config, you're using Apache 2.2 deny/allow statements. Look up the require statement.

damirbax commented 8 months ago

It is my mistake, sorry . I was put under virtual host separetly. It must be under virtual host directive like this:

ServerName www.example.com
<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/www.example.com
    ServerName www.example.com
    ErrorLog /var/www/www.example.com/logs/error-www.example.com.log
    LogLevel emerg
    TransferLog /var/www/www.example.com/logs/access-www.example.com.log
    RewriteEngine on
    RewriteCond %{SERVER_NAME} =www.example.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
    SSLEngine on
    ServerAdmin admin@example.com
    DocumentRoot /var/www/www.example.com
    ServerName www.example.com
    BandWidthModule On
    ForceBandWidthModule On
    BandWidth all 1224000
    #MaxConnectionsPerChild 40    
    ErrorLog /var/www/www.example.com/logs/error443-www.example.com.log
    LogLevel emerg
    TransferLog /var/www/www.example.com/logs/access443-www.example.com.log
    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLCertificateFile /etc/letsencrypt/live/www.example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/www.example.com/privkey.pem
</VirtualHost>

<Directory /var/www/www.example.com/>
    Options Indexes FollowSymLinks MultiViews
    Require all granted
</Directory>