LinuxHelps.com

A blog for Linux Lovers.

Archive for the 'Linux Administration' Category


How to Reset a Linux Box root password.

Sunday, June 28th, 2009
Linux Administration | 1 Comment »

If the linux box protected with root password only.
Do a hard reboot on the machine and click on ‘e’ button to edit the boot like when you get the grub menu. Scrol down to the line which starts with kernel and hit ‘e’ again to edit and add ‘single’ (with out quotes) at the [...]

Changing time zone linux

Sunday, May 24th, 2009
Linux Administration | No Comments »

Change Time Zone
1. Logged in as root, check which timezone your machine is currently using by executing `date`. You’ll see something like Mon 17 Jan 2005 12:15:08 PM PST, PST in this case is the current timezone.
2.Change to the directory /usr/share/zoneinfo here you will find a list of time zone regions. Choose the most appropriate [...]

Disable SELinux for only Apache / httpd in Linux

Sunday, May 24th, 2009
Linux Administration | No Comments »

You can disable Apache SELinux protection easily. Please keep in mind that by disabling SELinux for apache you are inviting more security related problems.
Disable Apache SELinux Protection
Open /etc/selinux/targeted/booleans file using a text editor:
# vi /etc/selinux/targeted/booleans
Append or modify value for httpd_disable_trans as follows:
httpd_disable_trans=1
Save and close the file.
Type the following two commands:
# setsebool httpd_disable_trans 1
# /etc/init.d/httpd [...]

Difference between ‘mount’ and ‘mount -a’

Sunday, May 24th, 2009
Linux Administration | No Comments »

There is a slight difference between the commands - “mount” and “mount -a”.
1. When you type “mount”, it will display the output of the file “/etc/mtab“.
For example,
# mount
/dev/sda5 on / type ext3 (rw,usrquota)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 [...]

Core Dump files..

Sunday, May 24th, 2009
Linux Administration | No Comments »

A core file is created when a program terminates unexpectedly, due to a bug, or a violation of the operating system’s or hardware’s protection mechanisms. The operating system kills the program and creates a core file that programmers can use to figure out what went wrong. It contains a detailed description of the state that [...]

Error : Maximum file limit has been reached

Sunday, May 24th, 2009
Linux Administration | No Comments »

Many times we get an error called the maximum number of files that can be opened has reach the limit,
In order to resolve this, you will have to login as a root on your server and edit the file called /etc/sysctl.conf
vi /etc/sysctl.conf
Add the line there as
fs.file-max = 22992
Save and exit from the file.
In order to [...]

Rebuilding Rpmdb

Tuesday, March 10th, 2009
Linux Administration | No Comments »

Getting the following error while running up2date
rpmdb: Program version 4.2 doesn’t match environment version
error: db4 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index using db3 - Invalid argument (22)
error: cannot open Packages database in /var/lib/rpm
Steps to resolve
1. Check for processes holding the rpm database open (usually in MUTEX/FUTEX states):
lsof | grep /var/lib/rpm
If it finds [...]

Wild card DNS

Tuesday, March 10th, 2009
Linux Administration | No Comments »

Edit the httpd.conf and go to the users entry.
EG:
ServerAlias domainname *.domainname.com
Change to:
ServerAlias domainname.com *.domainname.com
Edit the DNS Zone for the domain in question and add the following.
* CNAME domain.com.
Edit the /var/name/domain.com.db zone file and add the following:

* IN A x.x.x.x
Where you replace the ‘x.x.x.x’ with the correct IP. (wildcard DNS can also be a CNAME record [...]

Screen Command

Tuesday, March 10th, 2009
Linux Administration | No Comments »

Using screen command we can run multiple full-screen pseudo-terminals from one real terminal, and letting you manipulate and save your screen input and output, copy and paste between windows, etc.
1)Create a screen using the command
#screen -S sibu
2)Close the shell without logout
3)Open a new shell
4)Type screen -ls
[root@cochin1 ~]# screen -ls
There are screens on:
16921.123sn [...]

Crontab Entries

Tuesday, March 10th, 2009
Linux Administration | No Comments »

Crontab is used to schedule commands to be executed periodically.
Cron is a daemon process, which means it runs continuously in the background, waiting to run a specified operation at predefined times.
Cron Files
/etc/crontab
/etc/cron.d
/var/spool/cron<username>
/etc/cron.*
/etc/cron.daily, cron.hourly, cron.monthly, cron.weekly.
This files contain scripts that are run daily, hourly, weekly or monthly respectively, place scripts there be executed inregular [...]