Technology Programming

How to Use the Mod_bandwidth in Apache

    • 1). Locate the file named "mod_bandwidth.c" on your Apache web server or download it from the Apache Software Foundation, which is the open source website for the web server software.

    • 2). Copy the "mod_bandwidth.c" file to your desktop.

    • 3). Launch a command line utility used to interface with Apache.

    • 4). Type the command "cd Desktop", and then press the "enter" key on your keyboard, to navigate to the desktop directory within the command line utility.

    • 5). Type the command "su", followed by pressing the "enter" key on your keyboard. Enter your password when prompted, and then press the "enter" key again to log in as the administrator.

    • 6). Paste in the following command line, replacing the "username" portion of it with your username, and then press the "enter" key on your keyboard:

      gcc -DDARWIN -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -g -Os -pipe -DHARD_SERVER_LIMIT=2048 -DEAPI -DSHARED_MODULE -I/usr/include/httpd -c /Users/username/Desktop/mod_bandwidth.c

    • 7). Paste the following command into the command line utility, and then press the "enter" key:

      cc -bundle -undefined suppress -flat_namespace -Wl,-bind_at_load -o /usr/libexec/httpd/mod_bandwidth.so mod_bandwidth.o

    • 8). Type "cd /usr/libexec/httpd" and press the "enter" key on your keyboard.

    • 9). Type "ls -l", and then press your keyboard's "enter" key, to confirm that a file named "/usr/libexec/httpd/mod_bandwidth.so" has been created.

    • 10

      Apply the mod_bandwidth file to Apache web server by running this command:

      "cdmod +x mod_bandwidth.so"

    • 11

      Modify the "/etc/httpd/httpd.conf" file by typing the command "pico /etc/httpd/httpd.conf" and pressing the "enter" key on your keyboard.

    • 12

      Type "LoadModule bandwidth_module /usr/libexec/httpd/mod_bandwidth.so", and then press the "enter" key on your keyboard to save the changes.

    • 13

      Add the required dependent directories by typing each of the following commands. Press the "enter" key on your keyboard after every typing each command line. Do not type them in all at once and then press your keyboard's "enter" key.

      mkdir /tmp/apachebw

      mkdir /tmp/apachebw/link

      mkdir /tmp/apachebw/master

      chmod -R 777 /tmp/apachebw

    • 14

      Reboot the Apache web server by typing the command "apachet1 restart" to save the mod_bandwidth changes and deploy them.



Leave a reply