2 sample articles on given title
TRANSCRIPT
-
7/24/2019 2 Sample Articles on Given Title
1/16
How To Specify Limited Number Of
Connections In your Server
Most applications serving downloading from internet like
IDM and DAP tries to setup parallel or simultaneous
connections to a download server in order to gain faster
download speed. However with the multiplication in the
number of parallel connections for faster download can even
take the server down. So you can say that as the number of
parallel connection increases the download speed from the
server decreases. Here in this article the word server is stands
for Dedicated Server or Virtual Private Server (VPS)
Here we will guide you on how you can set a boundary for
total number of connections coming from a single IP towards
your server to avoid traffic. This will limit the number of
connections and prevent the server from getting down. This
will be of great help while RapidLeech transloading server or
building file sharing site. To speed up the loading speed, most
of the latest web browsers set compound connection. This
makes setting the number of connection for a single IP the
best option for your server. Although defining a limited
number of connections does not mean to set connection limit
to one for your website. This will make the website guest
think that the traffic is too low at your site and it may take
more than a while for data loading. One should set a limit
which should not as low as one or not as high as hundred.
Though the total number of parallel connection on the server
-
7/24/2019 2 Sample Articles on Given Title
2/16
is up to the Admin however 20 is the better number for you to
move on with. Like this you can set the maximum number of
simultaneous connection on a server for a single IP by using
port 80 which is a default http port.
Here we have used Ubuntu-based server, however other
Distros will not exactly be same but can be consider similar.
Steps on how to limit maximum connections in your server
Step 1:You need to login to your server via SSH and for that
we will be using PuTTY to connect to your dedicated server
or VPS.
You will the below details in hand before you open PuTTY
Host:Host can be anything amongst your domain name, your
servers IP address or the name of your server eg
vps####.websitename.com
Username:Use the cPanel Username of your website
Password:Use the cPanel Password of your website
Connecting to PuTTY
a. Open PuTTY
b. Enter the Hostname
c. Click Open
d. Click YES if you get PuTTY security alert
e. Login As message will appear on the screen.
f. Enter Username. Click Enter
g. Enter Password. Click Enter
-
7/24/2019 2 Sample Articles on Given Title
3/16
When you have successfully logged in you will see
username@vps####.websitename.com [~]#.
Step 2: Inter following commands to iptables rule in order torestrict connections to N number. Where N will be the number
of connections you want to keep connected at a time.
The default command syntax for Firewall configuration is:
iptables A INPUT p tcp syn dport $port
m connlimit connlimitabove N j REJECT
rejectwith tcpreset
Change $ port with the port number you wish to limit the
connection. Make it 22 for SSH and for http change it to 18.
Eg: In order to limit the connection to 20 write the following
commands.
iptables A INPUT p tcp syn dport 80 m
connlimit connlimitabove 20 j REJECT
rejectwith tcpreset
Example for the command:
The above command will limit the permitted SSH to 3 forsingle IP.
-
7/24/2019 2 Sample Articles on Given Title
4/16
iptables A INPUT p tcp syn dport 22 m
connlimit connlimitabove 3 j REJECT
And follow this syntax for RedHat and friends:
/sbin/iptables-A INPUT -p tcp --syn --
dport 80 -m connlimit --connlimit-above
20 -j REJECT --reject-with tcp-reset
Step 3:Once done with the commands you further need to
save that configuration. So that RedHat and friends can use it:
Follow the below mentioned command
service iptables save
you can even save the currently active iptables rule using the
below mentioned command syntax (Ubuntu, Debian and
friends):
iptables-save > /etc/iptables.up.rules
You can see the plan in action same as the given screenshot:
Step 4: The above explained steps will only make iptables
rules gets flushed of every time you will reboot the server.
Thus you will also need to follow the below command as well.
Firstly you need to create a new file which will be called
every time the network interface will get enabled. Below you
-
7/24/2019 2 Sample Articles on Given Title
5/16
will find the command for creating that file and screenshot for
the same.
nano /etc/network/if-pre-up.d/iptables
Screenshoot:
Step 5: Once done with the launching of nano editor now its
time to reload the iptables rules. And for that you need to
write these commands:
12
#!/bin/bash/sbin/iptables-restore