Shashikant shah

Friday, 25 April 2014

How to Resolve INIT: Id "x" respawning too fast: disabled for 5 minutes


INIT: Id "x" respawning too fast: disabled for 5 minutes

In most distributions this means that the system is booting by default into runlevel 5, which is supposed to respawn (re-start again after it’s been exited) a gui login via x windows, kdm, gdm, or whatever, but the system can’t locate the program. As a result below logs will keep appearing on your /var/log/messages for every 5 minutes.

# vi /etc/inittab
 id:3:initdefault:
 
# reboot server
 
# yum grouplist
# yum groupinstall “X Window System”
# yum groupinstall “GNOME Desktop Environment”
#change runlevel
# vi /etc/inittab
 id:5:initdefault:

You have now have successfully installed GNOME GUI. Restart the server and you will have GUI on your screen.

How to enable grouplist in yum : RHEL-5

How to enable grouplist in yum

You may encounter an error in yum if you type the following command :

[root@shashi ~]# yum grouplist

Error: No group data available for configured repositories.

In order to solve this problem do the following:

 [root@shashi ~]# yum install yum-utils

Copy your entire dvd to any location in your system
and configure yum.

I have copied my entire DVD to the
‘/var/ftp/pub/repo/’ directory.

And I have already configured yum.

In order to enable group list feature execute the following.

[root@shashi ~]# createrepo –g /var/ftp/pub/repo/server/repodata/21f8a36d9
bca1b5b606702c5ce46b65017360348cace161b7910edfaa3cb087
-comps-rhel6-Server.xml     var/ftp/pub/repo/Packages

# The starting filename in the repodata folder can be anything
# but you have to select the one which ends
# with ‘-comps-rhel6-Server.xml’.

Clean all the yum cache

[root@shashi ~]# yum clean all

Make the cache again.

[root@shashi ~]# yum makecache

Check if the grouplist feature is working.

[root@shashi ~]# yum grouplist

Monday, 14 April 2014

How to Check Web Server Connections


Web Server Connections

1.Grep port 80 (web services port) :-
# netstat -alntp | grep :80

2.Check the number of connection from port 80 :-
# netstat -alntp | grep :80 | wc -l
# netstat -t -u -c 
# ps auxw | grep httpd | wc -l

3.List the remote IPs connecting to your web server on port 80 :-
# netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr

4.List the unique remote IPs and the number of connections from each IP.
# netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

Tuesday, 1 April 2014

How To Set A Proxy For The Terminal


                                                   -: Set A Proxy :-


If you set a global proxy in Gnome (I'm not sure about other desktop environments), you'll notice that the terminal ignores it. Here's how to set a proxy for the terminal:

1.For a HTTP proxy, simply run the following command in a terminal:
export http_proxy='http://YOUR_USERNAME:YOUR_PASSWORD@PROXY_IP:PROXY_PORT/'

2.For a secure connection (HTTPS), use:
export https_proxy='http://YOUR_USERNAME:YOUR_PASSWORD@PROXY_IP:PROXY_PORT/'

Example :-

# export http_proxy='http://localhost:8080'
# export https_proxy='http://localhost:8080' 

How to check if the terminal proxy is working :-

# env | grep -i proxy
# curl icanhazip.com

Reset the proxy :-

# unset http_proxy
# unset https_proxy