HOW TO: mod_throttle

error

i'm running apache 2



st
mod_throttle.c: At top level:
mod_throttle.c:1740: error: syntax error before '*' token
mod_throttle.c: In function `set_policy3':
mod_throttle.c:1745: error: `policy' undeclared (first use in this function)
mod_throttle.c:1752: error: `config' undeclared (first use in this function)
mod_throttle.c:1754: error: `limit' undeclared (first use in this function)
mod_throttle.c:1778: error: `period' undeclared (first use in this function)
mod_throttle.c: At top level:
mod_throttle.c:1811: error: syntax error before '*' token
mod_throttle.c: In function `set_policy':
mod_throttle.c:1815: error: `config' undeclared (first use in this function)
mod_throttle.c:1819: error: `p' undeclared (first use in this function)
mod_throttle.c:1819: error: `args' undeclared (first use in this function)
mod_throttle.c: In function `throttle_single_user':
mod_throttle.c:1884: warning: passing arg 1 of `create_dir_config' from incompatible pointer type
mod_throttle.c: In function `throttle_user':
mod_throttle.c:1939: warning: passing arg 1 of `ap_os_is_path_absolute' from incompatible pointer type
mod_throttle.c:1939: error: too few arguments to function `ap_os_is_path_absolute'
mod_throttle.c:1942: warning: assignment makes pointer from integer without a cast
mod_throttle.c:1949: warning: assignment makes pointer from integer without a cast
mod_throttle.c:1950: warning: assignment makes pointer from integer without a cast
mod_throttle.c: In function `throttle_runtime_file':
mod_throttle.c:2039: warning: assignment makes pointer from integer without a cast
mod_throttle.c: In function `throttle_lock_file':
mod_throttle.c:2052: warning: assignment makes pointer from integer without a cast
mod_throttle.c: In function `policy_over_limit':
mod_throttle.c:2219: warning: passing arg 4 of `ap_log_rerror' makes integer from pointer without a cast
mod_throttle.c:2219: warning: passing arg 5 of `ap_log_rerror' from incompatible pointer type
mod_throttle.c: In function `policy_document':
mod_throttle.c:2354: error: too few arguments to function `ap_sub_req_lookup_uri'
mod_throttle.c:2372: warning: passing arg 4 of `ap_log_rerror' makes integer from pointer without a cast
mod_throttle.c:2372: warning: passing arg 5 of `ap_log_rerror' from incompatible pointer type
mod_throttle.c: In function `policy_idle':
mod_throttle.c:2490: warning: passing arg 4 of `ap_log_rerror' makes integer from pointer without a cast
mod_throttle.c:2490: warning: passing arg 5 of `ap_log_rerror' from incompatible pointer type
mod_throttle.c: In function `policy_speed':
mod_throttle.c:2565: warning: passing arg 4 of `ap_log_rerror' makes integer from pointer without a cast
mod_throttle.c:2565: warning: passing arg 5 of `ap_log_rerror' from incompatible pointer type
mod_throttle.c: In function `is_request_for_file':
mod_throttle.c:2701: warning: initialization makes pointer from integer without a cast
mod_throttle.c:2702: warning: initialization makes pointer from integer without a cast
mod_throttle.c:2705: error: structure has no member named `st_mode'
mod_throttle.c:2705: error: structure has no member named `st_mode'
mod_throttle.c: In function `uri_handler':
mod_throttle.c:2739: error: too few arguments to function `ap_sub_req_lookup_uri'
mod_throttle.c: In function `access_handler':
mod_throttle.c:2788: warning: comparison between pointer and integer
mod_throttle.c:2794: warning: comparison between pointer and integer
mod_throttle.c:2814: error: request for member `sin_addr' in something not a structure or union
mod_throttle.c:2823: warning: comparison between pointer and integer
mod_throttle.c:2824: error: structure has no member named `st_size'
mod_throttle.c: In function `authentication_handler':
mod_throttle.c:2853: warning: comparison between pointer and integer
mod_throttle.c: In function `authorization_handler':
mod_throttle.c:2869: warning: comparison between pointer and integer
mod_throttle.c:2875: warning: comparison between pointer and integer
mod_throttle.c:2891: error: structure has no member named `user'
mod_throttle.c:2903: warning: comparison between pointer and integer
mod_throttle.c:2904: error: structure has no member named `st_size'
mod_throttle.c: In function `get_config_by_dir':
mod_throttle.c:2956: error: request for member `module_index' in something not a structure or union
mod_throttle.c: In function `mime_handler':
mod_throttle.c:2978: warning: comparison between pointer and integer
mod_throttle.c:2983: warning: assignment makes pointer from integer without a cast
mod_throttle.c:2986: warning: assignment makes pointer from integer without a cast
mod_throttle.c:3001: error: structure has no member named `st_uid'
mod_throttle.c:3016: warning: comparison between pointer and integer
mod_throttle.c:3017: error: structure has no member named `st_size'
mod_throttle.c: In function `fixup_handler':
mod_throttle.c:3042: warning: comparison between pointer and integer
mod_throttle.c:3051: warning: assignment makes pointer from integer without a cast
mod_throttle.c:3100: warning: passing arg 1 of `cmd_preserve' from incompatible pointer type
mod_throttle.c:3102: warning: passing arg 1 of `cmd_restore' from incompatible pointer type
mod_throttle.c:3128: warning: assignment makes pointer from integer without a cast
mod_throttle.c: In function `log_handler':
mod_throttle.c:3155: warning: comparison between pointer and integer
mod_throttle.c:3181: error: structure has no member named `st_uid'
mod_throttle.c:3188: error: request for member `sin_addr' in something not a structure or union
mod_throttle.c:3191: error: structure has no member named `user'
mod_throttle.c:3202: warning: comparison between pointer and integer
mod_throttle.c:3213: warning: comparison between pointer and integer
mod_throttle.c: In function `status_html_header':
mod_throttle.c:3276: warning: assignment makes pointer from integer without a cast
mod_throttle.c:3293: error: `ap_restart_time' undeclared (first use in this function)
mod_throttle.c: In function `status_html_line':
mod_throttle.c:3372: warning: assignment makes pointer from integer without a cast
mod_throttle.c:3379: warning: passing arg 1 of `ap_os_is_path_absolute' from incompatible pointer type
mod_throttle.c:3379: error: too few arguments to function `ap_os_is_path_absolute'
mod_throttle.c:3382: warning: assignment makes pointer from integer without a cast
mod_throttle.c: In function `general_html_header':
mod_throttle.c:3624: warning: assignment makes pointer from integer without a cast
mod_throttle.c: In function `general_html_line':
mod_throttle.c:3743: warning: assignment makes pointer from integer without a cast
mod_throttle.c: At top level:
mod_throttle.c:3871: error: syntax error before "content_handlers"
mod_throttle.c:3872: warning: braces around scalar initializer
mod_throttle.c:3872: warning: (near initialization for `content_handlers[0]')
mod_throttle.c:3872: warning: initialization makes integer from pointer without a cast
mod_throttle.c:3872: warning: excess elements in scalar initializer
mod_throttle.c:3872: warning: (near initialization for `content_handlers[0]')
mod_throttle.c:3873: warning: braces around scalar initializer
mod_throttle.c:3873: warning: (near initialization for `content_handlers[1]')
mod_throttle.c:3873: warning: initialization makes integer from pointer without a cast
mod_throttle.c:3873: warning: excess elements in scalar initializer
mod_throttle.c:3873: warning: (near initialization for `content_handlers[1]')
mod_throttle.c:3874: warning: braces around scalar initializer
mod_throttle.c:3874: warning: (near initialization for `content_handlers[2]')
mod_throttle.c:3874: warning: initialization makes integer from pointer without a cast
mod_throttle.c:3874: warning: excess elements in scalar initializer
mod_throttle.c:3874: warning: (near initialization for `content_handlers[2]')
mod_throttle.c:3876: warning: braces around scalar initializer
mod_throttle.c:3876: warning: (near initialization for `content_handlers[3]')
mod_throttle.c:3876: warning: initialization makes integer from pointer without a cast
mod_throttle.c:3876: warning: excess elements in scalar initializer
mod_throttle.c:3876: warning: (near initialization for `content_handlers[3]')
mod_throttle.c:3879: warning: braces around scalar initializer
mod_throttle.c:3879: warning: (near initialization for `content_handlers[4]')
mod_throttle.c:3879: warning: initialization makes integer from pointer without a cast
mod_throttle.c:3879: warning: excess elements in scalar initializer
mod_throttle.c:3879: warning: (near initialization for `content_handlers[4]')
mod_throttle.c:3881: warning: braces around scalar initializer
mod_throttle.c:3881: warning: (near initialization for `content_handlers[5]')
mod_throttle.c:3881: warning: initialization makes integer from pointer without a cast
mod_throttle.c:3882: warning: data definition has no type or storage class
mod_throttle.c:3886: warning: initialization from incompatible pointer type
mod_throttle.c:3889: warning: initialization from incompatible pointer type
mod_throttle.c:3892: warning: initialization from incompatible pointer type
mod_throttle.c:3895: warning: initialization from incompatible pointer type
mod_throttle.c:3898: warning: initialization from incompatible pointer type
mod_throttle.c:3901: warning: initialization from incompatible pointer type
mod_throttle.c:3904: warning: initialization from incompatible pointer type
mod_throttle.c:3908: warning: initialization from incompatible pointer type
mod_throttle.c:3911: warning: initialization from incompatible pointer type
mod_throttle.c:3914: warning: initialization from incompatible pointer type
mod_throttle.c:3920: error: syntax error before "throttle_module"
mod_throttle.c:3921: error: `this_module_needs_to_be_ported_to_apache_2_0' undeclared here (not in a function)
mod_throttle.c:3921: error: initializer element is not constant
mod_throttle.c:3921: error: (near initialization for `throttle_module')
mod_throttle.c:3922: warning: excess elements in scalar initializer
mod_throttle.c:3922: warning: (near initialization for `throttle_module')
mod_throttle.c:3923: warning: excess elements in scalar initializer
mod_throttle.c:3923: warning: (near initialization for `throttle_module')
mod_throttle.c:3924: warning: excess elements in scalar initializer
mod_throttle.c:3924: warning: (near initialization for `throttle_module')
mod_throttle.c:3925: warning: excess elements in scalar initializer
mod_throttle.c:3925: warning: (near initialization for `throttle_module')
mod_throttle.c:3926: warning: excess elements in scalar initializer
mod_throttle.c:3926: warning: (near initialization for `throttle_module')
mod_throttle.c:3927: warning: excess elements in scalar initializer
mod_throttle.c:3927: warning: (near initialization for `throttle_module')
mod_throttle.c:3928: warning: excess elements in scalar initializer
mod_throttle.c:3928: warning: (near initialization for `throttle_module')
mod_throttle.c:3929: warning: excess elements in scalar initializer
mod_throttle.c:3929: warning: (near initialization for `throttle_module')
mod_throttle.c:3930: warning: excess elements in scalar initializer
mod_throttle.c:3930: warning: (near initialization for `throttle_module')
mod_throttle.c:3931: warning: excess elements in scalar initializer
mod_throttle.c:3931: warning: (near initialization for `throttle_module')
mod_throttle.c:3932: warning: excess elements in scalar initializer
mod_throttle.c:3932: warning: (near initialization for `throttle_module')
mod_throttle.c:3933: warning: excess elements in scalar initializer
mod_throttle.c:3933: warning: (near initialization for `throttle_module')
mod_throttle.c:3934: warning: excess elements in scalar initializer
mod_throttle.c:3934: warning: (near initialization for `throttle_module')
mod_throttle.c:3935: warning: excess elements in scalar initializer
mod_throttle.c:3935: warning: (near initialization for `throttle_module')
mod_throttle.c:3937: warning: excess elements in scalar initializer
mod_throttle.c:3937: warning: (near initialization for `throttle_module')
mod_throttle.c:3940: warning: excess elements in scalar initializer
mod_throttle.c:3940: warning: (near initialization for `throttle_module')
mod_throttle.c:3943: warning: excess elements in scalar initializer
mod_throttle.c:3943: warning: (near initialization for `throttle_module')
mod_throttle.c:3948: warning: excess elements in scalar initializer
mod_throttle.c:3948: warning: (near initialization for `throttle_module')
mod_throttle.c:3948: warning: data definition has no type or storage class
apxs:Error: Command failed with rc=65536
.
 
link fixed

use this if you want set 10 request each IP
<IfModule mod_throttle.c>
ThrottlePolicy none
ThrottleClientIP 800 Request 10 1s
<Location /throttle-client-ip>
SetHandler throttle-client-ip
</Location>
</IfModule>

;)
 
Last edited:
Does this go by per connection and what would be the recommended settings for doing every say 30 seconds to prevent http floods?

code:<IfModule mod_throttle.c>
ThrottlePolicy Volume 10G 30d
</IfModule>

The ThrottlePolicy line is the key. The first number is the amount of data and acceptable letters are G, M and K. The second number is the period and acceptable letters are m, w, d, h, and s.
 
Last edited:
ProHS said:
Does this go by per connection and what would be the recommended settings for doing every say 30 seconds to prevent http floods?

Code:
ThrottleClientIP 650 Request 5 1s
limit by request
 
That would limt by request and not limit by IP because i notice it says ThrottleClientIP in there?
 
Last edited:
ProHS said:
That would limt by request and not limit by IP because i notice it says ThrottleClientIP in there?

Request:-
limit by user
Code:
ThrottleRemoteUser 650 Request 50 1s
limit by ip
Code:
ThrottleClientIP 650 Request 5 1s
:)
 
So for remote user could i set it to 5 request every 1s since it is talking about every computer connected to your server correct?

@how@ said:
Request:-
limit by user
Code:
ThrottleRemoteUser 650 Request 50 1s
limit by ip
Code:
ThrottleClientIP 650 Request 5 1s
:)
 
Last edited:
True but is that limit for remoteuser total for all remoteusers or per individuals remoteuser? The reason i ask because it says the oldest on the list gets deleted when a new remoteuser connects.
 
Just to point out, but the link in the first post gives a post that says that "Snert's Apache modules currently CLOSED to the public until further notice."

Is there something like this that allows me to prevent all the available bandwidth [speed not allowance] being used up when someone downloads a file?

No doubt, its probably easy to accomplish this but I'm a noob so steady on the laughter hehe ;)

Cheers
Nath.
 
I'm not sure what you mean, xemaps, since their FAQs have no section for DirectAdmin.

Jeff
 
Acunett.com support for DA

They make DA support, outsourced support.
You can buy helpdesk hours, one shot help, and give them ssh access.

They work well on all my servers.
 
He doesn't say anything about DA support or his charges on his website. He's only made one post to our forums, back in 2004.

How do we know anything about him before trusting our servers to him?

Jeff
 
I said it, they work for all my current DA servers.
I'm hosted in Europe, they make currently a great job through SSH.
 
hehe wasnt after management anyhow ;) if i did, i would have got a managed server, but thanks anyway.

couldnt afford the extra, and plus, i want to do it myself anyhow - helps me learn it :D

Anyhow, can anyone suggest the best way to work this server-wide?

- limit concurrent connections [though if its possible, only to downloadable files - im guessing it isnt possible but thought i'd add it]
- prevent downloads [even scripts too possibly] using all the available bandwidth of the dedicated connection i.e. via some way of capping it to a certain amount of Kb possibly.

Any suggestions of the config settings would be handy - i think i was reading this thread and a few others too late at night last night to understand it.... will have to re-read it later methinks.

Cheers
Nath.
 
Back
Top