Posts Tagged ‘LINUX’

Jun
05
2010

Beginner: Why there are many Linux Distributions?

There are different variants of Linux in the market like RedHat, Debian, CentOS, Ubuntu, Mandrake, Suse and a Linux beginner often ponder why they call Linux distributions by various names. The kernel or the heart of all the distributions is Linux and in bringing it to different market usage different community or vendors have adopted the kernel to serve that purpose.
(more…)

  • Share/Save/Bookmark
Mar
18
2010

Linux: Password creation

To create a password file and to add users to it, use the command
$ htpasswd -cm /secured/.mypass username1

To add users to the already existing password file, use the command
$ htpasswd -m /secured/.mypass username2

When additional users are added to the password file, ensure that you don’t use the “-c” option.

Read Password protect directories here

  • Share/Save/Bookmark
Mar
16
2010

Linux: alias, unalias

Alias command comes handy when we are in need to make long and frequently used command string short.

To list the current set of aliases simply type
$ alias

To display the set alias for a specified alias name, type
$ alias alias-shortstring
Example:
$ alias ls

To set an alias you use the format
$ alias shortstring = “linux command string”
(more…)

  • Share/Save/Bookmark
Mar
07
2010

Apache: Where to put site configuration settings?

/etc/apache2/conf.d/ and /etc/apache2/sites-enabled are the two locations from where configuration settings are ready by apache

Apache configuration file has two lines (listed below) in /etc/apache2/apache2.conf which does that

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

  • Share/Save/Bookmark
Mar
05
2010

Ubuntu: Configuring Virtual Hosts to listen on different ports

Files to check
- /etc/apache2/ports.conf
- /etc/apache2/apache2.conf

Consider the ServerName to be “myserver”. Check /etc/hosts for an entry

127.0.0.1 localhost
192.168.1.100 myserver.com myserver

(more…)

  • Share/Save/Bookmark
Dec
27
2009

Linux: Determining IP information for eth0… failed

When setting up a workstation to connect to internet, you may come across a message
Determining IP information for eth0… failed

The above error message basically means that eth0 i.e your network interface card is not setup correctly.

Some of the commands that can come handy in troubleshooting where the error lies are listed below

$ dmesg | grep eth0
(displays information about the ethernet controller card, mac address etc.)

$ cat /etc/sysconfig/network(displays the network settings)
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.122.1

$ cat /etc/sysconfig/network-scripts/ifcfp-eth0

$ ifconfig eth0 down (to down the nic)
$ ifconfig eth0 up (to start the nic)
$ netstat -rn (display kernel routing IP table)
$ cat ifcfg-eth0 (eth0 configuration settings)
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:16:18:33:B3:CF
ONBOOT=yes

$ service network restart (restart the network settings)

$ ping -c4 google.ca(to check if the internet connection works)

$ traceroute google.ca (to check how the IP navigation path is set)

Refer Red Hat linux 5 configure network article for additional info

  • Share/Save/Bookmark
Sep
29
2009

How to reset the screen terminal output?

You might have come across instances like trying to print or output the content of binary files or similar instances when the screen spews out unreadable set of characters which then would disrupt the normal display of characters.

stty” is the command that is used to reset your screen content.

$ stty sane

  • Share/Save/Bookmark
Aug
29
2009

Linux: which vs. whereis command difference

Difference between which command and whereis command in Linux

For e.g. lets find where “samba” is located in a CentOS server

$ which samba
which command searches the list of programs listed down through the PATH settings

$ whereis samba
whereis command also searches for programs that are not present in the PATH setting

  • Share/Save/Bookmark
Aug
14
2009

Ubuntu: Change menu order in GRUB loader

GRUB stands for GRand Unified Bootloader. This is to enable the listing of multiple operating systems so the users could choose the OS of their choice.

To change the menu order we need to edit a file called menu.lst

# vi /boot/grub/menu.lst

Look for a line “default 0“. This is the option to indicate that the first menu on the list should be loaded by default. In order for you to set the default menu content in the GRUB loader that needs to get started you can set this parameter.

This is of the form “default <ID>” where ID = N -1. If there are 4 list items in the menu and if you want to load the 4th item by default, you need to set this configuration setting to “default 3″.

Another option for you is to have the menu list with the entry “savedefault = true“. This would enable the last used menu entry to get loaded during the next boot.

  • Share/Save/Bookmark
Jul
26
2009

Linux: How to change the default Run Level?

To list the current run level
$ who -r
run-level 5 2008-07-22 21:35 last=5

To change the default Run level edit /etc/inittab

You can also switch to another run level number by issuing
$ init

For example,
$ init 3

Now the system switches from Run level 5 to Run level 3

To list the current run level
$ who -r
run-level 3 2008-07-22 22:35 last=5

In the above result notice the last part which states “last=5″. This indicates that the last run level was 5

When the system is running and if we want to apply patches or alter certain configurations, the above command comes in handy.

The other option to change the current level is
$ telinit <run level number>

  • Share/Save/Bookmark