The following article describes various ways to block IPs using the built-in RedHat firewall, iptables. The following command will drop all incoming connections from IP xx.xx.xx.xx:
iptables -I INPUT -s xx.xx.xx.xx -j DROP
To block a range, such as xx.xx.xx.* specify the CIDR block as follows:
iptables -I INPUT -s xx.xx.xx.0/24 -j DROP
If you wanted to later remove this entry you would replace...
It's important to keep your server software up-to-date. The commands below will enable automatic nightly updates using CentOS 5's default yum package manager.
yum -y install yum-cron crontabs vixie-cron
service cron start
chkconfig --level 2345 yum-cron on
service yum-cron start
If you have any questions, feel free to leave a reply below and I will be more then happy to answer any questions you may ha...
The instructions below will walk you through the process of installing the X window system, GNOME desktop environment, and configuring VNC so that you can access it remotely.
yum -y upgrade
yum -y groupinstall "GNOME Desktop Environment"
yum -y install vnc-server
As a general rule of thumb, you should never run X windows as root. In this example, we will add a system user with the username 'wkst' and configure X windo...
To set your current shell to a different language you use the bash variable LANG followed by the language you want:
If you want to set that so its used every time add an export line to your .bashrc for that user. The .bashrc file can be found in each user's homedir, if they don't have one you can create it:
The command locale will show you informa...
To set the timezone in Linux, update /etc/localtime with the appropriate timezone file from /usr/share/zoneinfo.
rm -f /etc/localtime
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
This would set your time zone to PST/PDT (Pacific Time) because that is the time zone Los Angles is located in....
Change the hostname line in /etc/sysconfig/network to the hostname you want (this file may be different on FreeBSd and others).
Your hostname should be something prefixing a domain you own (this is referred to as a fully qualified domain name, FQDN), so server1.yourdomain.com for example, not just yourdomain.com.
Changing it in that file ensure that your hostname gets set each time networking starts, however you'...
If you are receiving the error /usr/bin/crontab permissions are wrong. Please set to 4755 when in the cron section of cPanel, the commands below may correct the error for Redhat/CentOS/Fedora servers.
Log into the server via SSH or the console as root and run:
yum -y install vixie-cron crontabs
chmod 4755 /usr/bin/crontab
That's it. See how easy it is to fix permission errors in your crontab. Feel free to leave me a re...
Sometimes it can be useful to extract the contents of an RPM file without actually installing it. In order to do so, use the following command:
rpm2cpio file.rpm | cpio -idmv
Please Note: This will extract the rpm into whatever directory you are in, including all of it's sub-directories. So for example, if you change directory into / and run the command above the rpm will be extracted and files/directories placed just...
Iotop is a Python program with a top like UI used to show on behalf of which process is the I/O going on. This can come in handy for administrators trying to track down a specific process that may be causing a disk I/O bottleneck.
Pre-RequisitesIOTop uses features that are a part of a newer kernel build than what CentOS ships with, so you must upgrade your kernel to at least 2.6.20. The process of doing so is outside ...
dd is a very handy shell command for writing raw data blocks from one place to another. Since it can read directly from raw device files, it is very useful for copying entire partitions or drives from one location to another. One traditional way to get this drive data from one location to another is to pipe DD's output stream over SSH to a shell on a remote machine which in turn uses dd to pipe it to a given output file/device. This i...
Secure cPanel Introduction
This guide is intended to give some basic steps to Secure cPanel after the initial installation. Please see our Initial Setup Guide if you have not already completed it.
Tweak cPanel SettingsUnder Main » Server Configuration » Tweak Settings, enable (E) or disable (D) the following options:
Prevent users from parking/adding on common internet domains. (E)
Attempt to prevent pop3 connection floo...
Please Note: It is wise to uninstall packages from third-party sources or those that were manually installed via a .deb to prevent possible conflicts and related issues.
To begin, edit /etc/apt/sources.list and change all occurrences of lenny to squeeze. A quick vi macro if you use it would be %s/lenny/squeeze/g. Once finished, you file should look similar to the one below.
# main repo
What is NSlookup?
NSlookup is a utility that allows users to verify that a given domain name (or domain record) is resolving properly locally on their PC. It is also useful to check DNS caching, to ensure that after a DNS changeover that the PC is seeing the new IP address entry.
To access nslookup on a Windows workstation, perform one of the following:
Windows 7 or Vista: From the Start menu, in the search...
Introduction to Apache Virtual Hosts
One great benefit of VPS hosting is being able to easily host multiple websites off the same server. Owning a VPS offers much more than just web hosting but in this tutorial we will show you how to setup virtual hosts with Apache.
Apache HTTP Server is probably one of the most influential pieces of open-source software that let to the explosive growth of the World Wide Web today. Still going stro...
What is cron?
Cron the name of a program that enables unix users to execute commands or scripts (groups of commands) automatically at a specified time/date. It is normally used for sys admin commands, like makewhatis, which builds a search database for the man -k command, or for running a backup script, but can also be used for just about anything.
A common use for it today is for your email program to connect to the internet and ...
Are you using Apache as a web server? Of course you are. In fact, most of the world also uses it. It's one of the most popular web servers on the planet. It's very flexibly and allows you to add lots of modules to customize it to your needs.
Sometimes you need to upgrade one of those modules due to new features, bugs in the older versions, performance issues and so on. The repository's you've chosen for y...