HostOnNet Blog

Category Archives: Linux

Blocking Layer 7 DDoS with CloudFlare Firewall using Fail2ban

Fail2Ban can be configured to work with CloudFlare Firewall to block Layer 7 DDos (DoS) attacks. On Ubuntu install fail2ban with command Now you can edit and remove most of the [SECTION] from /etc/fail2ban/jail.conf if you are not using them.


No PostgreSQL clusters exist; see “man pg_createcluster”

On Ubuntu VPS starting PostgreSQL, got following error Starting PostgreSQL manually get following error To fix, you need to set locale. Refer Blog Post https://blog.hostonnet.com/ubuntu-14-04-openvz-locale-cannot-set-lc_all-to-default-locale-no-such-file-or-directory Once this is fixed, PostgreSQL started working properly.


iptables Only Allow Traffic from CloudFlare IPs

You can find cloudflare IP range at https://www.cloudflare.com/ips/ To only allow https traffic from CloudFlare IP ranges, run NOTE: This is for HTTPS, for http, replace –dport https with –dport http Save the rule with command On Ubuntu On CentOS


df: ‘/dev/hugepages’: No such file or directory

On a new installation of CloudLinux 7 server, i got following error when running df -h This was caused due to corrupt /etc/mtab file. It is fixed by deleting the file and making it a symlink to /proc/mounts previously /home


Downloading files with wget

Featured Image by eff.org wget is a command line tool available in most linux distributions used to download files. Install wget To install, wget on CentOS/RHEL/Fedora, run On Ubunu/Debian, run Downloading File Using wget To Download a file using wget,


How to find Linux Version

To find kernel version, run To find Linux distro version details, run The actual command depends on what OS Distro you have. On Debian On CloudLinux On Ununtu/Debian/Mint, you can install lsb-release with Then run, lsb-release -da For debian


Install vsftpd in Ubuntu

To install vsftpd in ubuntu, run To configure, edit /etc/vsftpd.conf Enable Linux Users to Login Set value for following settings as below Disable Annonymouse Login Set chroot user Allow user root to login Edit /etc/ftpusers and remove root. Start/Stop vsftpd


Useful Linux Commands to work with Hard Disk Drives

Useful Posts Check health of Adaptec raid Format partition with mkfs Checking hard disk health with smartctl Benchmarking Hard disk with dd Raid 1 vs Single Disk Speed Test Target is busy File Systems – Mounting Mounting WebDAV on Linux


Install TeamSpeak 3 Server on CentOS/Ubuntu

TeamSpeak is popular Voice Chat Program. To install TeamSpeak 3 server, download latest version of TeamSpeak 3 from http://www.teamspeak.com/?page=downloads Create a user on your Linux Server Change to the user Or, you can SSH in as the user you created.


find – Linux Command

Find Inside Files Find a a useful Linux command that can be used to search for files. Search files by file name To find all files in current directory with extension .png, run Find Files larger than X MB To