UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Technical Support > Control Panel Questions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 14-11-2006, 22:17
Senior System Administrator
 
Join Date: Oct 2006
Posts: 145
Thumbs up How To: Limit your customers (or free sites!) on amount of bandwidth....

How To: Limit your customers (or free sites!) on amount of bandwidth they can use daily using mod_throttle.

The Apache module, mod_throttle gives you the ability to further focus your client's bandwidth usage. Instead of giving them 30 GB/Month, how about giving them 1 GB/Day? Or 42 MB/Hour? Even 11KB/sec? You get the idea. We've all had clients than burn through their bandwidth in the first few days. Or how about a website that gets 'slashdotted?'

SSH into your box and do the following:

Code:
mkdir /home/src
cd /home/src
wget www. mirrorservice.org/sites/www.ibiblio.org/gentoo/distfiles/mod_throttle312.tgz
tar zxvf mod_throttle312.tgz
cd mod_throttle-3.1.2
Need to locate apxs :

Quote:
locate apxs
Output should be :
/usr/local/apache/bin/apxs OR
/usr/sbin/apxs

Now we will have to edit Makefile :

Quote:
vi Makefile
change APXS=apxs to APXS=[APXS PATH]
Now save this file, and continue to compile..

Quote:
make
make install
Now, restart apache:

Quote:
/usr/local/apache/bin/apachectl restart
Now it's installed!

Now how to use it......?

Edit your /etc/httpd/conf/httpd.conf OR /usr/local/apache/conf/httpd.conf and locate the virtualhost entry for the website you wish to throttle. Just BEFORE the < /VirtualHost > entry, insert:

Quote:
< IfModule mod_throttle.c >
ThrottlePolicy Volume 1G 1d
< /IfModule >
< Location /throttle-me >
SetHandler throttle-me
< /Location >
Note : remove the space after "<" and before ">".

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.


Then restart Apache (service httpd restart) Now you can go to:

http://throttleddomain.com/throttle-me

And see the status of the throttle.

If you want to be able to see the status of all throttled websites on the server at once, go to the first virtualhost entry in your httpd.conf file (this should be the entry for your server's hostname) and add the following:

Quote:
< Location /throttle-status >
SetHandler throttle-status
< /Location >
Then restart Apache again, and you can go to http://hostname/throttle-status and see the status of all throttled websites.

That's all !

---------------------------------
Best Regards,
UKShane
http://www.eukhost.com
Reply With Quote
  #2 (permalink)  
Old 19-04-2007, 15:05
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default Re: How To: Limit your customers (or free sites) on amount of bandwidth....

Quote:
Originally Posted by eUKShane View Post
Now it's installed! ... Now how to use it......? ...
Find the line:
I would like to try this utility but am confused by a missing piece of info here — 'find the line' is empty? Could you please explain how the utility is configured/used in a bit more detail?

P.S. I notice that the MultiQuote feature of vBulletin isn't working with your custom template, otherwise I might have been able to display the empty Quote window I alluded to ...

Last edited by 247h : 21-10-2007 at 14:22. Reason: repair emdashes changed by database update to utf-8
Reply With Quote
  #3 (permalink)  
Old 19-04-2007, 15:51
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,302
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com
Default

I got this sorted. Tried many things but if you remove the space between < and /virtualhost then it wont get displayed.
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || MSN : mark @ eukhost.com || AIM : eukmark
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Great Opportunity :: Join our Affiliate Program for FREE and earn 20% commission on each referral.
Reply With Quote
  #4 (permalink)  
Old 19-04-2007, 16:18
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default

Thanks Mark! I think it's preferable to display SSH commands in a Code window which leads me to ask, did you edit Shane's post by hacking the database 'cos I could have sworn all his quoted sections were 'Quotes' yet now, the top one has 'Code' status?

Anyway, regarding the second part of my earlier message you can multiquote or nest a Code window it seems, but not a Quote window with this custom template!
Reply With Quote
  #5 (permalink)  
Old 21-04-2007, 22:29
Member
 
Join Date: Apr 2007
Posts: 61
Default

Shane, I don't think you realise how grateful I am! I have been searching for a way in which do to exactly as you describe for, quite literally, months.

I've not had much experience installing such modules, but will be sure to let you know how it goes.

Thanks again.
Reply With Quote
  #6 (permalink)  
Old 21-04-2007, 22:36
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,302
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com
Default

Quote:
Originally Posted by 247h View Post
Thanks Mark! I think it's preferable to display SSH commands in a Code window which leads me to ask, did you edit Shane's post by hacking the database 'cos I could have sworn all his quoted sections were 'Quotes' yet now, the top one has 'Code' status?

Anyway, regarding the second part of my earlier message you can multiquote or nest a Code window it seems, but not a Quote window with this custom template!
I had to edit his post to get things to showup but multi quotes option is enabled for the forum and I don't think I can figure out why it wont work with this theme.
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || MSN : mark @ eukhost.com || AIM : eukmark
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Great Opportunity :: Join our Affiliate Program for FREE and earn 20% commission on each referral.
Reply With Quote
  #7 (permalink)  
Old 22-04-2007, 08:09
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default Multi-Quoting or Nesting?

Quote:
Originally Posted by 247h View Post
Thanks Mark! I think it's preferable to display SSH commands in a Code window which leads me to ask, did you edit Shane's post by hacking the database 'cos I could have sworn all his quoted sections were 'Quotes' yet now, the top one has 'Code' status?

Anyway, regarding the second part of my earlier message you can multiquote or nest a Code window it seems, but not a Quote window with this custom template!
Quote:
Originally Posted by eukhost.com View Post
I had to edit his post to get things to showup but multi quotes option is enabled for the forum and I don't think I can figure out why it wont work with this theme.
Mark, I've discovered there's nothing wrong with Multi-Quotes in your forum (or at least in the default skin which I'm using in preference to your custom one)!:eek: I apologise for hijacking this thread by discussing them here instead of in a separate topic in the Support > Tutorials/How To section (I may do that later) ...

I had misunderstood the concept of Multi-Quotes in vBulletin — what I referred to originally was an inability to use nested quotes (i.e. a quote of a quote) to display Shane's quotes in my reply to his message. I've just discovered that nested quotes are not possible in vBulletin and many users in their forum have been pushing for this feature to be added (which is a standard feature of SMF; that's where we all have the experience of it and like it so much). This is also why it's better to use a Code window ALWAYS when displaying code or other procedures, because it can be nested (at least once) in a reply.

A Multi-Quote is what I've used in my reply here, by selecting my earlier message and your last to display them both contextually; you can also add quotes from messages in other topics by following the attached procedure (note that each quote uses the topic reference number). Warning: if you go around tagging any other topics for quoting, they will be included in every reply you make with quotes, so remember to deselect them ...
Attached Images
File Type: jpg multiquote.jpg (87.2 KB, 2 views)
__________________
Gadge

Too many nice toys — too little time to play with 'em!

Last edited by 247h : 22-04-2007 at 08:13.
Reply With Quote
  #8 (permalink)  
Old 22-04-2007, 08:53
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default

Quote:
Originally Posted by 247h View Post
...I've just discovered that nested quotes are not possible in vBulletin ...
Sorry to dwell on this but if you are interested in adding nested quotes Mark, it appears there's an easy hack for it which may be found here.
__________________
Gadge

Too many nice toys — too little time to play with 'em!
Reply With Quote
  #9 (permalink)  
Old 22-04-2007, 09:12
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default

Quote:
Originally Posted by eUKShane View Post
In the Makefile, you should change this line:
Quote:
APXS=apxs
To get this thread back on-topic I tried this installation but failed to get further than here, with this result:
Code:
root@hostname [/home/src/mod_throttle-3.1.2]# make
apxs -c    mod_throttle.c
make: apxs: Command not found
make: *** [mod_throttle.so] Error 127
As the compile appears to fail, how to proceed please?
__________________
Gadge

Too many nice toys — too little time to play with 'em!
Reply With Quote
  #10 (permalink)  
Old 25-04-2007, 14:44
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default

Quote:
Originally Posted by 247h View Post
To get this thread back on-topic I tried this installation but failed to get further than here, with this result:
Code:
root@hostname [/home/src/mod_throttle-3.1.2]# make
apxs -c    mod_throttle.c
make: apxs: Command not found
make: *** [mod_throttle.so] Error 127
As the compile appears to fail, how to proceed please?
Bump — I was hoping for an answer to this by now?! I presume there's some key information missing regarding APXS?
__________________
Gadge

Too many nice toys — too little time to play with 'em!

Last edited by 247h : 21-10-2007 at 14:22. Reason: repair emdashes changed by database update to utf-8
Reply With Quote
  #11 (permalink)  
Old 25-04-2007, 15:13
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default

Quote:
Originally Posted by 247h View Post
Bump — I was hoping for an answer to this by now?! I presume there's some key information missing regarding APXS?
Answering (hopefully) my own question now, having done some research I came up with this:
Code:
apxs is a tool for building and installing extension modules for the Apache HyperText 
Transfer Protocol (HTTP) server. This is achieved by building a Dynamic Shared Object 
(DSO) from one or more source or object files which then can be loaded into the Apache 
server under runtime via the LoadModule directive from mod_so.

So to use this extension mechanism, your platform has to support the DSO feature and 
your Apache httpd binary has to be built with the mod_so module. The apxs tool automatically 
complains if this is not the case. You can check this yourself by manually running the command

       $ httpd -l

The module mod_so should be part of the displayed list.
I presume my Apache server isn't configured in this way, so what are the implications for implementing this or should I be raising a ticket now?
__________________
Gadge

Too many nice toys — too little time to play with 'em!
Reply With Quote
  #12 (permalink)  
Old 25-04-2007, 21:00
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,302
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com
Default

do you want me to inform Shane about this thread or have you figured out a solution on your problem ?
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || MSN : mark @ eukhost.com || AIM : eukmark
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Great Opportunity :: Join our Affiliate Program for FREE and earn 20% commission on each referral.
Reply With Quote
  #13 (permalink)  
Old 25-04-2007, 21:33
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default

Thanks for responding Mark — no, I haven't found a solution, just the reason why I can't install mod_throttle. Having confirmed that running httpd -l gave me no indication that module mod_so exists on my server, I was asking if I need to email dedicated@ in order to get Apache server re-built to include it? You haven't mentioned whether this module is installed as standard practice so if it requires a comment from Shane then yes, please ask him ...
__________________
Gadge

Too many nice toys — too little time to play with 'em!

Last edited by 247h : 21-10-2007 at 14:23. Reason: repair emdashes changed by database update to utf-8
Reply With Quote
  #14 (permalink)  
Old 26-04-2007, 18:44
Senior System Administrator
 
Join Date: Oct 2006
Posts: 145
Thumbs up

Hey,

Actually I forgot to mention the changes in Makefile, which are as follows :

Quote:
Need to locate apxs :

#locate apxs

Output should be :
/usr/local/apache/bin/apxs OR
/usr/sbin/apxs

Now we will have to edit Makefile :

vi Makefile
change APXS=apxs to APXS=[APXS PATH]
Even I have edited the post. So please try to do in that way, if the problem still exists then let me know or just email to dedicated@ .

Thanks for drawing my attentions towards this.
__________________

Best Regards,
Sebastian
Senior System Administrator
http://www.eukhost.com/
Reply With Quote
  #15 (permalink)  
Old 26-04-2007, 23:49
247h's Avatar
Premium Member
 
Join Date: Nov 2006
Location: Buckingham UK
Posts: 253
Send a message via AIM to 247h Send a message via MSN to 247h Send a message via Yahoo to 247h
Default

Thanks Shane — I'm a bit further forward but your tutorial is still lacking some detail and I'll stay here for the benefit of any others (rather than submitting a ticket)! You wrote:
Quote:
Now it's installed!
Now how to use it......?
Find the line:
What you omitted to say was which file needs to be edited and I presume it's
/user/local/apache/conf/httpd.conf ?

The description then becomes a little disjointed but between you and Mark, you indicated that at the closure of each domain's 'VirtualHost' entry (that you wish to throttle), you insert this code:
Code:
< IfModule mod_throttle.c >
ThrottlePolicy Volume 1G 1d
< /IfModule >
< Location /throttle-me >
SetHandler throttle-me
< /Location >
and here's a complete VirtualHost example in the way I understood this:
Code:
<virtualhost 87.117.***.***="">< VirtualHost 87.117.***.*** >
ServerAlias domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/accountname/public_html
BytesLog domlogs/domain.com-bytes_log
User accountname
Group accountname
ServerName www.domain.com

User accountname
Group accountname
CustomLog /usr/local/apache/domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/accountname/public_html/cgi-bin/

< IfModule mod_throttle.c >
 ThrottlePolicy Volume 1G 1d
 < /IfModule >
 < Location /throttle-me >
 SetHandler throttle-me
 < /Location ></virtualhost>
< /VirtualHost >
I presume the 'ThrottlePolicy Volume' values shown here, '1G 1d', represents 1GB/day — would you please list the other abbreviations that may be used?

Now, the part that prevented me from completion was this, because you weren't clear about *where* the extra parameters should be entered. You wrote:
Code:
Now, also go to the very first virtual host entry, and add these lines:

Quote:
< Location /throttle-status >
SetHandler throttle-status
< /Location >
Using the first entry example from my own server's httpd.conf can I presume the extra parameters go at the end? Viz:
Code:
< VirtualHost 87.117.***.*** >
BytesLog domlogs/hostname.domain.com-bytes_log
ServerName hostname.domain.com
DocumentRoot /usr/local/apache/htdocs
< Location /throttle-status >
SetHandler throttle-status
< /Location >
< /VirtualHost >
OK, I'm reluctant to experiment with my httpd.conf until I receive confirmation of these final steps, but that is the end of my questions regarding mod_throttle, however ...

Going off at a tangent again, can I say that in writing the above message I discovered other unexpected problems with vBulletin — first, the Code tags are surely supposed to allow anyone to enter ANY and ALL code expressions and display them without any formatting issues — not so here! In order to display them here, every one of those open/close expressions has to have white space added after the opening bracket and before the closing bracket, or when you preview/submit the message, the expression is discarded from the output! This problem applies equally to a Quote window (as you discovered, Mark, but that's to be expected). Additionally, each Code window when displayed has an excess of white space at the end (those shown above are not due to me adding extra carriage returns).

This would be a complete nonsense for such a leading forum software and as I said earlier I have little current experience of using vBulletin these days, I no longer know whether this is/was typical or not — so I went to check elsewhere and the bad news, for you, is that this doesn't happen in another vBulletin forum I tried!!

There is one obvious visual difference — your forum's Code window is formatted in Verdana, just like the rest of the message; I'd say it is more typical that a Code window is formatted in Courier, or raw text (whichever) so is it that you have made a change and introduced this problem unwittingly? I suggest that in Courier, the chevrons would be represented in source code by their code form of '& l t ;' and '& g t ;' (yes I had to add white space to allow them to be displayed)!

Late edit: I was just re-reading my post and switched to the Proweb Fluid skin, only to find that Code window contents are then displayed in Courier, but still with the same problem! :eek: Sorry for any confusion — I think what I mean is that this forum's Code window contents seem to be displayed in HTML, not in unformatted text (as in the other vBulletin forum I tried).
__________________
Gadge

Too many nice toys — too little time to play with 'em!

Last edited by 247h : 21-10-2007 at 14:25. Reason: repair emdashes changed by database update to utf-8
Reply With Quote
  #16 (permalink)  
Old 27-04-2007, 15:15
Senior System Administrator
 
Join Date: Oct 2006
Posts: 145
Thumbs up

Hey Gadge,

I have edited the post again and this time have tried to explain in detail.

- Yes, you will have to edit /usr/local/apache/conf/httpd.conf file.
- 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.
- Not sure about your extra parameters.
__________________

Best Regards,
Sebastian
Senior System Administrator
http://www.eukhost.com/
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:54.

 

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

Business Web Hosting
100% uptime Hosting

Cpanel Hosting
cPanel Shared Hosting

Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

Customer Testimonials
eUK Customer Testimonials


knowledgebase articles

eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting


popular blog categories


Web Hosting
Website Hosting articles

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles