Bài đăng

Đang hiển thị bài đăng từ Tháng 6, 2013

Clear Memory Cache on Linux Server

Hình ảnh
By default the Linux OS has a very efficient memory management process that should be freeing any cached memory on the machine that it is being run on. However when it comes to Cached memory the Linux OS may at times decide that the Cached memory is being used and is needed which can lead to memory related issues and ultimately rob your server of any potentially free memory. To combat this you can force the Linux OS to free up and stored Cached memory. Connect via shell using a program such as Putty At the shell prompt type  crontab -e  <enter> as this will allow you to edit cron jobs for the root user. If you are not familiar with vi (linux editor) you press "i" to insert text and once done hit "esc" and type ":wq" to save the file. Scroll to the bottom of the cron file using the arrows key and enter the following line: 0 * * * * /root/clearcache.sh Create a file in '/root' called 'clearcache.sh' with the following conten

(D)DoS Deflate

(D)DoS Deflate  is a lightweight bash shell script designed to assist in the process of blocking a denial of service attack. It utilizes the command below to create a list of IP addresses connected to the server, along with their total number of connections. It is one of the simplest and easiest to install solutions at the software level. netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n IP addresses with over a pre-configured number of connections are automatically blocked in the server's firewall, which can be direct iptables or Advanced Policy Firewall (APF). (We highly recommend that you use APF on your server in general, but deflate will work without it.) Notable Features It is possible to whitelist IP addresses, via /usr/local/ddos/ignore.ip.list. Simple configuration file: /usr/local/ddos/ddos.conf IP addresses are automatically unblocked after a preconfigured time limit (default: 600 seconds) The script can run at a chosen frequency via the

Install and configure APF and (D)DOS-Deflate

A supported website has recently been under a distributed vulnerability scanning that has similarities to a DOS attack. Countermeasures had been taken and that leaded to this post, "A detailed tutorial on how to install and configure APF (Advanced Policy Firewall) and (D)DOS-Deflate" APF What is APF (Advanced Policy Firewall)? Advanced Policy Firewall (APF) is an iptables(netfilter) based firewall system designed around the essential needs of today’s Linux servers. The configuration is designed to be very informative and easy to follow. The management on a day-to-day basis is conducted from the command line with the ‘apf’ command, which includes detailed usage information on all the features. Requirements: - Root SSH access to your server Install Login to your server through SSH and su to the root user.   cd /root/downloads or another temporary folder where you store your files.   wget  http://www.rfxnetworks.com/downloads/apf-current.tar.gz   tar -xvzf apf-cur

Xem So Bai Viet Cua Blogspot