Linux Server

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)

$ 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)

$ service network restart (restart the network settings)

$ ping -c4 check if the internet connection works)

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

Refer Red Hat linux 5 configure network article for additional info


Virtual World: with VMWare Player

VMWare Player is a free software available from VMWare Inc. enabling the creation
of guest OS within an existing OS

Notes for a beginner …
* VMWare Player and VMWare Server are available for free
* A .vmdk file is the virtual hard drive for the guest OS
* A .nvram file stores the BIOS settings of the virtual machine
* A .vmx file stores the configuration settings for the virtual machine. All you
need is a text editor to edit the VMWare configuration settings.
* A .vmsd file stores information about VMWare snapshots.
Continue Reading…


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


Simple File Sharing Steps with Samba in CentOS for beginners

Samba facilitates file sharing across linux, windows systems for beginners

First create a folder in your Windows system, right click the folder and share the folder for network access. Let say that you have created a folder for share as “xpshare” and that the name of your windows machine is “windowsxp” (right click “My Computer” and select properties. Under the tab “Computer Name” you can note the name of the machine)
Continue Reading…


Premature end of script headers: apache error

Apache errors and the approach to solve it

Premature end of script headers
500 Internal Server Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.

Some troubleshooting tips:

i) Check /var/log/apache2/error.log (in ubuntu, check the respective apache error log location for the messages)

ii) Check if the content type of the page is correctly set for the html content output.

print “Content-type: text/html\n\n”;

iii) Check if a valid permission has been given for the file to get executed. The file need permission 755 for it to be executed on the server.

iv) Check if the configuration path, inclusion path are set correctly in the referenced programs


Permission denied: exec of failed in Apache Server

Apache Permission Denied Error can be caused due to one of many configuration mistakes listed below

Check the apache configuration settings

i) The first is the reference to folder where cgi or perl files will reside and its execute permission settings

 <ScriptAlias /cgi-bin/ /usr/local/cgi-bin/>
 <Directory "/usr/local/cgi-bin">
     AllowOverride None
     Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
     Order allow,deny
     Allow from all

ii) The second is the proper add handlers that are set for the file execution

AddHandler cgi-script .cgi .pl
<Files ~ "\.pl$">
    Options +ExecCGI
<Files ~ "\.cgi$">
   Options +ExecCGI

Check the apache error log for any messages (/var/log/apache2/error.log).


Configuring postfix to send mail via satellite system

Step 1: $ sudo apt-get install postfix

Postfix configuration screen throws you with the following options to choose from
i) No changes (no changes to configuration settings)
ii) Internet site (Mail sent and received using SMTP)
iii) Internet with smarthost (Mail sent to another machine called smarthost)
iV) Satellite system (All mail sent to another machine for delivery)
v) Local only (No network based mail system. Only applied to this local machine)
Continue Reading…


PHP Security: Preventing Session Fixation

Session Fixation is method by which an intruder creates a session id which gets carried on when a user comes with that path and continues his/her activity on a website.

For e.g. an intruder may create a link to a site called as <a href=”” />Sample Site<a>

When a user clicks on this link the session id gets carried on to the site ‘‘. The intruder waits for the user starts to perform a transaction on the site and will take over vital details by intruding user’s activity on
Continue Reading…


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>


Linux: How to find the current Run Level?

Default init level is set in /etc/inittab.

$ cat /etc/inittab (to display the init levels)

Inside that file, you can note a line which will state the run level number like
id:5:initdefault: (indicating run level 5 which means that the system is running with x windows)

To find the current run level you can execute the following commands

$ who -r
run-level 5 2008-07-22 21:35 last=5
which indicates that the system is in run-level 5

Other option to find the run level is
$ /sbin/runlevel
N 5

To find out what sub processes are associated with each run level you can go to
$ cd /etc/rcN.d/ (Where N denotes the run level number)

For example
$ cd /etc/rc1.d/
$ ls -l

This will list symbolic links to various processes associated with run level 1.

Kurinchi Calendar
September 2018
« Oct