Author |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Tue 18 Nov '14 21:00 Post subject: Limit number of sessions.... |
|
|
Hi all,
i am a beginner about apache and hope can found here some hints regarding what i'm trying to do.
I implemented a Reverse Proxy using apache2 v. 2.4
What i need to do is limit number of sessions against a Virtual Host.
Is that possible? if yes, can you point me in a right way?
Regards. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 19 Nov '14 15:04 Post subject: |
|
|
What do you mean with number of sessions? |
|
Back to top |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Wed 19 Nov '14 15:32 Post subject: |
|
|
Oh, ok let me explain better.
In apache i have many Vhost. Into one of them i need that no more then 50 people ( computers, devices, etc... ) can connectc to it.
Is more clear?
Hope Yes. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Wed 19 Nov '14 17:59 Post subject: |
|
|
Thanks James,
I seens that link and I wonder if was that i was looking for.
Thank you again. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 19 Nov '14 18:02 Post subject: |
|
|
MaxConnection all 1000 says that only 1000 connections are allowed. Put that into the vhost ( plus the other needed config) |
|
Back to top |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Wed 19 Nov '14 18:16 Post subject: |
|
|
Perfect! thank you again.
I will try and i'll report here just for others |
|
Back to top |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Thu 20 Nov '14 13:37 Post subject: |
|
|
Hi james,
i am trying to make it working but it seams is not.
I seeted up MAx client to 1 and trying from 2 different PC. I always can connect and limit is not reached or mod_bw is not working.
here is my code.
What's wrong?
Code: | <VirtualHost *:80>
RewriteEngine on
ServerName limit.domain.com
ProxyRequests Off
ProxyErrorOverride Off
ProxyPreserveHost On
ProxyReceiveBufferSize 4096
KeepAlive On
ProxyTimeout 900
<IfModule reqtimeout_module>
RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
</IfModule>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyReceiveBufferSize 4096
ProxyPass / http://intranet.domain.com/
ProxyPassReverse / http://domain.com/
BandwidthModule On
ForceBandWidthModule On
BandWidth all 102400000
MinBandwidth all -1
MaxConnection all 1
BandWidthError 510
ErrorDocument 510 /var/www/html/index.html
info
LogLevel trace8 proxy_msrpc:trace1 rewrite:trace8 proxy_http:trace8 http:trace1 ssl:trace1 core:trace8 filter:trace1 bw:trace8
CustomLog /var/log/apache2/rvpr-LIMIT_access.log "combined"
ErrorLog /var/log/apache2/rvpr-LIMIT_error.log
</VirtualHost> |
|
|
Back to top |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Fri 28 Nov '14 17:45 Post subject: |
|
|
Hi,
any idea about this issue?
Regards |
|
Back to top |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Fri 10 Apr '15 17:14 Post subject: |
|
|
Hi, i would like to raise this topic. Can someone explain me how to use it and make it works?
Regards
spady7 wrote: | Hi,
any idea about this issue?
Regards |
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Fri 10 Apr '15 17:30 Post subject: |
|
|
You should try to download a hugh file like 2 GB or so from the server which takes longer which a download tool like DownThemAll and see how many concurrent connection it can do. |
|
Back to top |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Mon 13 Apr '15 14:25 Post subject: |
|
|
James Blond wrote: | You should try to download a hugh file like 2 GB or so from the server which takes longer which a download tool like DownThemAll and see how many concurrent connection it can do. |
Hi James, thanks for reply. I was suspecting that i was not so clear about what i'am trying to do. Let me explain:
I have a videcenter that it distributes some videos. Let take for istan. video #1.
I pubblished this videocenter through Apache 2.4.
I give video#1 url to some customers, let say 10 customers.
They use it; what iam trying to do is that if a 11th customer try to use that specific URL it get redirect to an ERROR page ( provided by apache ).
This is what i need. Is that possibile with BW module? or there is another way?
Regards |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 13 Apr '15 15:37 Post subject: |
|
|
Then mod bw isn't the right solution nor apache. Such a thing you have to programm with a server side language of your choise.
There is the 3rd party module mod_auth_token, but I have no experience with that beast. At least I think then you would have to generate 10 tokens to that url. |
|
Back to top |
|
spady7
Joined: 18 Nov 2014 Posts: 14 Location: Italy
|
Posted: Mon 13 Apr '15 16:01 Post subject: |
|
|
James Blond wrote: | Then mod bw isn't the right solution nor apache. Such a thing you have to programm with a server side language of your choise.
There is the 3rd party module mod_auth_token, but I have no experience with that beast. At least I think then you would have to generate 10 tokens to that url. |
Thanks.
I read about that module, but isn't what i need. It limits and create specific URIs that are valid only for a certain period of time.
So, apache is not a solution. |
|
Back to top |
|