Home » Linux Basics (page 3)

Linux Basics

Install EPEL Repo on a CentOS and RHEL 7

How do I install the extra repositories such as Fedora EPEL repo on a Red Hat Enterprise Linux server version 7.x or CentOS Linux server version 7.x? You can easily install various packages by configuring a CentOS 7 or RHEL 7 system to use Fedora EPEL repos and third party packages. Please note that these packages are not officially supported …

Read More »

Linux: Finding and locating files with find command part # 2

In the first part we talked about find command basic usage. Now let us see how to use find command (a) To gain lots of useful information about users and their files (b) Monitor and enhance the security of system using find command Finding all set user id files setuid (“suid”) and setgid are access right flags that can be assigned to …

Read More »

How to Change & Set the Default crontab Editor

  Most hardcore command line users and unix geeks love vi, but I prefer nano. If you want to change your default crontab editor to nano, here’s how to do this:   For a one time edit, launch the terminal and type: EDITOR=nano crontab -e If you want to set nano as your default editor in general, you use this command: export EDITOR=/usr/bin/nano …

Read More »

Linux / Unix: Sed Substitute Multiple Patterns [ Find & Replace ]

I’m using the date +’%D_%T’ to store Unix system date and time in a shell variable called $_now: _now=”$(date +’%D_%T’)” echo $_now Outputs: 01/20/12_16:10:42 I’d like to replace / and : with _. I’m aware of the following sed command: sed ‘s/\//_/g > s/:/_/g’ <<<“$_now” Outputs: 01_20_12_16_14_09 How do I specify two pattern within the same sed command to replace | and : with …

Read More »

How To Install APF Firewall on Cpanel

Advanced Policy Firewall, or APF, is basically an interface to iptables, which is the standard interface to managing network ports on Linux machines. Interacting with iptables can be complex and error-prone, and APF greatly simplifies working with it. However, APF is still only accessible by ssh. There is no way to make changes in APF through WHM or cPanel. All of the APF configuration files are located in the /etc/apf folder …

Read More »

CentOS Linux install and configure NTP to synchronize the system clock

Q. How do I install and configure NTP under CentOS Linux 5 server to synchronize the system clock? A. You can easily install NTP (Network Time Protocol, a means of transmitting time signals over a computer network) using yum command under Redhat or CentOS/Fedora core Linux. Procedure Login as the root user Type the following command to install ntp # …

Read More »

cPanel: Apache + PHP FastCGI Data Timeout Error

If you are run on cPanel server and have FastCGI enabled in Apache, you might facing following error which caused your website hang or prompting ’500 Internal Server Error’ message. When checking into/etc/httpd/log/error_log, you will see something similar as below: [warn] .. mod_fcgid: read data timeout in 40 seconds, ... [error] .. Premature end of script headers: index.php ... This …

Read More »