<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Psgprakash&#039;s Blog</title>
	<atom:link href="http://psgprakash.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://psgprakash.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 06 Sep 2010 16:14:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='psgprakash.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Psgprakash&#039;s Blog</title>
		<link>http://psgprakash.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://psgprakash.wordpress.com/osd.xml" title="Psgprakash&#039;s Blog" />
	<atom:link rel='hub' href='http://psgprakash.wordpress.com/?pushpress=hub'/>
		<item>
		<title>LVM-Questions</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/lvm-questions/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/lvm-questions/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 13:29:20 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=281</guid>
		<description><![CDATA[Reducing the filesystem Is it possible to reduce a filesystem/partition without unmounting it? If is not under LVM , you can use parted tool to reduce when you run lvextend to resize the lvm parition after that you need to run ext2online to tell kenel that i have extended the logical volume Facing problem with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=281&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Reducing the filesystem</strong></p>
<p>Is it possible to reduce a filesystem/partition without unmounting it?</p>
<p>If is not under LVM , you can use parted tool to reduce</p>
<p>when you run lvextend to resize the lvm parition after that you need to run<br />
ext2online to tell kenel that i have extended the logical volume</p>
<p>Facing problem with LVM</p>
<p>Hi,</p>
<p>I am new to LVM, server i am using with kernel, kernel-2.4.21-15.EL.</p>
<p>The partitions are as follows:</p>
<p>[root@server]# fdisk -l<br />
Warning: invalid flag 0&#215;0000 of partition table 5 will be corrected by<br />
w(rite)<br />
Disk /dev/hda: 61.4 GB, 61492838400 bytes<br />
255 heads, 63 sectors/track, 7476 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Device Boot Start End Blocks Id System<br />
/dev/hda1 * 1 13 104391 83 Linux<br />
/dev/hda2 14 650 5116702+ 83 Linux<br />
/dev/hda3 651 1287 5116702+ 83 Linux<br />
/dev/hda4 1288 7476 49713142+ f Win95 Ext&#8217;d (LBA)</p>
<p>I created the &#8216;LV&#8217; using total PE.<br />
Next i removed the LV with &#8216;lvremove&#8217; command.<br />
Also i removed the VG .<br />
Now when i am trying to create a new VG, the output is coming as follows:</p>
<p>[root@sever]# vgcreate newvg /dev/hda4<br />
&gt; &gt; vgcreate &#8212; more than 20% [90624 KB] of physical volume /dev/hda4 with<br />
&gt; &gt; 1 KB woul<br />
&gt; &gt; d be used<br />
&gt; &gt;<br />
&gt; &gt; Trying to check with &#8216;pvdisplay&#8217;/'vgdisplay&#8217;, the result is as<br />
&gt; &gt; follows:<br />
&gt; &gt;<br />
&gt; &gt; [root@server]# pvdisplay /dev/hda4<br />
&gt; &gt; pvdisplay &#8212; &#8220;/dev/hda4&#8243; is a new physical volume of 1 KB<br />
&gt; &gt;<br />
&gt; &gt; [root@server]# vgdisplay newvg<br />
&gt; &gt; vgdisplay &#8212; volume group &#8220;newvg&#8221; not found<br />
&gt; &gt;<br />
&gt; &gt; It will be appreciated , if I get some hints to debug this situation.<br />
&gt; &gt;<br />
&gt; &gt; Thanks in advance.<br />
&gt; &gt; Tinni</p>
<p>1.are you using multipathing?<br />
2. check your lvm backup file<br />
/etc/lvm/backup and find out which UUID using which disk.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;Original Message&#8212;&#8212;&#8212;&#8212;&#8212;<br />
From: zairah<br />
Sent: Thursday, July 16, 2009 4:30 AM<br />
Subject: Found duplicate PV L86ifzxiweN errors</p>
<p>&gt; Hi<br />
&gt;<br />
&gt; I encounter the following erros on my machine which is on Redhat Enterprise 4.<br />
&gt;<br />
&gt; [root@zmy02spc01 dev]# pvdisplay<br />
&gt; Found duplicate PV L86ifzxiweN1ZAOcX2PGQ4Bq6PrlEFjz: using /dev/sda8 not /dev/sda3<br />
&gt; Found duplicate PV L86ifzxiweN1ZAOcX2PGQ4Bq6PrlEFjz: using /dev/sda3 not /dev/sda8<br />
&gt; Found duplicate PV L86ifzxiweN1ZAOcX2PGQ4Bq6PrlEFjz: using /dev/sda8 not /dev/sda3<br />
&gt; &#8212; NEW Physical volume &#8212;<br />
&gt; PV Name /dev/sda8<br />
&gt; VG Name<br />
&gt; PV Size 93.00 GB<br />
&gt; Allocatable NO<br />
&gt; PE Size (KByte) 0<br />
&gt; Total PE 0<br />
&gt; Free PE 0<br />
&gt; Allocated PE 0<br />
&gt; PV UUID L86ifz-xiwe-N1ZA-OcX2-PGQ4-Bq6P-rlEFjz<br />
&gt;<br />
&gt;<br />
&gt; How do rectify this?</p>
<p>if you using maltipathing,<br />
than you will get disk to the following path<br />
/dev/mapper/mpath0<br />
/dev/mapper/mpath1<br />
mpath0 is the first LUN following 1,2,3 and so on</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;Original Message&#8212;&#8212;&#8212;&#8212;&#8212;<br />
From: cdelgadop<br />
Sent: Wednesday, December 27, 2006 9:35 AM<br />
Subject: Adding new SAN LUNs to Redhat without rebooting &#8230;.</p>
<p>&gt; Hi<br />
&gt;<br />
&gt; I&#8217;m working in the configuration of some SAN LUNs assigned to one Partition of IBM pSeries p5 server running Redhat 4.<br />
&gt;<br />
&gt; SAN admins have done the zoning and now we want to configure the new disks. My question is: is it necessary to reboot the server? In AIX we can just run cfgmgr command as well as in HPUX ioscan command. Is there any equivalence in Linux ??<br />
&gt;<br />
&gt; Thanks in advanced</p>
<p>use this command<br />
pvs -a -o devices<br />
vgs -a -o devices<br />
lvs -a -o devices</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;Original Message&#8212;&#8212;&#8212;&#8212;&#8212;<br />
From: Andy Aunan<br />
Sent: Friday, April 02, 2010 9:33 AM<br />
Subject: adding a new lun too a current lun of vg01</p>
<p>&gt; i know i need to fdisk but after the fdisk using LVM can i do a single vgextend to add it to the current volum group?<br />
&gt;<br />
&gt; then my lvextend and finally ext2online<br />
&gt;<br />
&gt; now if this was HPUX i know how it works but with linux and fdisk not sure, looking for professional advice</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/281/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=281&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/lvm-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>Search tools</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/search-tools/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/search-tools/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:32:26 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=45</guid>
		<description><![CDATA[cd /hsphere/shared/apache/conf/sites w grep iranpolitics * vi 12077861.conf<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=45&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>cd /hsphere/shared/apache/conf/sites<br />
w<br />
grep iranpolitics *<br />
vi 12077861.conf</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=45&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/search-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>General</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/general/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/general/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:30:31 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=22</guid>
		<description><![CDATA[http://wiki.xensource.com/xenwiki/XenNetworking 1. What are the reasons if DNS reports connection time-out on port 80? 2. What is sendmail port, path, permission and log path? 3. Domain awstats configuration file path and what are the methods to update Awstats. 4. How to update webalizer. 5. Mysql data directory path? 6. Mysql Configuration file location? 7. How [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=22&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://wiki.xensource.com/xenwiki/XenNetworking</p>
<p>1. What are the reasons if DNS reports connection time-out on port 80?</p>
<p>2. What is sendmail port, path, permission and log path?</p>
<p>3. Domain awstats configuration file path and what are the methods to update Awstats.</p>
<p>4. How to update webalizer.</p>
<p>5. Mysql data directory path?</p>
<p>6. Mysql Configuration file location?</p>
<p>7. How to grant a user for a database (through shell and panel)?</p>
<p>8. What are the reasons httpd service down and how to prevent the error and start the service?</p>
<p>9. How to allow an IP in firewall (with details)</p>
<p>10. Apache main configuration file path and users sites configuration file path?</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>hsphere=# select * from dns_zones where name = &#8216;autocompany.com.py&#8217;;</p>
<p>hsphere=# select * from dns_records where name = &#8216;autocompany.com.py&#8217;;</p>
<p>hsphere=# select * from domains where name = &#8216;autocompany.com.py&#8217;;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p># delete the line 18 from &#8216;~/.ssh/known_hosts&#8217; file<br />
sed -i &#8217;18 d&#8217; ~/.ssh/known_hosts<br />
# also<br />
sed -i 18d ~/.ssh/known_hosts<br />
# delete few lines<br />
# delete 6 lines from line 8<br />
sed -i 8,+6d file.txt<br />
# delete the line where is &#8216;TO DELETE&#8217;<br />
sed -i &#8216;/TO DELETE/ d&#8217; file.txt</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Aol &#8212;&gt; http://postmaster.info.aol.com/whitelist/whitelist_guides.html<br />
Hotmail &#8212;&gt; https://support.msn.com/eform.aspx?productKey=edfsmsbl&amp;ct=eformts<br />
Spamcop &#8212;&gt; http://www.spamcop.net/bl.shtml/<br />
Psbl &#8212;&gt; http://psbl.surriel.com/remove<br />
For more information about blacklisting refer the below link.</p>
<p>http://www.streamsend.com/kb/idx/51/138/Common_Questions_and_Answers/article/Ive_been_blacklisted_ISP_Listings.html</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>grep elmadagmeyhanesi.com /hsphere/local/var/httpd/logs/access_log.1260835200 &gt; /hsphere/local/home/elmadag/logs/elmadagmeyhanesi.com/accesslog.december</p>
<p>/usr/bin/perl /hsphere/local/home/elmadag/elmadagmeyhanesi.com/cgi-bin/awstats.pl -config=elmadagmeyhanesi.com -LogFile=/hsphere/local/home/elmadag/logs/elmadagmeyhanesi.com/accesslog.december</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Wisner space full</p>
<p>[root@malta j]# du -sh * | grep G<br />
1.1G    aglconstruction.com<br />
1.5G    cordaodeouro.org<br />
1.1G    dps.com.co<br />
1.2G    kaizenholidays.co.in<br />
1.1G    mitra.ph<br />
1.6G    poorvika.com<br />
1.2G    treasuredimagesflorida.com</p>
<p>UPDATE mail_services SET mail_server=251 WHERE id=(SELECT child_id FROM parent_child WHERE child_type=1000 AND parent_id=(SELECT id FROM domains WHERE name=&#8217;poorvika.com&#8217;));</p>
<p>SELECT r.id, r.name, r.type, r.data, r.ttl, r.pref FROM domains d, parent_child p1, parent_child p2, dns_records r WHERE d.name=&#8217;poorvika.com&#8217; AND d.id = p1.parent_id AND p1.child_type=1000 AND p1.child_id = p2.parent_id AND p2.child_id = r.id AND (p2.child_type=1007 OR p2.child_type=3006);</p>
<p>UPDATE dns_records SET data=&#8217;mandrake.worldispnetwork.com&#8217; WHERE id in ();</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=22&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/general/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>Disk space and quota Problems</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/disk-space-and-quota-problems/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/disk-space-and-quota-problems/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:29:35 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[Disk space and quota Problems]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=36</guid>
		<description><![CDATA[Clear var partition #  df -h #  cd /var/ #  ll #  du spool/ #  du -sh spool/ #  du -sh log/ #  cd log/ #  ll #  du -sh * &#124; grep G #  du -sh * &#124; grep M #  rm -rf cron.1 cron.2 cron.3 cron.4 maillog.1 maillog.2 maillog.3 messages.1 messages.2 messages.3 secure.1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=36&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Clear var partition</p>
<p>#  df -h<br />
#  cd /var/<br />
#  ll<br />
#  du spool/<br />
#  du -sh spool/<br />
#  du -sh log/<br />
#  cd log/<br />
#  ll<br />
#  du -sh * | grep G<br />
#  du -sh * | grep M<br />
#  rm -rf cron.1 cron.2 cron.3 cron.4 maillog.1 maillog.2 maillog.3 messages.1 messages.2 messages.3 secure.1 secure.2<br />
#  echo &gt; maillog<br />
#  echo &gt; messages<br />
#  cd clamd/<br />
#  ll<br />
#  du -sh *<br />
#  cd ..<br />
#  df -h<br />
#  du -sh<br />
#  cd ..<br />
#  ll<br />
#  du -sh account/<br />
#  du -sh *<br />
#  df -h<br />
#  cd hsphere/<br />
#  ll<br />
#  du -sh *<br />
#  df -h<br />
#  cd local/<br />
#  ll<br />
#  cd var/<br />
#  ll<br />
#  du -sh *</p>
<p>RE:[redhat-l] Want to know available space from server and give the report on email</p>
<p>#!/bin/bash<br />
cat /dev/null &gt; /home/sysadmin/systemreport.txt</p>
<p>date &gt;&gt; /home/sysadmin/systemreport.txt</p>
<p>echo &#8220;=======================DAILY CHECKLIST========================================&#8221; &gt;&gt; /home/sysadmin/systemreport.txt</p>
<p>echo &#8220;==============================================================================&#8221; &gt;&gt; /home/sysadmin/systemreport.txt<br />
echo &#8221; ************************ File System Details ******************** &#8221; &gt;&gt; /home/sysadmin/systemreport.txt<br />
echo &#8220;==============================================================================&#8221; &gt;&gt; /home/sysadmin/systemreport.txt</p>
<p>df -h &gt;&gt; /home/sysadmin/systemreport.txt</p>
<p>echo &#8220;==============================================================================&#8221; &gt;&gt; /home/sysadmin/systemreport.txt<br />
echo &#8221; ******************* CPU Utilisation Report ********************* &#8221; &gt;&gt; /home/sysadmin/systemreport.txt<br />
echo &#8220;==============================================================================&#8221; &gt;&gt; /home/sysadmin/systemreport.txt</p>
<p>iostat 2 2 &gt;&gt; /home/sysadmin/systemreport.txt</p>
<p>echo &#8220;==============================================================================&#8221; &gt;&gt; /home/sysadmin/systemreport.txt<br />
echo &#8221; *********************** Memory Usages **************************&#8221; &gt;&gt; /home/sysadmin/systemreport.txt<br />
echo &#8220;==============================================================================&#8221; &gt;&gt; /home/sysadmin/systemreport.txt<br />
SUBJECT=&#8221;System Report `hostname`&#8221;<br />
TO=&#8221; email@removed &#8220;<br />
MESSAGE=&#8221;/home/sysadmin/systemreport.txt&#8221;<br />
mutt -s &#8220;$SUBJECT&#8221; &#8220;$TO&#8221; -a $MESSAGE &lt; /dev/null</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;Original Message&#8212;&#8212;&#8212;&#8212;&#8212;<br />
From: Defry<br />
Sent: Friday, August 20, 2010 2:50 AM<br />
Subject: Want to know available space from server and give the report on email</p>
<p>&gt; Dear,<br />
&gt;<br />
&gt; I&#8217;m using red hat 4.<br />
&gt; I want to know available space from my server and give the report on my mail.<br />
&gt;<br />
&gt; Example<br />
&gt; Size : 68G<br />
&gt; Used : 60G<br />
&gt; Available : 8G<br />
&gt; Use% : 85%<br />
&gt;<br />
&gt; I want that information send to my mail automatically.<br />
&gt; Please help me.<br />
&gt;<br />
&gt; Thanks for support<br />
&gt;<br />
&gt; Regards,<br />
&gt; Defry</p>
<p>__.____._</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=36&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/disk-space-and-quota-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>Username</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/username/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/username/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:29:07 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[User group files folders and permission]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=42</guid>
		<description><![CDATA[[root@warblers ~]# grep softbyon /etc/passwd [root@warblers ~]# useradd softbyon [root@warblers ~]# passwd softbyon Changing password for user softbyon. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@warblers ~]# grep softbyon /etc/passwd softbyon:x:26140:26140::/home/softbyon:/bin/bash You have new mail in /var/spool/mail/root [root@warblers ~]#<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=42&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>[root@warblers ~]# grep softbyon /etc/passwd<br />
[root@warblers ~]# useradd softbyon<br />
[root@warblers ~]# passwd softbyon<br />
Changing password for user softbyon.<br />
New UNIX password:<br />
BAD PASSWORD: it is based on a dictionary word<br />
Retype new UNIX password:<br />
passwd: all authentication tokens updated successfully.<br />
[root@warblers ~]# grep softbyon /etc/passwd<br />
softbyon:x:26140:26140::/home/softbyon:/bin/bash<br />
You have new mail in /var/spool/mail/root<br />
[root@warblers ~]#</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=42&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/username/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>Crons</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/crons/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/crons/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:28:38 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[Crons]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=47</guid>
		<description><![CDATA[Do I need to change permissions on the php script? wget -q -O /dev/null http://macsata.com/weather.php /usr/bin/fetch -q -o /dev/null /hsphere/local/home2/bmacsata/macsata.com/weather.php To run the php script try with the php binary, the path for php in the server is /usr/bin/php try this. /usr/bin/php -q<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=47&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="/Intel/Logs/SGP/SGP/Referal/Reference/cron.txt">Do I need to change permissions on the php script?</a></p>
<p><a href="/Intel/Logs/SGP/SGP/Referal/Reference/cron.txt">wget -q -O /dev/null http://macsata.com/weather.php<br />
/usr/bin/fetch -q -o /dev/null /hsphere/local/home2/bmacsata/macsata.com/weather.php</a></p>
<p><a href="/Intel/Logs/SGP/SGP/Referal/Reference/cron.txt">To run the php script try with the php binary, the path for php in the server is /usr/bin/php</a></p>
<p><a href="/Intel/Logs/SGP/SGP/Referal/Reference/cron.txt">try this.</a></p>
<p><a href="/Intel/Logs/SGP/SGP/Referal/Reference/cron.txt">/usr/bin/php -q<br />
</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=47&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/crons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>Website down</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/website-down/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/website-down/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:28:24 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Webhosting-H-Sphere]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=50</guid>
		<description><![CDATA[Web Server Error Messages Errors on the Internet, and those annoying error messages, occur quite frequently &#8212; and can be quite frustrating, especially if you do not know the difference between a 404 error and a 502 error. Many times they have more to do with the Web servers you&#8217;re trying to access rather than [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=50&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em><strong>Web Server Error Messages</strong></em></p>
<p>Errors on the Internet, and those annoying error messages, occur quite frequently &#8212; and can be quite frustrating, especially if you do not know the difference between a 404 error and a 502 error. Many times</p>
<p>they have more to do with the Web servers you&#8217;re trying to access rather than something being wrong with your computer. Here is a list of error messages you might encounter while surfing the Web and their</p>
<p>respective meanings to help you figure out just what the problem is.</p>
<p><strong>400 Bad File Request : </strong>Usually means the syntax used in the URL is incorrect (e.g., uppercase letter should be lowercase letter; wrong punctuation marks).</p>
<p><strong>401 Unauthorized : </strong>Server is looking for some encryption key from the client and is not getting it. Also, wrong password may have been entered. Try it again, paying close attention to case sensitivity.</p>
<p><strong>403 Forbidden/Access Denied:</strong> Similar to 401; special permission needed to access the site &#8212; a password and/or username if it is a registration issue. Other times you may not have the proper permissions set</p>
<p>up on the server or the site&#8217;s administrator just doesn&#8217;t want you to be able to access the site.</p>
<p><strong>404 File Not Found :</strong> Server cannot find the file you requested. File has either been moved or deleted, or you entered the wrong URL or document name. Look at the URL. If a word looks misspelled, then</p>
<p>correct it and try it again. If that doesn&#8217;t work backtrack by deleting information between each backslash, until you come to a page on that site that isn&#8217;t a 404. From there you may be able to find the page</p>
<p>you&#8217;re looking for.</p>
<p><strong>408 Request Timeout : </strong>Client stopped the request before the server finished retrieving it. A user will either hit the stop button, close the browser, or click on a link before the page loads. Usually occurs when</p>
<p>servers are slow or file sizes are large.</p>
<p><strong>500 Internal Error :</strong> Couldn&#8217;t retrieve the HTML document because of server-configuration problems. Contact site administrator.</p>
<p><strong>501 Not Implemented : </strong>Web server doesn&#8217;t support a requested feature.</p>
<p><strong>502 Service Temporarily Overloaded : </strong>Server congestion; too many connections; high traffic. Keep trying until the page loads.</p>
<p><strong>503 Service Unavailable : </strong>Server busy, site may have moved ,or you lost your dial-up Internet connection.</p>
<p><strong>Connection Refused by Host :</strong> Either you do not have permission to access the site or your password is incorrect.</p>
<p><strong>File Contains No Data :</strong> Page is there but is not showing anything. Error occurs in the document. Attributed to bad table formatting, or stripped header information.</p>
<p><strong>Bad File Request : </strong>Browser may not support the form or other coding you&#8217;re trying to access.</p>
<p><strong>Failed DNS Lookup : </strong>The Domain Name Server can&#8217;t translate your domain request into a valid Internet address. Server may be busy or down, or incorrect URL was entered.</p>
<p><strong>Host Unavailable :</strong> Host server down. Hit reload or go to the site later.</p>
<p><strong>Unable to Locate Host :</strong> Host server is down, Internet connection is lost, or URL typed incorrectly.</p>
<p><strong>Network Connection Refused by the Server : </strong>The Web server is busy.</p>
<p><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --><span style="font-size:small;"><strong>HTTP error codes explained</strong></span></p>
<p>There are multiple HTTP codes that you may come across. Below you can find a summary of the most popular HTTP error codes:</p>
<p><strong>&#8220;200 OK&#8221;</strong> &#8211; You will not see this code when browsing a regular page. It means that the requested document has been processed and sent to you.</p>
<p><strong>&#8220;301 Moved Permanently&#8221;</strong> &#8211; Often web designers create the so-called 301 redirects. This means that instead of the file you are browsing to, the server will point you to a different directory or a file set in the redirect rules.</p>
<p><strong>&#8220;400 Bad Request&#8221;</strong> &#8211; The Web server considers the data stream sent by the client (your Web browser) &#8216;malformed&#8217; i.e. it has not sent a complete HTTP request. In such cases the web server is unable to process the request. Almost always this error is caused by bad programming.</p>
<p><strong>&#8220;401 Unauthorized&#8221;</strong> &#8211; You are most probably trying to access a password protected directory using wrong credentials. In such cases you should check whether you are using the correct login details. If you wish to have your credentials reset, you can do this using the &#8220;<em>Password Protect Directories</em>&#8221; tool in your cPanel.<br />
<strong><br />
</strong><strong>&#8220;403 Forbidden&#8221;</strong> &#8211; This error message means that you are trying to open a folder or a file you do not have access to. If you are receiving this error message on your website, you should check the<em> .htaccess</em> files in your web hosting account for any restrictive rules.</p>
<p><strong>&#8220;404 Not Found&#8221;</strong> &#8211; You are browsing to a non-existent page or a folder. In such cases you should check if the link you are trying to access is correct. In addition, if any SEF functionality on your pages is not working correctly, your application may forward you to the wrong URL.</p>
<p><strong>&#8220;500 Internal Server Error&#8221;</strong> &#8211; The most common reasons for this error are bad script code, an invalid .htaccess file, wrong file/folder permissions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=50&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/website-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux tips and tricks</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/linux-tips-and-tricks/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/linux-tips-and-tricks/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:27:58 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=56</guid>
		<description><![CDATA[Linux how to determine the file system type All files accessible in a Linux system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices and they can be remote or local file system. Linux supports numerous file system types. For example it supports [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=56&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Linux how to determine the file system type</h1>
<p><a rel="nofollow" href="http://www.cyberciti.biz/faq/linux-how-to-determine-find-out-file-system-type/#comments"></a></p>
<p>All files accessible in a Linux system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices and they can be remote or local file system. Linux supports numerous file system types. For example it supports Ext2,. Ext3, NFS, FA16, FAT32, NTFS,Sysfs, Procfs etc. To determine the file system type or to find out what type of file systems currently mounted you need to use command called mount or df. Type df command as follows:<br />
<code>$ df -T</code>Output:</p>
<pre>Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/hdb1     ext3    19228276  14737848   3513680  81% /
tmpfs        tmpfs      383960         4    383956   1% /dev/shm</pre>
<p>df command report filesystem disk space usage and if you pass -T option it will report filesystem type. As you see second command displays file system type (ext3). Type, mount command as follows at shell prompt:<br />
<code>$ mount</code>Output:</p>
<pre>/dev/hdb1 on / type ext3 (rw,errors=remount-ro)
/dev/hdb2 on /home type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
automount(pid3558) on /data type autofs (rw,fd=4,pgrp=3558,minproto=2,maxproto=4)</pre>
<p>As you can see, second last column displays the file system type. For example first line [/dev/hdb1 on / type ext3 (rw,errors=remount-ro)] can be interpreted as follows:</p>
<ul>
<li>/dev/hdb1 : Partition</li>
<li>/ : File system</li>
<li>ext3 : File system type</li>
<li>(rw,errors=remount-ro) : Mount options</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=56&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/linux-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>pgsql Queries</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/pgsql-queries/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/pgsql-queries/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:27:30 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[PGSQL]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=40</guid>
		<description><![CDATA[Query to find database select * from mysqldb where db_name=&#8217;n5n77_vb&#8217;; Restoring reseller Admin account Reseller has accidentaly deleted his Admin account 1. Log into the system Postgres. 2. Run the following queries: SELECT id FROM users WHERE username=&#8217;&#60;UnfortunateReseller&#62;&#8217;; SELECT admin_id FROM resellers WHERE id=&#60;id&#62;; DELETE FROM users WHERE id=&#60;admin_id&#62;; UPDATE resellers SET admin_id=0 WHERE id=&#60;id&#62;; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=40&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Query to find database</strong></p>
<p>select * from mysqldb where db_name=&#8217;n5n77_vb&#8217;;</p>
<p><strong>Restoring reseller Admin account</strong></p>
<p>Reseller has accidentaly deleted his Admin account</p>
<p>1. Log into the system Postgres.<br />
2. Run the following queries:</p>
<p>SELECT id FROM users WHERE username=&#8217;&lt;UnfortunateReseller&gt;&#8217;;<br />
SELECT admin_id FROM resellers WHERE id=&lt;id&gt;;<br />
DELETE FROM users WHERE id=&lt;admin_id&gt;;<br />
UPDATE resellers SET admin_id=0 WHERE id=&lt;id&gt;;<br />
UPDATE signup_guard SET flags=0 WHERE reseller_id=&lt;id&gt;;</p>
<p>3. Restart control panel</p>
<p><strong>To remove IP from database</strong></p>
<p>hsphere=# select * from l_server_ips where ip= &#8217;67.217.51.49&#8242;;<br />
l_server_id |      ip      |   ip_num   |     mask      | flag |   r_id   | r_type<br />
&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8211;<br />
209 | 67.217.51.49 | 1138307889 | 255.255.255.0 |    1 | 25705309 |      8<br />
(1 row)</p>
<p>hsphere=# select * from parent_child where child_id = 25705309;<br />
parent_id | parent_type | child_id | child_type | account_id | p_begin | suspended<br />
&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211;<br />
(0 rows)</p>
<p>hsphere=# DELETE FROM  l_server_ips where ip= &#8217;67.217.51.49&#8242;;</p>
<p><span style="font-size:small;">update dns_records SET data=&#8217;67.217.55.137&#8242; where id=&#8217;16573385&#8242;;</span><br />
<span style="font-size:small;">select * from dns_records where name=&#8217;cp.egbwebhosting.com&#8217;;</span></p>
<p>hsphere=# select * from dns_records where name=&#8217;cp.egbwebhosting.com&#8217;;<br />
id    |         name         | type |     data      |  ttl  | pref<br />
&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;-+&#8212;&#8212;<br />
16573385 | cp.egbwebhosting.com | A    | 67.217.55.137 | 86400 |<br />
(1 row)</p>
<p><span style="font-size:small;"><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=40&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/pgsql-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Hardening &amp; Security</title>
		<link>http://psgprakash.wordpress.com/2010/09/06/linux-hardening-security/</link>
		<comments>http://psgprakash.wordpress.com/2010/09/06/linux-hardening-security/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 10:27:05 +0000</pubDate>
		<dc:creator>psgprakash</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://psgprakash.wordpress.com/?p=67</guid>
		<description><![CDATA[Linux Hardening &#38; Security Content: 1) Intruduction 2) cP/WHM Installation and cP/WHM Configuration 3) The server and it&#8217;s services &#124; PHP Installation, Optimization &#38; Security 4) Kernel Hardening &#124; Linux Kernel + Grsecurity Patch 5) SSH 6) Firewall &#124; DDoS Protection 7) Mod_Security Anti-Virus &#8211; ClamAV 9) Rootkit 10) The Rest of Shits =================== &#124; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=67&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Linux Hardening &amp; Security</strong></p>
<p>Content:</p>
<p>1) Intruduction<br />
2) cP/WHM Installation and cP/WHM Configuration<br />
3) The server and it&#8217;s services | PHP Installation, Optimization &amp; Security<br />
4) Kernel Hardening | Linux Kernel + Grsecurity Patch<br />
5) SSH<br />
6) Firewall | DDoS Protection<br />
7) Mod_Security<br />
 <img src='http://s2.wp.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Anti-Virus &#8211; ClamAV<br />
9) Rootkit<br />
10) The Rest of Shits</p>
<p>===================<br />
| 1) Intruduction |<br />
===================</p>
<p>I wrote a step by step paper how to secure linux server with cP/WHM and<br />
Apache installed. By default, linux is not secured enough but you have<br />
to understand there is no such thing as &#8220;totally secured server/system&#8221;.<br />
The purpose of this paper is to understand how to at least provide some<br />
kind of security to the server. I prefer lsws web-server without any<br />
Control Panel at all but for this paper I have used CentOS 5 with cP/WHM<br />
and Apache web-server installed since a lot of hosting compaines and<br />
individuals are using it.</p>
<p>Let&#8217;s start <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, you bought the server with CentOS 5 installed. If you ordered cP/WHM together with the server you can skip 2.1 step</p>
<p>============================================<br />
| 2) cP/WHM installation and configuration |<br />
============================================<br />
2.1) cP/WHM Installation<br />
To begin your installation, use the following commands into SSH:<br />
root@server [~]# cd /home<br />
root@server [/home]# wget http://layer1.cpanel.net/latest<br />
root@server [/home]# ./latest</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
cd /home &#8211; Opens /home directory<br />
wget http://layer1.cpanel.net/latest &#8211; Fetches the latest installation file from the cPanel servers.<br />
./latest &#8211; Opens and runs the installation files.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>cP/WHM should be installed now. You should be able to access cP via<br />
http://serverip:2082(SSL-2083) or http://serverip/cpanel and WHM via<br />
http://serverip:2086(SSL-2087) or http://serverip/whm. Let&#8217;s configure<br />
it now.</p>
<p>2.2) cP/WHM Configuration<br />
Login to WHM using root username/passwd<br />
http://serverip:2086 or http://serverip/whm</p>
<p>WHM &#8211; Server setup &#8211; Tweak Security:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Enable open_basedir protection<br />
Disable Compilers for all accounts(except root)<br />
Enable Shell Bomb/memory Protection<br />
Enable cPHulk Brute Force Protection</p>
<p>WHM &#8211; Account Functions:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Disable cPanel Demo Mode<br />
Disable shell access for all accounts(except root)</p>
<p>WHM &#8211; Service Configuration &#8211; FTP Configuration:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Disable anonymous FTP access</p>
<p>WHM &#8211; MySQL:<br />
&#8212;&#8212;&#8212;&#8212;-<br />
Set some MySQL password(Don&#8217;t set the same password like for the root access)<br />
-If you don&#8217;t set MySQL password and if someone upload shell(E.G c99) on<br />
some site on server he will be able to login into  the DB with username<br />
&#8220;root&#8221; without password and delete/edit/download any db on that server</p>
<p>WHM &#8211; Service Configuration &#8211; Apache Configuration &#8211; PHP and SuExec Configuration<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Enable suEXEC &#8211; suEXEC = On<br />
When PHP runs as an Apache Module it executes as the user/group of the<br />
webserver which is usually &#8220;nobody&#8221; or &#8220;apache&#8221;. suEXEC changes this so<br />
scripts are run as a CGI. Than means scripts are executed as the user<br />
that created them. With suEXEC script permissions can&#8217;t be set to<br />
777(read/write/execute at user/group/world level)</p>
<p>===============================================================================<br />
| 3) The server and it&#8217;s services | PHP Installation, Optimization &amp; Security |<br />
===============================================================================</p>
<p>3.1) Keep all services and scripts up to date and be sure that you running the latest secured version.<br />
On CentOS type this into SSH to upgrade/update services on the server.<br />
[root@server ~]# yum upgrade<br />
or<br />
[root@server ~]# yum update</p>
<p>3.2) PHP Installation/Update, configuration and optimization + Suhosin patch<br />
First download what you need, type into SSH the following:<br />
root@server [~]# cd /root<br />
root@server [~]# wget http://www.php.net/get/php-5.2.9.tar.bz2/from/this/mirror<br />
root@server [~]# wget http://download.suhosin.org/suhosin-patch-5.2.8-0.9.6.3.patch.gz<br />
root@server [~]# wget http://download.suhosin.org/suhosin-0.9.27.tgz</p>
<p>Untar PHP<br />
root@server [~]# tar xvjf php-5.2.9.tar.bz2</p>
<p>Patch the source<br />
root@server [~]# gunzip &lt; suhosin-patch-5.2.8-0.9.6.3.patch.gz | patch -p0</p>
<p>Configure the source. If you want to use the same config as you used for<br />
the last php build it&#8217;s not a problem but you will have to add<br />
enable-suhosin to old config. To get an old config type this into SSH:<br />
root@server [~]# php -i | grep ./configure</p>
<p>root@server [~]# cd php-5.2.9<br />
root@server [~/php-5.2.9]# ./configure &#8211;enable-suhosin + old config(add old config you got from &#8220;php -i | grep ./configure&#8221; here)<br />
root@server [~/php-5.2.9]# make<br />
root@server [~/php-5.2.9]# make install</p>
<p>Note: If you get an error like make: command not found or patch: Command<br />
not found, you will have to install &#8220;make&#8221; and &#8220;patch&#8221;. It can be done<br />
easly. Just type this into SSH:<br />
root@server [~]# yum install make<br />
root@server [~]# yum install patch</p>
<p>Now check is everything as you want. Upload php script like this on the server:<br />
&lt;?php<br />
phpinfo();<br />
?&gt;<br />
And open it via your browser and you will see your PHP configuration there</p>
<p>3.3) Suhosin<br />
Now we can install suhosin patch to get better security and performance.<br />
root@server [~]# tar zxvf suhosin-0.9.27.tgz<br />
root@server [~]# cd suhosin-0.9.27<br />
root@server [~/suhosin-0.9.27]# phpize<br />
root@server [~/suhosin-0.9.27]# ./configure<br />
root@server [~/suhosin-0.9.27]# make<br />
root@server [~/suhosin-0.9.27]# make install</p>
<p>After you installed suhosin you will get something like this: It&#8217;s installed to /usr/local/lib/php/extensions/no-debug-non-zts-20060613/</p>
<p>Now edit your php.ini. If you don&#8217;t know where php.ini located it, type this into SSH.<br />
root@server [~]# php -i | grep php.ini<br />
Configuration File (php.ini) Path =&gt; /usr/local/lib<br />
Loaded Configuration File =&gt; /usr/local/lib/php.ini</p>
<p>It means you have to edit /usr/local/lib/php.ini<br />
Type into SHH:<br />
root@server [~]# nano /usr/local/lib/php.ini<br />
If you get an error, nano: Command not found, then:<br />
root@server [~]# yum install nano</p>
<p>Find &#8220;extension_dir =&#8221; and add:<br />
extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20060613/<br />
To save it, CTRL + O and then Enter button.</p>
<p>3.4)<br />
We will install Zend Optimizer to get better perfomance:<br />
Download Zend Optimizer from http://www.zend.com/store/products/zend-optimizer.php<br />
root@server [~]# tar -zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz<br />
root@server [~]# cd ZendOptimizer-3.3.3-linux-glibc23-i386<br />
root@server [~/ZendOptimizer-3.3.3-linux-glibc23-i386]# ./install.sh<br />
Welcome to Zend Optimizer installation&#8230;.. &#8211; Press Enter button<br />
Zend licence agreement&#8230;                   &#8211; Press Enter button<br />
Do you accept the terms of this licence&#8230;  &#8211; Yes, press Enter button<br />
Location of Zend Optimizer&#8230;               &#8211; /usr/local/Zend, press Enter button<br />
Confirm the location of your php.ini file&#8230;- /usr/local/lib, press Enter button<br />
Are you using Apache web-server..           &#8211; Yes, press Enter button<br />
Specify the full path to the Apache control utility(apachectl)&#8230;-/usr/local/apache/bin/apachectl, press Enter button<br />
The installation has completed seccessfully&#8230;- Press Enter button</p>
<p>Now restart apache, type this into SSH:<br />
root@server [~]# service httpd restart</p>
<p>3.5) php.ini &amp; disabled functions<br />
Edit php.ini like this:<br />
root@server [~]# nano /usr/local/lib/php.ini<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
safe_mode = On<br />
expose_php = Off<br />
Enable_dl= Off<br />
magic_quotes = On<br />
register_globals = off<br />
display errors = off<br />
disable_functions = system, show_source, symlink, exec, dl,<br />
shell_exec, passthru, phpinfo, escapeshellarg,escapeshellcmd<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>root@server [~]# service httpd restart</p>
<p>Or you can edit php.ini via WHM:<br />
WHM &#8211; Service Configuration &#8211; PHP Configuration Editor</p>
<p>=========================================================<br />
| 4) Kernel Hardening | Linux Kernel + Grsecurity Patch |<br />
=========================================================</p>
<p>Description : grsecurity is an innovative approach to security utilizing<br />
a multi-layered detection, prevention, and containment model. It is<br />
licensed under the GPL. It offers among many other features:<br />
-An intelligent and robust Role-Based Access Control (RBAC) system that can generate least privilege policies for your<br />
entire system with no configuration<br />
-Change root (chroot) hardening<br />
-/tmp race prevention<br />
-Extensive auditing<br />
-Prevention of arbitrary code execution, regardless of the technique used (stack smashing, heap corruption, etc)<br />
-Prevention of arbitrary code execution in the kernel<br />
-Randomization of the stack, library, and heap bases<br />
-Kernel stack base randomization<br />
-Protection against exploitable null-pointer dereference bugs in the kernel<br />
-Reduction of the risk of sensitive information being leaked by arbitrary-read kernel bugs<br />
-A restriction that allows a user to only view his/her processes<br />
-Security alerts and audits that contain the IP address of the person causing the alert</p>
<p>Downloading and patching kernel with grsecurity<br />
root@server [~]# cd /root<br />
root@server [~]# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.5.tar.gz<br />
root@server [~]# wget http://www.grsecurity.com/test/grsecurity-2.1.12-2.6.26.5-200809141715.patch<br />
root@server [~]# tar xzvf linux-2.6.26.5.tar.gz<br />
root@server [~]# patch -p0 &lt; grsecurity-2.1.12-2.6.26.5-200809141715.patch<br />
root@server [~]# mv linux-2.6.26.5 linux-2.6.26.5-grsec<br />
root@server [~]# ln -s linux-2.6.26.5-grsec/ linux<br />
root@server [~/linux]# cd linux<br />
root@server [~/linux]# cp /boot/config-`uname -r` .config<br />
root@server [~/linux]# make oldconfig</p>
<p>Compile the Kernel:<br />
root@server [~/linux]# make bzImage<br />
root@server [~/linux]# make modules<br />
root@server [~/linux]# make modules_install<br />
root@server [~/linux]# make install</p>
<p>Check your grub loader config, and make sure default is 0<br />
root@server [~/linux]# nano /boot/grub/grub.conf</p>
<p>Reboot the server<br />
root@server [~/linux]# reboot</p>
<p>==========<br />
| 5) SSH |<br />
==========</p>
<p>In order to change SSH port and protocol you will have to edit sshd_config<br />
root@server [~]# nano /etc/ssh/sshd_config</p>
<p>Change Protocol 2,1 to Protocol 2<br />
Change #Port 22 to some other port and uncomment it<br />
Like, Port 1337</p>
<p>There is a lot of script kiddiez with brute forcers and they will try to crack our ssh pass because they know username is root, port is 22<br />
But we were smarter, we have changed SSH port <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Also, their &#8220;brute forcing&#8221; can increase server load, it means our sites(hosted on that server) will be slower</p>
<p>SSH Legal Message<br />
edit /etc/motd, write in motd something like this:<br />
&#8220;ALERT! That is a secured area. Your IP is logged. Administrator has been notified&#8221;</p>
<p>When someone login into SSH he will see that message:<br />
ALERT! That is a secured area. Your IP is logged. Administrator has been notified</p>
<p>If you want to recieve an email every time when someone logins into SSH as root, edit .bash_profile(It&#8217;s located in /root directory) and put this at the end of file:<br />
echo &#8216;ALERT &#8211; Root Shell Access on:&#8217; `date` `who` | mail -s &#8220;Alert: Root Access from `who | awk &#8216;{print $6}&#8217;`&#8221; mail@something.com</p>
<p>And at the end restart SSH, type &#8220;service sshd restart&#8221; into SSH</p>
<p>=================================<br />
| 6) Firewall | DDoS Protection |<br />
=================================</p>
<p>6.1) Firewall, CSF Installation<br />
root@server [~]# wget http://www.configserver.com/free/csf.tgz<br />
root@server [~]# tar -xzf csf.tgz<br />
root@server [~]# cd csf</p>
<p>In order to install csf your server needs to have some ipt modules<br />
enabled. csftest is a perl script and it comes with csf. You can check<br />
those mudules with it.<br />
root@server [~/csf]# ./csftest.pl<br />
The output should be like this:</p>
<p>root@server [~/csf]# ./csftest.pl<br />
Testing ip_tables/iptable_filter&#8230;OK<br />
Testing ipt_LOG&#8230;OK<br />
Testing ipt_multiport/xt_multiport&#8230;OK<br />
Testing ipt_REJECT&#8230;OK<br />
Testing ipt_state/xt_state&#8230;OK<br />
Testing ipt_limit/xt_limit&#8230;OK<br />
Testing ipt_recent&#8230;OK<br />
Testing ipt_owner&#8230;OK<br />
Testing iptable_nat/ipt_REDIRECT&#8230;OK</p>
<p>No worries if you have no all those mudules enabled, csf will work is<br />
you didn&#8217;t get any FATAL errors at the end of the output.</p>
<p>Now, get to installation<br />
root@server [~/csf]# ./install.sh</p>
<p>You will have to edit conf.csf file. It&#8217;s located here:<br />
/etc/csf/csf.conf</p>
<p>You need to edit it like this:<br />
Testing = &#8220;0&#8243;</p>
<p>And have to configure open ports in conf.csf or you won&#8217;t be able to<br />
access these ports. In most cases it should be configured like this if<br />
you are using cP/WHM. If you are running something on some other port<br />
you will have to enable it here. If you changed SSH port you will have<br />
to enable a new port here:<br />
# Allow incoming TCP ports<br />
TCP_IN = &#8220;20,21,22,25,53,80,110,143,443,465,587,993,995,2077,2078,2082,2083,2086,2087,2095,2096&#8243;<br />
# Allow outgoing TCP ports<br />
TCP_OUT = &#8220;20,21,22,25,37,43,53,80,110,113,443,587,873,2087,2089,2703&#8243;</p>
<p>6.2) CSF Connection Limit<br />
There is in csf.conf CT option, configure it like this<br />
CT_LIMIT = &#8220;200&#8243;<br />
It means every IP with more than 200 connections is going to be blocked.<br />
CT_PERMANENT = &#8220;1&#8243;<br />
IP will blocked permanent<br />
CT_BLOCK_TIME = &#8220;1800&#8243;<br />
IP will be blocked 1800 secs(1800 secs = 30 mins)<br />
CT_INTERVAL = &#8220;60&#8243;<br />
Set this to the the number of seconds between connection tracking scans.</p>
<p>After conf.csf editing you need to restart csf<br />
root@server [~# service csf restart</p>
<p>6.3) SYN Cookies<br />
Edit the /etc/sysctl.conf file and add the following line in order to enable SYN cookies protection:<br />
-----------------------------------<br />
# Enable TCP SYN Cookie Protection<br />
net.ipv4.tcp_syncookies = 1<br />
-----------------------------------</p>
<p>root@server [~/]# service network restart</p>
<p>6.4) CSF as security testing tool<br />
CSF has an option &#8220;Server Security Check&#8221;. Go to WHM &#8211; Plugins &#8211; CSF -<br />
Test Server Security. You will see additional steps how to secure the<br />
server even more. I&#8217;m writing only about most important things here and<br />
I covered most of them in the paper but if you want you can follow steps<br />
provided by CSF to get the server even more secured.</p>
<p>6.5) Mod_Evasive<br />
ModEvasive module for apache offers protection against DDoS (denial of service attacks) on your server.</p>
<p>To install it login into SSH and type</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
root@server [~]# cd /root/<br />
root@server [~]# wget http://www.zdziarski.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz<br />
root@server [~]# tar zxf mode_evasive-1.10.1.tar.gz<br />
root@server [~]# cd mod_evasive</p>
<p>then type&#8230;<br />
root@server [~/mod_evasive]# /usr/sbin/apxs -cia mod_evasive20.c<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>When mod_evasive is installed, place the following lines in your httpd.conf (/etc/httpd/conf/httpd.conf)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&lt;IfModule mod_evasive20.c&gt;<br />
DOSHashTableSize 3097<br />
DOSPageCount 2<br />
DOSSiteCount 50<br />
DOSPageInterval 1<br />
DOSSiteInterval 1<br />
DOSBlockingPeriod 10<br />
&lt;/IfModule&gt;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>6.6) Random things:<br />
csf -d IP &#8211; Block an IP with CSF<br />
csf -dr IP &#8211; Unblock an IP with CSF<br />
csf -s &#8211; Start firewall rules<br />
csf -f &#8211; Flush/stop firewall rules<br />
csf -r &#8211; Restart firewall rules<br />
csf -x &#8211; Disable CSF<br />
csf -e &#8211; Enable CSF<br />
csf -c &#8211; Check for updates<br />
csf -h &#8211; Show help screen</p>
<p>-Block an IP via iptables<br />
iptables -A INPUT -s 208.131.183.169 -j DROP</p>
<p>-Unblock an IP via iptables<br />
iptables -I INPUT -s IP -j ACCEPT</p>
<p>-See how many IP addresses are connected to the server and how many connections has each of them.<br />
netstat -ntu | awk &#8216;{print $5}&#8217; | cut -d: -f1 | sort | uniq -c | sort -n</p>
<p>===================<br />
| 7) Mod_Security |<br />
===================</p>
<p>Mod_Security is a web application firewall and he can help us to secure our sites against RFI, LFI, XSS, SQL Injection etc</p>
<p>If you use cP/WHM you can easly enable Mod_security in WHM &#8211; Plugins &#8211; Enable Mod_Security and save</p>
<p>Now I will explain how to install Mod_security from source.<br />
You can&#8217;t install Mod_Security if you don&#8217;t have libxml2 and http-devel libraries.<br />
Also, you need to enable mod_unique_id in apache modules, but don&#8217;t worry, I will explain how to do it <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Login into SSH and type&#8230;</p>
<p>root@server [~]# yum install libxml2 libxml2-devel httpd-devel</p>
<p>libxml2 libxml2-devel httpd-devel should be installed now</p>
<p>then you need to edit httpd.conf file, you can find it here:<br />
root@server [~]# nano /etc/httpd/conf/httpd.conf</p>
<p>You need to add this in your httpd.conf file<br />
LoadModule unique_id_module modules/mod_unique_id.so</p>
<p>Now download the latest version of mod_security for apache2 from http://www.modsecurity.org</p>
<p>login into SSH and type&#8230;</p>
<p>root@server [~]# cd /root/<br />
root@server [~]# wget http://www.modsecurity.org/download/modsecurity-apache_2.5.6.tar.gz<br />
root@server [~]# tar zxf modsecurity-apache_2.5.6.tar.gz<br />
root@server [~]# cd modsecurity-apache_2.5.6<br />
root@server [~/modsecurity-apache_2.5.6]# cd apache2</p>
<p>then type:<br />
root@server [~/modsecurity-apache_2.5.6/apache2]#  ./configure<br />
root@server [~/modsecurity-apache_2.5.6/apache2]# make<br />
root@server [~/modsecurity-apache_2.5.6/apache2]# make install</p>
<p>Go at the end of httpd.conf and place an include for our config/rules file&#8230;<br />
Include /etc/httpd/conf/modsecurity.conf</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
# /etc/httpd/conf/httpd.conf</p>
<p>LoadModule unique_id_module modules/mod_unique_id.so<br />
LoadFile /usr/lib/libxml2.so<br />
LoadModule security2_module modules/mod_security2.so<br />
Include /etc/httpd/conf/modsecurity.conf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>You need to find good rules for Mod_Security. You can find them at<br />
official Mod_Security site. Also, give a try to gotroot.com rules. When<br />
you find a good rules, just put them in /etc/httpd/conf/modsecurity.conf</p>
<p>And restart httpd at the end, type &#8220;service httpd restart&#8221; into SSH</p>
<p>==========================<br />
| <img src='http://s2.wp.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Anti-Virus &#8211; ClamAV |<br />
==========================</p>
<p>You need AV protection to protect the server against worms and trojans<br />
invading your mailbox and files! Just install clamav (a free open source<br />
antivirus software for linux). More information can be found on clamav<br />
website &#8211; http://www.clamav.net</p>
<p>In order to install CLamAV login into SSH and type</p>
<p>root@server [~]# yum install clamav</p>
<p>Once you have installed clamav for your CentOS, here are some basic commands you will need:</p>
<p>Update the antivirus database<br />
root@server [~]# freshclam</p>
<p>Run antivirus<br />
root@server [~]# clamscan -r /home</p>
<p>Running as Cron Daily Job<br />
To run antivirus as a cron job (automatically scan daily) just run<br />
crontab -e from your command line. Then add the following line and save<br />
the file.<br />
@daily root clamscan -R /home</p>
<p>It means clamav will be scanning /home directory every day. You can change the folder to whatever you want to scan.</p>
<p>==============<br />
| 9) Rootkit |<br />
==============</p>
<p>Rootkit scanner is scanning tool to ensure you for about 99.9%* you&#8217;re clean of nasty tools.<br />
This tool scans for rootkits, backdoors and local exploits by running tests like:<br />
-MD5 hash compare<br />
-Look for default files used by rootkits<br />
-Wrong file permissions for binaries<br />
-Look for suspected strings in LKM and KLD modules<br />
-Look for hidden files<br />
-Optional scan within plaintext and binary files</p>
<p>Instalation:</p>
<p>Login into SSH and type</p>
<p>root@server [~]# cd /root/<br />
root@server [~]# wget http://downloads.rootkit.nl/rkhunter-1.2.7.tar.gz<br />
root@server [~]# tar -zxvf rkhunter-1.2.7.tar.gz<br />
root@server [~]# cd rkhunter-1.2.7<br />
root@server [~rkhunter-1.2.7]# ./installer.sh</p>
<p>Scan the server with rkhunter<br />
root@server [~]# rkhunter -c</p>
<p>=========================<br />
| 10) The Rest of Shits |<br />
=========================</p>
<p>10.1) Random suggestions</p>
<p>If you use bind DNS server then we need to edit named.conf file<br />
named.conf is located here: /etc/named.conf</p>
<p>and add<br />
recursion no; under Options<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Options{<br />
recursion no;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Now restart bind, type into SSH<br />
root@server [~]# service named restart</p>
<p>This will prevent lookups from dnstools.com and similar services and reduce server load</p>
<p>In order to prevent IP spoofing, you need to edit host.conf file like this:<br />
This file is located here: /etc/host.conf<br />
Add that in host.conf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
order bind,hosts<br />
nospoof on<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Hide the Apache version number:</p>
<p>edit httpd.conf (/etc/httpd/conf/httpd.conf)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
ServerSignature Off<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Disable telnet:</p>
<p>Edit file: /etc/xinetd.d/telnet<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
disable = yes<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>10.2) Passwords<br />
Don&#8217;t use the same password you are using for the server on some other places.<br />
When the Datacenter contacts you via e-mail or phone, always request<br />
more informations. Remember, someone alse could contact you to get some<br />
information or even root passwords.</p>
<p>10.3) Random thoughts<br />
No matter what you need to secure the server, don&#8217;t think you are safe<br />
only because you are not personally involved in any shits with<br />
&#8220;hackers&#8221;. When you are hosting hacking/warez related sites you are the<br />
target. There is no such thing as totally secured server. Most important<br />
things are backups, make sure you will always have an &#8220;up-to-date&#8221;<br />
offsite backups ^^</p>
<p>Anyhow, this is the end of my paper, I hope it will help you to get some<br />
kind of security to your server.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/psgprakash.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/psgprakash.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/psgprakash.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/psgprakash.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/psgprakash.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/psgprakash.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/psgprakash.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/psgprakash.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/psgprakash.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/psgprakash.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/psgprakash.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/psgprakash.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/psgprakash.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/psgprakash.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=psgprakash.wordpress.com&amp;blog=12718948&amp;post=67&amp;subd=psgprakash&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://psgprakash.wordpress.com/2010/09/06/linux-hardening-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c509489de834ad7b2d525467f40ab18?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">psgprakash</media:title>
		</media:content>
	</item>
	</channel>
</rss>
