<?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/"
	>

<channel>
	<title>Webramz blog</title>
	<atom:link href="http://blog.webramz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.webramz.com</link>
	<description>Technical articles for web hosting servers, php, mysql, javascript</description>
	<lastBuildDate>Sun, 05 Sep 2010 16:13:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SSH using keys</title>
		<link>http://blog.webramz.com/ssh-using-keys/</link>
		<comments>http://blog.webramz.com/ssh-using-keys/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 16:13:28 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Linux | CentOS]]></category>

		<guid isPermaLink="false">http://blog.webramz.com/?p=136</guid>
		<description><![CDATA[By using SSH Keys (a public and private key to be precise), you can easily connect to a server, or multiple servers, without having to enter your password for each system.]]></description>
			<content:encoded><![CDATA[<h3>What are SSH Keys?</h3>
<p>By using SSH Keys (a public and private key to be precise), you can easily connect to a server, or multiple servers, without having to enter your password for each system.</p>
<p>It is possible to setup your keys without a passphrase, however that is unwise as if anyone gets hold of your key they can use it. This guide describes how to setup your system so that passphrases are remembered securely.</p>
<h4>Generating SSH Keys</h4>
<p>The keys can then be generated by running the ssh-keygen command as a user:</p>
<blockquote><p><code># ssh-keygen -t rsa<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/root/.ssh/id_rsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /root/.ssh/id_rsa.<br />
Your public key has been saved in /root/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
45:54:10:01:9d:ef:a3:34:a6:d9:f3:a2:41:e3:87:b7 root@localsquid</code></p></blockquote>
<p>It will prompt you for a location (which you should leave as the default), however the passphrase is the important bit! I hopefully need not tell you the rules of a good passphrase?<br />
Default key length for RSA is 2048 and is sufficient.</p>
<h4>Copying the keys to the remote server</h4>
<p>Now you have generated the keys you need to copy them to the remote server. By default, for OpenSSH, the public key needs to be concatenated into <span style="color: #ff6600;">~/.ssh/authorized_keys</span>.</p>
<blockquote><p><code># scp ~/.ssh/id_rsa.pub root@192.168.1.100:</code></p></blockquote>
<p>This copies the public key (id_rsa.pub) to your remote server via scp (note the : at the end of the server address). The file ends up in the home directory, but you can specify another path if you like.</p>
<p>Next up, on the remote server, you need to create the <span style="color: #ff6600;">~/.ssh</span> directory if it doesn&#8217;t exist and concatenate the key <span style="color: #ff6600;">authorized_keys</span> file:</p>
<blockquote><p><code># ssh root@192.168.1.100<br />
root@192.168.1.100's password:<br />
# mkdir ~/.ssh<br />
# cat ~/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys<br />
# rm ~/id_rsa.pub<br />
# chmod 600 ~/.ssh/authorized_keys</code></p></blockquote>
<p>The last two commands remove the public key from the server (which isn&#8217;t needed now), and sets the correct permissions on the authorized_keys file.</p>
<p>If you now disconnect from the server, and attempt to reconnect, you should be asked for the passphrase of the key (if any):</p>
<blockquote><p><code># ssh root@192.168.1.100<br />
Enter passphrase for key '~/.ssh/id_rsa':</code></p></blockquote>
<p>If you are unable to login with the key, double check the permissions on the authorized_keys file.<br />
Also check the permissions on the ~/.ssh directory, which should have write permissions off for &#8216;group&#8217; and &#8216;other&#8217;. Run the following command to disable &#8216;group&#8217; and &#8216;other&#8217; write permissions for the ~/.ssh directory:</p>
<blockquote><p><code># chmod go-w ~/.ssh</code></p></blockquote>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Fssh-using-keys%2F';
  addthis_title  = 'SSH+using+keys';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/ssh-using-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analyze of Squid&#8217;s access.log</title>
		<link>http://blog.webramz.com/analyze-of-squid-access-log/</link>
		<comments>http://blog.webramz.com/analyze-of-squid-access-log/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 13:34:39 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Squid]]></category>

		<guid isPermaLink="false">http://blog.webramz.com/?p=129</guid>
		<description><![CDATA[The cache result code appears in the fourth column of Squid's native access.log format. It indicates how the request was handled by Squid.

The following codes, beginning with TCP_, are for requests to the HTTP port (3128).]]></description>
			<content:encoded><![CDATA[<h2>Squid cache result</h2>
<p>The cache result code appears in the fourth column of Squid&#8217;s native <em>access.log</em> format. It indicates how the request was handled by Squid.</p>
<p>The following codes, beginning with <strong>TCP_</strong>, are for requests to the HTTP port (3128).</p>
<dl>
<dt><strong>TCP_HIT</strong></dt>
<dd>A valid copy of the requested object is in the cache. Squid does not forward the request.</p>
</dd>
<dt><strong>TCP_MISS</strong></dt>
<dd>The requested object is not in the cache.</p>
</dd>
<dt><strong>TCP_REFRESH_HIT</strong></dt>
<dd>The object is in the cache, but <em>stale</em>. Squid has forwarded an <em>If-Modified-Since</em> request and received a <em>Not Modified</em> response.</p>
</dd>
<dt><strong>TCP_REF_FAIL_HIT</strong></dt>
<dd>The object is in the cache, but <em>stale</em>. Squid has forwarded an <em>If-Modified-Since</em> request but it failed (e.g. connection timeout), so Squid sends the old (stale) object to the client.</p>
</dd>
<dt><strong>TCP_REFRESH_MISS</strong></dt>
<dd>The object is in the cache, but <em>stale</em>. Squid has forwarded an <em>If-Modified-Since</em> request and received a response with the new content.</p>
</dd>
<dt><strong>TCP_CLIENT_REFRESH</strong></dt>
<dd>The client issued a request with the <em>no-cache</em> pragma, so Squid forwards the request.</p>
</dd>
<dt><strong>TCP_IMS_HIT</strong></dt>
<dd>The client issued an <em>If-Modified-Since</em> request and the object is in the cache, and still <em>fresh</em>. Squid does not forward the request.</p>
</dd>
<dt><strong>TCP_IMS_MISS</strong></dt>
<dd>The client issued an <em>If-Modified-Since</em> request for a <em>stale</em> object. Squid forwards the request as a miss.</p>
</dd>
<dt><strong>TCP_SWAPFAIL</strong></dt>
<dd>The object is believed to be in the cache, but could not be accessed, so Squid forwards the request.</p>
</dd>
<dt><strong>TCP_DENIED</strong></dt>
<dd>Access is denied for this request.</p>
</dd>
</dl>
<p>The following codes, beginning with <strong>UDP_</strong>, are for requests to the ICP port (3130).</p>
<dl>
<dt><strong>UDP_HIT</strong></dt>
<dd>A <em>fresh</em> copy of the requested object is in the cache.</p>
</dd>
<dt><strong>UDP_HIT_OBJ</strong></dt>
<dd>Same as UDP_HIT, but the object data is small enough to also be sent in the UDP reply packet.</p>
</dd>
<dt><strong>UDP_MISS</strong></dt>
<dd>The requested object is either <em>stale</em> or not in the cache at all.</p>
</dd>
<dt><strong>UDP_DENIED</strong></dt>
<dd>Access is denied for this request.</p>
</dd>
<dt><strong>UDP_INVALID</strong></dt>
<dd>An invalid request is received.</p>
</dd>
<dt><strong>UDP_MISS_NOFETCH</strong></dt>
<dd>The replying cache recommends that this request NOT be made at this time. Squid uses this reply code when reloading metadata at startup, and when the failure ratio exceeds its threshold.</p>
</dd>
</dl>
<p>There are also numerous error codes, which begin with <strong>ERR_</strong>, for requests to the HTTP port. We will not discuss these codes here.</p>
<h2><a name="ss9.2"></a></h2>
<p>Every HTTP response includes a status code on the first line. This three-digit numeric code also appears in the fourth column of Squid&#8217;s native <em>access.log</em>. Section 6.1.1 of <a href="ftp://ds.internic.net/rfc/rfc2068.txt">the HTTP/1.1 RFC</a>includes a full list of these codes. We are primarily interested in only two of them.</p>
<dl>
<dt><strong>200 OK</strong></dt>
<dd>This, the most common status code, indicates a successful request.</p>
</dd>
<dt><strong>304 Not Modified</strong></dt>
<dd>This means the request included an <em>If-Modified-Since</em> header with a timestamp, and the resource has not been modified since the given time.</p>
</dd>
</dl>
<h2><a name="hierarchy-code"></a><a name="ss9.3"></a></h2>
<p>The ninth column of Squid&#8217;s native <em>access.log</em> is a code that indicates how the next-hop cache was selected.</p>
<dl>
<dt><strong>DIRECT</strong></dt>
<dd>Squid forwards the request directly to the origin server.</p>
</dd>
<dt><strong>FIREWALL_IP_DIRECT</strong></dt>
<dd>Squid forwards the request directly to the origin server because the origin server&#8217;s IP address is inside your firewall.</p>
</dd>
<dt><strong>FIRST_PARENT_MISS</strong></dt>
<dd>Squid forwards the request to the parent cache with the fastest weighted round trip time.</p>
</dd>
<dt><strong>FIRST_UP_PARENT</strong></dt>
<dd>Squid forwards the request to the first available parent in your list.</p>
</dd>
<dt><strong>LOCAL_IP_DIRECT</strong></dt>
<dd>Squid forwards the request directly to the origin server because the origin server&#8217;s IP address matched your <em>local_ip</em> list.</p>
</dd>
<dt><strong>SIBLING_HIT</strong></dt>
<dd>Squid forwards the request to a sibling cache that sent us a UDP_HIT reply.</p>
</dd>
<dt><strong>NO_DIRECT_FAIL</strong></dt>
<dd>Squid cannot forward the request because of firewall restrictions and no parent caches are available.</p>
</dd>
<dt><strong>PARENT_HIT</strong></dt>
<dd>Squid forwards the request to a parent cache that sent us a UDP_HIT reply.</p>
</dd>
<dt><strong>SINGLE_PARENT</strong></dt>
<dd>The request is forwarded to the only parent cache appropriate for this request. Also requires that <em>single_parent_bypass</em> be enabled.</p>
</dd>
<dt><strong>SOURCE_FASTEST</strong></dt>
<dd>Squid forwards the request to the origin server because its <em>source_ping</em> reply arrived first.</p>
</dd>
<dt><strong>PARENT_UDP_HIT_OBJ</strong></dt>
<dd>Squid received the object in a UDP_HIT_OBJ reply from a parent cache.</p>
</dd>
<dt><strong>SIBLING_UDP_HIT_OBJ</strong></dt>
<dd>Squid received the object in a UDP_HIT_OBJ reply from a sibling cache.</p>
</dd>
<dt><strong>DEFAULT_PARENT</strong></dt>
<dd>Squid forwarded the request to a <em>default</em> parent, without sending any ICP queries first.</p>
</dd>
<dt><strong>ROUNDROBIN_PARENT</strong></dt>
<dd>Squid forwarded the request to the <em>round-robin</em> parent with the lowest use count, without sending any ICP queries first.</p>
</dd>
<dt><strong>CLOSEST_PARENT_MISS</strong></dt>
<dd>Squid forwarded the request to the the parent whose ICP_MISS reply has the lowest measured RTT to the origin server. This only appears with <em>query_icmp</em> enabled in the configuration file.</p>
</dd>
<dt><strong>CLOSEST_DIRECT</strong></dt>
<dd>Squid forwarded the request directly to the origin server because Squid measured a lower RTT to the origin than any of its parent caches.</p>
</dd>
<dt><strong>NONE</strong></dt>
<dd>Squid does not forward the request at all.</p>
</dd>
</dl>
<p>Note, when the two second timeout occurs waiting for ICP replies, the word <strong>TIMEOUT_</strong> is prepended to the hierarchy code</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Fanalyze-of-squid-access-log%2F';
  addthis_title  = 'Analyze+of+Squid%26%238217%3Bs+access.log';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/analyze-of-squid-access-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS 5 Xen images &#8211; part 2: installing the Xen guest</title>
		<link>http://blog.webramz.com/centos-5-xen-images-part-2-installing-the-xen-guest/</link>
		<comments>http://blog.webramz.com/centos-5-xen-images-part-2-installing-the-xen-guest/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 05:06:05 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Xen]]></category>
		<category><![CDATA[create xen guest]]></category>
		<category><![CDATA[install xen guest]]></category>
		<category><![CDATA[xen guest]]></category>
		<category><![CDATA[xen guest image]]></category>

		<guid isPermaLink="false">http://blog.webramz.com/?p=119</guid>
		<description><![CDATA[OK, so you downloaded an image from jailtime.org or you made your own image as described in my previous post, and now you want to install a Xen guest using it. Here’s how to do it : Setup the dom0 (host OS) Of course, Xen should be installed on the host OS. I use CentOS 5, so [...]]]></description>
			<content:encoded><![CDATA[<p>OK, so you downloaded an image from <a href="http://jailtime.org/" target="_blank">jailtime.org</a> or you made your own image as described in <a href="http://blog.webramz.com/centos-5-xen-images-%E2%80%93-part-1-creating-a-base-domu-image-with-yum/">my previous post</a>, and now you want to install a Xen guest using it. Here’s how to do it :</p>
<h3>Setup the dom0 (host OS)</h3>
<p>Of course, Xen should be installed on the host OS. I use CentOS 5, so I just selected Xen during the installation. It will install a xen kernel that you should use to boot the host OS (dom0). I won’t go into details here, because that’s really easy to do with CentOS or Redhat Enterprise Linux. With other distributions, you could have to install distribution-specific packages, or use the official Xen package from<a href="http://xen.org/download/" target="_blank">xen.org</a>.</p>
<h3>Setup the target partition or logical volume</h3>
<p>You should create a filesystem for the “root” partition and the swap. You could use simple files, but you will have better performance using real partitions or LVM volumes. LVM volumes also has other advantages, like the ability to create snapshots for backing up data, and easy resizing.</p>
<p>The following commands will create a 5GB root logical volume (LV) and 1GB swap in the /dev/vg0 volume group (VG). For more information about LVM, search for LVM howto in a search engine.</p>
<pre># root
lvcreate -L 5000M -n mailroot /dev/vg0
mkfs.ext3 /dev/vg0/mailroot
# swap
lvcreate -L 1000M -n mailswap /dev/vg0
mkswap /dev/vg0/mailswap</pre>
<p>You can then mount the root partition and copy the base system (either an image from jailtime or an image you made yourself) on it.</p>
<pre>mkdir /mnt/mailroot
mount /dev/vg0/mailroot /mnt/mailroot
# if you image contents is located in /centos...
cp -R /centos/* /mnt/mailroot/</pre>
<p>Don’t forget to unmount the root partition when you’re done! Xen will not boot the domain if the partition is already mounted.</p>
<h3>Download a kernel for the domU</h3>
<p>The kernel that we will need to boot the domU has be to located in the dom0.</p>
<p>You can use the standard xen kernel that comes with CentOS to do that (e.g. vmlinuz-2.6.18-53.1.13.el5xen) , but you’ll also need an initrd, or the kernel won’t boot. To make the initrd, use the following command :</p>
<pre>/sbin/mkinitrd --with=xennet --preload=xenblk /boot/initrd-centos5-xen.img 2.6.18-53.1.13.el5xen</pre>
<p>This makes an initrd image with the required modules to boot a domU. The last parameter is the version of your kernel (the one you will use to boot the domU). You can get this number by typing “uname -r” on the command line. This will result in a /boot/initrd-centos5-xen.img image file.</p>
<p>Note (2008-02-14) : in a previous version of this blog post, I recommended to use a kernel from the official Xen distribution at xen.org. It worked, but it doesn’t seem to work anymore.</p>
<h3>Create the configuration file</h3>
<p>The configuration of the Xen guest is controlled by a simple text file. Create it as /etc/xen/<em>yourdomUname</em>, and move (or symlink) it in /etc/xen/auto if you want to start it automatically on boot.</p>
<p>Most basic parameters in this file are easy to understand. You should make sure “kernel” points to the kernel you copied from the xen tarball. “memory” is the amount of RAM allocated to the guest. “name” will be the name of the guest that you will use when connecting to it or shutting it down using the “xm” command.</p>
<p>“vif” contains information about network interfaces. One important thing in that line is the MAC address. If you don’t specify it here, a random MAC will be assigned at each boot, and that may not give good results. Edit the last 3 numbers (put anything, it just has to be unique across your network).</p>
<p>Finally, ‘disk’ is the parameter that tells Xen what partitions to use and what device name it will assign them. The last line, ‘root’, will tell the kernel what is the root device.</p>
<pre>kernel = "/boot/vmlinuz-2.6.18-53.1.13.el5xen"
ramdisk = "/boot/initrd-centos5-xen.img"
memory = 512
name = "mail"
vif = [ 'mac=00:16:3e:21:f1:31,bridge=xenbr0' ]
dhcp = "dhcp"
disk = ['phy:/dev/vg0/mailroot,sda1,w', 'phy:/dev/vg0/mailswap,sda2,w' ]
# The next line would be useful if you want to use an simple file instead of a partition/LV
#disk = ['file:/root/test.img,sda1,w', 'file:/root/centos.swap,sda2,w' ]
# We don't use pygrub, we boot the kernel directly from dom0
#bootloader="/usr/bin/pygrub"
root = "/dev/sda1 ro"</pre>
<h3>Boot the domain!</h3>
<p>OK, you’re ready to boot the guest domain! Just issue the following command to “create” (which means boot, really) the domU.</p>
<pre>xm create /etc/xen/YOUR_CONFIG_FILE -c</pre>
<p>The -c parameter tells xm to connect to the domain’s console. You can disconnect from it by pressing CTRL+], and connect to it again with “xm connect NAME”.</p>
<p>If everything works right, you should see the login prompt appearing, and you will be ready to use the new guest domain!</p>
<h4>Fix SSH</h4>
<p>If you made the guest image yourself as I explained in my previous post (part 1), you need to create the random device to fix SSH (and probably other services that requires generating keys). Issue the following commands on the guest’s console :</p>
<pre>/sbin/MAKEDEV generic
/etc/init.d/sshd start</pre>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Fcentos-5-xen-images-part-2-installing-the-xen-guest%2F';
  addthis_title  = 'CentOS+5+Xen+images+%26%238211%3B+part+2%3A+installing+the+Xen+guest';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/centos-5-xen-images-part-2-installing-the-xen-guest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS 5 Xen images – part 1: creating a base domU image with yum</title>
		<link>http://blog.webramz.com/centos-5-xen-images-%e2%80%93-part-1-creating-a-base-domu-image-with-yum/</link>
		<comments>http://blog.webramz.com/centos-5-xen-images-%e2%80%93-part-1-creating-a-base-domu-image-with-yum/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 05:04:33 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Xen]]></category>
		<category><![CDATA[create xen guest]]></category>
		<category><![CDATA[install xen guest]]></category>
		<category><![CDATA[xen guest]]></category>
		<category><![CDATA[xen guest image]]></category>

		<guid isPermaLink="false">http://blog.webramz.com/?p=116</guid>
		<description><![CDATA[I recently needed to configure Xen guests on a CentOS server. I didn’t want to use CentOS/Redhat’s tool for several reasons : I don’t like the fact that it creates a “disk” with a whole partition table within the partition where you install it. Installing the guest directly on a LVM logical volume seems better to me (I may not be right, I’m still somewhat new to Xen!). Also, it was very instructive to do all the steps by myself rather than using a tool that does everything.]]></description>
			<content:encoded><![CDATA[<p>I recently needed to configure Xen guests on a CentOS server. I didn’t want to use CentOS/Redhat’s tool for several reasons : I don’t like the fact that it creates a “disk” with a whole partition table within the partition where you install it. Installing the guest directly on a LVM logical volume seems better to me (I may not be right, I’m still somewhat new to Xen!). Also, it was very instructive to do all the steps by myself rather than using a tool that does everything.</p>
<p>However, I had several problems while trying to install my first guest system, so it took me quite some time to find the right way to do it. I found a lot of documentation on the web, but nothing really described what I really wanted to do. So here we are, I decided to write a post describing what to do exactly to make a custom guest image and install it as a Xen domU.</p>
<p>In this first part, I will explain how to make an OS image of CentOS 5 that will be suited for Xen.</p>
<h3>Ready to use images</h3>
<p><a href="http://jailtime.org/" target="_blank">Jailtime.org</a> offer Xen images for several operating systems, including CentOS 4 and 5. However, only 32-bit images are available. If 32-bit images are OK for you, I recommend that you use the jailtime images : it will be a lot easier.<br />
A note about the jailtime.org CentOS image : I found that the console was not working on boot. The OS seemed to just hang after starting SSHD, but in fact, it was just that there was no console for Xen to connect to. If you have this problem, see the part about configuring the console in the “Custom CentOS 5 image” section of this article.</p>
<h3>Custom CentOS 5 image</h3>
<p>Since I wanted 64-bit domUs, I decided to make my own images. There are few things that need to be modified to make a standard CentOS installation work as a Xen domU. Here are the steps needed to make your own image with yum.</p>
<h4>Prepare the environment</h4>
<ol>
<li>Prepare a directory where you will store your image. I will use /mnt/centos.<br />
Note that you may want to chroot into the image when you need to work within it only. To do so, type :<br />
cd /mnt/centos; chroot .<br />
(Don’t chroot now, since there’s nothing in there for now)</li>
<li>Create a special yum configuration file. We need a yum.conf file with “hard coded” architecture and version, instead of the variables the default yum.conf file contains.<br />
Create /etc/yum-xen.conf with the following content.</p>
<pre>[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=5&amp;arch=x86_64&amp;repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5&amp;arch=x86_64&amp;repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=5&amp;arch=x86_64&amp;repo=addons
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5</pre>
</li>
<li>Install the core packages.<br />
We will use yum to install a core CentOS system in our target directory.</p>
<pre>yum -c /etc/yum-xen.conf --installroot=/centos -y groupinstall core --disablerepo=extras</pre>
<p>Here, we disable the “extras” repository since we don’t need it, and the variables it contains will make yum fail. You may need to disabled other repositories if you have installed custom ones.</li>
</ol>
<p>You should now have a base system in your /centos directory ! But that’s not all, we need to modify few things to make our system suitable as a Xen guest.</p>
<h4>Changes needed to the base system</h4>
<p>As said earlier, you should now chroot in the /centos directory for the next steps. If you don’t do that, you could end up modifying your host OS instead of the image.</p>
<ol>
<li>Console<br />
You need to add a console to /etc/inittab, or Xen won’t display any login prompt when the image boot. You can also remove the default TTYs (tty1-tty6), since they won’t be needed in a Xen guest.</p>
<pre># add a console for xen
co:2345:respawn:/sbin/mingetty console
# comment out the default TTYs
#1:2345:respawn:/sbin/mingetty tty1
#2:2345:respawn:/sbin/mingetty tty2
#3:2345:respawn:/sbin/mingetty tty3
#4:2345:respawn:/sbin/mingetty tty4
#5:2345:respawn:/sbin/mingetty tty5
#6:2345:respawn:/sbin/mingetty tty6</pre>
</li>
<li>You need to disabled TLS (it would slow down the guest)
<pre># for 32 bit :
mv /lib/tls /lib/tls.disabled
# for 64 bit :
mv /lib64/tls /lib64/tls.disabled</pre>
</li>
<li>Disable the hardware clock<br />
The Xen domU will use the host’s clock, so we replace hwclock with an empty shell script</p>
<pre>echo exit 0 &gt; /sbin/hwclock</pre>
</li>
<li><span style="text-decoration: line-through;">Disable udev in /etc/rc.sysinit<br />
Apparently udev is problematic with Xen, so we will comment the line where it’s started in rc.sysinit (line 338):</span></p>
<pre><span style="text-decoration: line-through;">#/sbin/start_udev</span></pre>
<p>UPDATE 2008-02-14 : It seems that it may be a good idea to leave udev enabled after all… I’m getting permissions problem on devices such as /dev/null without udev. Enabling it fix the problem, and does not seem to cause any other problem.</li>
<li>Network configuration.<br />
If you want, you can define network parameters.<br />
<strong>/etc/sysconfig/network-scripts/ifcfg-eth0</strong></p>
<pre>TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.13
IPV6ADDR=
IPV6PREFIX=
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes</pre>
<p><strong>/etc/sysconfig/network</strong></p>
<pre>NETWORKING=yes
HOSTNAME=myhost.l3i.ca
GATEWAY=192.168.0.1</pre>
<p><strong>/etc/resolv.conf (DNS resolver)</strong></p>
<pre>nameserver 4.2.2.1
nameserver 4.2.2.2</pre>
</li>
<li>SELinux<br />
You may want to disabled SELinux. That’s done in /etc/sysconfig/selinux (put SELINUX=disabled)</li>
<li>Root password<br />
We need to create a root password and create the password database (or we wouldn’t be able to log in the system).</p>
<pre>pwconv
passwd root</pre>
</li>
<li>Create the /etc/fstab file.<br />
In this file, /dev/sda1 is the root (ext3) filesystem and sda2 is swap. You will need to configure Xen with these device names.</p>
<pre>cat &gt; /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/sda1               /                       ext3    defaults 1 1
/dev/sda2               none                    swap    sw       0 0
none                    /dev/pts                devpts  gid=5,mode=620 0 0
none                    /dev/shm                tmpfs   defaults 0 0
none                    /proc                   proc    defaults 0 0
none                    /sys                    sysfs   defaults 0 0
#(press CTRL+D to end "cat")</pre>
</li>
<li>Disable HAL<br />
HAL will fail, so let’s just disable it.</p>
<pre>/sbin/chkconfig haldaemon off</pre>
</li>
<li>SSH<br />
A note about SSH : it will fail to generate a key on the first load because there is not /dev/urandom device. You will have to fix it after starting the domU, on the console. The following command will fix it :</p>
<pre>/sbin/MAKEDEV generic
/etc/init.d/sshd start</pre>
</li>
</ol>
<p>You now have an image ready to be used as a Xen guest! Be sure to keep a copy before using it as a domU, so when you need to install another guest, you will have an image ready for it and won’t need to repeat these steps all over again.</p>
<p>In part 2, I will explain how to install a Xen guest from this image. (coming soon!)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Fcentos-5-xen-images-%25e2%2580%2593-part-1-creating-a-base-domu-image-with-yum%2F';
  addthis_title  = 'CentOS+5+Xen+images+%E2%80%93+part+1%3A+creating+a+base+domU+image+with+yum';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/centos-5-xen-images-%e2%80%93-part-1-creating-a-base-domu-image-with-yum/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>/vz partition errors or when /vz goes read-only</title>
		<link>http://blog.webramz.com/vz-partition-errors-or-when-vz-goes-read-only/</link>
		<comments>http://blog.webramz.com/vz-partition-errors-or-when-vz-goes-read-only/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 04:54:01 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Linux | CentOS]]></category>
		<category><![CDATA[OpenVZ]]></category>

		<guid isPermaLink="false">http://blog.webramz.com/?p=112</guid>
		<description><![CDATA[A few times now we have seen problems on the Linux virtuozzo servers where the /vz partition errors out and the kernel forces it to go into a read-only state. The solution is to manually run a filesystem check (FSCK) with the -fy arguments on the /vz partition. It is possible on a vz server to do this without a support ticket, however you must be careful with a few steps.]]></description>
			<content:encoded><![CDATA[<h2><span style="color: #ff0000;">Note : Be Careful while using these steps.</span></h2>
<p>A few times now we have seen problems on the Linux virtuozzo servers where the /vz partition errors out and the kernel forces it to go into a read-only state. The solution is to manually run a filesystem check (FSCK) with the -fy arguments on the /vz partition. It is possible on a vz server to do this without a support ticket, however you must be careful with a few steps.</p>
<p>1. Stop the vz service (service vz stop)</p>
<p>2. Disable the vz service from restarting on boot (chkconfig &#8211;level 2345 vz off)</p>
<p>3. Comment out the /vz partition inside the /etc/fstab file to prevent the /vz partition being automaticlyt checked on boot.</p>
<p>4. Reboot the server</p>
<p>5. Once the server reboots and you can SSH back in you can begin the filesystem check.</p>
<p>6. Determine which physical partition is /vz/ You can do this with the command (fdisk -l /dev/sda). This will show you all the partitions.</p>
<p>Usually the /vz partition is the last one listed and will have the larges amount of blocks with a &#8220;ID&#8221; of 83 and &#8220;System&#8221; label of Linux:</p>
<p>EXAMPLE<br />
# fdisk -l /dev/sda</p>
<p>Disk /dev/sda: 299.9 GB, 299978719232 bytes<br />
255 heads, 63 sectors/track, 36470 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot Start End Blocks Id System<br />
/dev/sda1 * 1 1305 10482381 83 Linux<br />
/dev/sda2 1306 2610 10482412+ 83 Linux<br />
/dev/sda3 2611 3915 10482412+ 83 Linux<br />
/dev/sda4 3916 36470 261498037+ 5 Extended<br />
/dev/sda5 3916 4437 4192933+ 82 Linux swap<br />
/dev/sda6 4438 4568 1052226 83 Linux<br />
/dev/sda7 4569 36470 256252783+ 83 Linux</p>
<p>In the above example you can see that /dev/sda7 have the most blocks and has the &#8220;ID&#8221; of 83 and &#8220;System&#8221; label of Linux:.</p>
<p>Therefore we would issue the command (fsck -fy /dev/sda7).</p>
<p>7. Once the file system check is complete you can uncomment the /vz parition in /etc/fstab</p>
<p>8. re-enable the vz service to start on boot (chkconfig &#8211;level 2345 vz on)</p>
<p>9. start up the vz service (service vz start)</p>
<p>All should then be well. You can monitor the logfile /var/log/vzctl.log as VE&#8217;s are brought online.</p>
<p>If you are uncomfortable doing any of this then please contact a senior tech or management and we can help out. Please remember it is very dangerous to FSCK a mounted partition to always ensure the target partition os unmounted before beginning. Generally you cannot umout a /vz partition after stopping the VZ service so I recommend the reboot with /vz partition disabled and the vz service disabled.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Fvz-partition-errors-or-when-vz-goes-read-only%2F';
  addthis_title  = '%2Fvz+partition+errors+or+when+%2Fvz+goes+read-only';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/vz-partition-errors-or-when-vz-goes-read-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a static copy of a dynamic website</title>
		<link>http://blog.webramz.com/creating-a-static-copy-of-a-dynamic-website/</link>
		<comments>http://blog.webramz.com/creating-a-static-copy-of-a-dynamic-website/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 05:50:13 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Linux | CentOS]]></category>
		<category><![CDATA[Web Programming]]></category>

		<guid isPermaLink="false">http://behzad.nategh.com/?p=105</guid>
		<description><![CDATA[At work we have several websites that we develop, but each year we make a new version and we want to keep an archive of the old version.  It makes sense to make a static copy of the website. It also eliminates the work needed to update the instance when security patches come out (and eliminates security risks, in cases of old versions that are no more maintained).

There are some tools that can help in this case; I chose to use wget, which is available in most Linux distributions by default.]]></description>
			<content:encoded><![CDATA[<p>From blog entry at: <a href="http://blog.jphoude.qc.ca/2007/10/16/creating-static-copy-of-a-dynamic-website/">http://blog.jphoude.qc.ca/2007/10/16/creating-static-copy-of-a-dynamic-website/</a></p>
<p>At work we have several websites that we develop, but each year we make a new version and we want to keep an archive of the old version.</p>
<p>Since it takes a lot of memory to keep a Zope instance for these old websites that probably won’t need to be edited ever again, it makes sense to make a static copy of the website. It also eliminates the work needed to update the instance when security patches come out (and eliminates security risks, in cases of old versions that are no more maintained).</p>
<p>There are some tools that can help in this case; I chose to use wget, which is available in most Linux distributions by default.</p>
<h3>The command line, in short…</h3>
<pre># wget -k -K  -E -r -l 10 -p -N -F --restrict-file-names=windows -nH <a title="http://website.com/" href="http://website.com/">http://website.com/</a></pre>
<h3>…and the options explained</h3>
<p>-k : convert links to relative<br />
-K : keep an original versions of files without the conversions made by wget<br />
-E : rename html files to .html (if they don’t already have an htm(l) extension)<br />
-r : recursive… of course we want to make a recursive copy<br />
-l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.<br />
-p : download all necessary files for each page (css, js, images)<br />
-N : Turn on time-stamping.<br />
-F : When input is read from a file, force it to be treated as an HTML file.<br />
-nH : By default, wget put files in a directory named after the site’s hostname. This will disabled creating of those hostname directories and put everything in the current directory.<br />
–restrict-file-names=windows : may be useful if you want to copy the files to a Windows PC.</p>
<h3>Possible problems</h3>
<ul>
<li>wget download the homagepage, robots.txt then stops!<br />
Your robots.txt file probably denies access to your site to search engines. Yes, in recursive mode, wget will respect the robots.txt file, so you will need to remove it before making the copy. Don’t forget to put it back in the static site if that’s what you want.</li>
<li>Stylesheets : if you have @import stylesheet imports, wget won’t see them, and won’t download them <img src="http://blog.jphoude.qc.ca/wp-includes/images/smilies/icon_sad.gif" alt=":(" /> You might want to change them to &lt;link rel=”stylesheet” … /&gt; imports, which wget will see and download.</li>
<li>Stylesheet images : wget won’t download background-images referenced in CSS files. For most websites that should not be too long to download those images manually.</li>
<li>Be sure that you CSS files and with “.css”! Apache won’t send the correct mime-type if your file extension is not .css, and Firefox will not use the stylesheet.<br />
(test.css?color=blue won’t work, change it to test.css?color=blue&amp;ext=.css)<br />
The same problem may happen with other files types that need to have a proper mimetype set (video files, for instance)</li>
<li><strong>LinguaPlone specific problems</strong>
<ul>
<li>To prevent having several duplicated files with the set_language parameter, you could setup one subdomain for each language, and force the set_language= in the Apache redirect rule.</li>
<li>I also recommand to change the language link so it points to the main page instead of the current page.</li>
<li>You have several possibilities here, but by just doing a wget without changing anything, you may end up with pages where languages are a bit fucked up.</li>
</ul>
</li>
<li>&lt;base&gt; tag problem : If you pages contains a base tag (which is true for Plone sites), wget will empty it’s value but leave the base tag there ([base href="" /]). That works in Firefox, but it will confuse IE, which won’t load any images, CSS or links.To fix it, you can remove the base tag completely with this command :
<pre># find | grep html$ | xargs perl -i -p -e 's/&lt;base href=\"\" \/&gt;//g'</pre>
</li>
</ul>
<h3>Downsides</h3>
<ul>
<li>Most file names will change (bad for SEO)</li>
<li>May take some manual work to have a working static copy</li>
</ul>
<p>After taking care of all the possible problems, you should have a working static site! Be sure to check with both IE and Firefox (at least), because some problems happen in only one browser.<br />
Then, you can shut down your CMS and server the static content using a standard webserver.</p>
<p>Don’t forget to put a nice 404 page pointing to your main page, since your URLs probably changed, and several visitors will get a 404 error if they come from search engines or bookmarks.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Fcreating-a-static-copy-of-a-dynamic-website%2F';
  addthis_title  = 'Creating+a+static+copy+of+a+dynamic+website';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/creating-a-static-copy-of-a-dynamic-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add partition/unallocated space to lvm</title>
		<link>http://blog.webramz.com/add-partitionunallocated-space-to-lvm/</link>
		<comments>http://blog.webramz.com/add-partitionunallocated-space-to-lvm/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 20:35:53 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Linux | CentOS]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[partition lvm]]></category>
		<category><![CDATA[resize lvm]]></category>

		<guid isPermaLink="false">http://behzad.nategh.com/?p=102</guid>
		<description><![CDATA[The whole point of LVM is that you CAN resize partitions, use multiple physical disks or partitions as one &#8220;logical&#8221; partition, etc. In order to utilize the free space you will need to create an additional partition using the free space. Find out which disk the free space resides on using &#8220;fdisk -l&#8221;, then do [...]]]></description>
			<content:encoded><![CDATA[<p>The whole point of LVM is that you CAN resize partitions, use multiple physical disks or partitions as one &#8220;logical&#8221; partition, etc. In order to utilize the free space you will need to create an additional partition using the free space.</p>
<p>Find out which disk the free space resides on using &#8220;fdisk -l&#8221;, then do &#8220;fdisk /dev/hda&#8221; replacing hda with whichever disk is correct. Once a partition has been created using the free space we can now create a new physical volume:</p>
<pre><code>pvcreate /dev/hda3
</code></pre>
<p>Replace hda3 with whatever the name of the new partition is (available within &#8220;fdisk -l&#8221;). Now we will extend the Volume Group to the new physical volume like so:</p>
<pre><code>vgextend /dev/VolGroup00 /dev/hda3
</code></pre>
<p>Where VolGroup00 is the name of whichever VG exists on your system (available by running &#8220;vgdisplay&#8221;). Where hda3 is the name of the new partition (again). Once the VG has been extended we can now extend the Logical Volume:</p>
<pre><code>lvextend -L +20G /dev/VolGroup00/LogVol00
</code></pre>
<p>Where 20G is changed to the amount of free space available and VG and LV changed to their correct names. Once the Logical Volume has been extended we have to extend the ext4 filesystem within that LV:</p>
<pre><code>resize2fs /dev/VolGroup00/LogVol00
</code></pre>
<p>Again, change the names to match your system. You can perform all of this on a running system..including the last command. Extending ext4 on a mounted partition works fine since early versions of the 2.6 kernel.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Fadd-partitionunallocated-space-to-lvm%2F';
  addthis_title  = 'Add+partition%2Funallocated+space+to+lvm';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/add-partitionunallocated-space-to-lvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Fast Public DNS Servers List</title>
		<link>http://blog.webramz.com/free-fast-public-dns-servers-list/</link>
		<comments>http://blog.webramz.com/free-fast-public-dns-servers-list/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 23:57:21 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[Linux | CentOS]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[dns list]]></category>
		<category><![CDATA[dns server]]></category>
		<category><![CDATA[public dns]]></category>

		<guid isPermaLink="false">http://behzad.nategh.com/?p=98</guid>
		<description><![CDATA[This is my list of better, fast public dns servers and free dns server (as compare to your ISP / DSL / ADSL / cable DNS service providers dns servers). These dns servers are free to all. I was able to improve my browsing speed with following DNS servers. Use any one of the following provider. [...]]]></description>
			<content:encoded><![CDATA[<p>This is my list of better, fast public dns servers and free dns server (as compare to your ISP / DSL / ADSL / cable DNS service providers dns servers). These dns servers are free to all. I was able to improve my browsing speed with following DNS servers. Use any one of the following provider.</p>
<h2><span style="font-weight: normal;">Free Public DNS Server</span></h2>
<p>Service provider: <a href="http://code.google.com/speed/public-dns/" target="_blank">Google</a></p>
<ul>
<li>8.8.8.8</li>
<li>8.8.4.4</li>
</ul>
<p>Service provider: <a href="http://www.scrubit.com/" target="_blank">ScrubIt</a><br />
Public dns server address:</p>
<ul>
<li>67.138.54.100</li>
<li>207.225.209.66</li>
</ul>
<p>Service provider:<a href="http://www.dnsadvantage.com" target="_blank">dnsadvantage</a><br />
Dnsadvantage free dns server list:</p>
<ul>
<li>156.154.70.1</li>
<li>156.154.71.1</li>
</ul>
<p>Service provider:<a href="http://www.opendns.com/" target="_blank">OpenDNS</a><br />
OpenDNS free dns server list:</p>
<ul>
<li>208.67.222.222</li>
<li>208.67.220.220</li>
</ul>
<p>Service provider: vnsc-pri.sys.gtei.net<br />
Public Name server IP address:</p>
<ul>
<li>4.2.2.1</li>
<li>4.2.2.2</li>
<li>4.2.2.3</li>
<li>4.2.2.4</li>
<li>4.2.2.5</li>
<li>4.2.2.6</li>
</ul>
<h3><span style="font-weight: normal;">How do I change or setup DNS server IP address?</span></h3>
<p>Visit below mentioned site to setup DNS as per your operating system:</p>
<ul>
<li><a href="http://www.cyberciti.biz/tips/linux-how-to-setup-as-dns-client.html">Linux</a></li>
<li><a href="http://www.cyberciti.biz/tips/freebsd-how-to-setup-freebsd-as-dns-client.html">FreeBSD</a></li>
<li><a href="http://www.cyberciti.biz/tips/solaris-dns-client-configuration.html">Sun Solaris</a></li>
<li><a href="http://www.opendns.com/start/windows.php">Microsoft Windows Vista / XP / Server 2003</a></li>
<li><a href="http://www.opendns.com/start/at_home.php">Router / Wifi Router</a></li>
</ul>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Ffree-fast-public-dns-servers-list%2F';
  addthis_title  = 'Free+Fast+Public+DNS+Servers+List';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/free-fast-public-dns-servers-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install PRO/Wireless 3945ABG Network on Red Hat / CentOS 5</title>
		<link>http://blog.webramz.com/install-prowireless-3945abg-network-on-red-hat-centos-5/</link>
		<comments>http://blog.webramz.com/install-prowireless-3945abg-network-on-red-hat-centos-5/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 03:37:50 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Linux | CentOS]]></category>

		<guid isPermaLink="false">http://behzad.nategh.com/?p=96</guid>
		<description><![CDATA[Using Toshiba Tecra notebook? I just spent a day to setup my new workstation by installing CentOS on my laptop, as second OS and found that it is not too hard to migrate to stable OS, from shitty Windows. Windows came up with crashed user profile, and I had to spend a day or two [...]]]></description>
			<content:encoded><![CDATA[<p>Using Toshiba Tecra notebook?</p>
<p>I just spent a day to setup my new workstation by installing CentOS on my laptop, as second OS and found that it is not too hard to migrate to stable OS, from shitty Windows. Windows came up with crashed user profile, and I had to spend a day or two to fix it, so decided to throw away Windows, with prey <img src='http://blog.webramz.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>To find out your hardware:</p>
<pre># lspci | grep Wirel</pre>
<p><strong><span style="color: #ff0000;">Note: The iwlwifi driver has been merged into mainline kernel since 2.6.24. If you are using kernels after this release, please use the intree (drivers/net/wireless/iwlwifi) driver directly. After 2.6.26 the intree driver iwlagn also supports the new 5100BG, 5100ABG, 5100AGN, 5300AGN, 5350AGN, 5150AGN, 1000BGN, 6000AGN, and 6250AGN series hardwares. </span></strong></p>
<p>Redhat also patches old kernels, so with update to kernel 2.6.18-194.3.1.el5, iwlwifi driver will be in your kernel. But to get it working, you need to download and install the microcode (ucode):</p>
<p>You have to download the latest version seems to be iwlwifi-3945-2.ucode and it is from:<br />
<a href="http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-3945-ucode-15.28.2.8.tgz" target="_blank">http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-3945-ucode-15.28.2.8.tgz</a></p>
<p>and install it.</p>
<pre><strong>For Intel PRO/Wireless 3945ABG/BG Network Connection users</strong>:
# wget \

http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-3945-ucode-15.28.2.8.tgz

# tar xvf iwlwifi-3945-ucode-15.28.2.8.tgz
# cp iwlwifi-3945-ucode-15.28.2.8/iwlwifi-3945-2.ucode /lib/firmware/</pre>
<p>Now try to enable wireless network, usually named wlan0:</p>
<pre>
To scan wireless networks:
# iwlist wlan0 scan
To bring network up:
# ifconfig wlan0 up
</pre>
<p>Check dmesg for any error, if you get connection, you&#8217;re lucky, if not try to disable network encryption on your modem and check again. You have to get connected with encryption off.<br />
<br />
The next, you need to enable wpa_supplicant service, system -> services -> wpa_supplicant (enable &#038; start) to be able to connect to encrypted network. Edit /etc/wpa_supplicant/wpa_supplicant.conf and add these lines to it, you need to edit these lines with your config, then restart wpa_supplicant service:</p>
<pre>
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
        ssid="Nirvana"
        proto=WPA
        key_mgmt=WPA-PSK
        psk="Kurt Cobain"
}
</pre>
<p>Try again to activate wlan0, don&#8217;t forget to check dmesg and messages. Hope this help.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Finstall-prowireless-3945abg-network-on-red-hat-centos-5%2F';
  addthis_title  = 'Install+PRO%2FWireless+3945ABG+Network+on+Red+Hat+%2F+CentOS+5';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/install-prowireless-3945abg-network-on-red-hat-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red Hat Enterprise Linux / CentOS Linux Enable EPEL (Extra Packages for Enterprise Linux) Repository</title>
		<link>http://blog.webramz.com/red-hat-enterprise-linux-centos-linux-enable-epel-extra-packages-for-enterprise-linux-repository/</link>
		<comments>http://blog.webramz.com/red-hat-enterprise-linux-centos-linux-enable-epel-extra-packages-for-enterprise-linux-repository/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 02:47:27 +0000</pubDate>
		<dc:creator>Behzad</dc:creator>
				<category><![CDATA[Linux | CentOS]]></category>

		<guid isPermaLink="false">http://behzad.nategh.com/?p=92</guid>
		<description><![CDATA[EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux.]]></description>
			<content:encoded><![CDATA[<p>Q. How do I enable EPEL (Extra Packages for Enterprise Linux) repo and install the packages under RHEL / CentOS Linux?</p>
<p>A. EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux.</p>
<p>EPEL provide lots of packages for CentOS / RHEL, It is not part of RedHat or CentOS but is designed to work with these major distributions. Please note that EPEL only provides free and open source software unencumbered by patents or any legal issues. In short you will not find mp3, dvd and music / media player under EPEL. However, you will find many programs related to networking, monitoring, sys admin, programming and so on.</p>
<p>Packages are supplied in RPM format and in most cases are ready to use. Beware that some packages may break something and you should not blindly install those packages.</p>
<h2>How do I enable EPEL?</h2>
<p>Simply type the following command as root user:<br />
<code># rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm</code><br />
AND/OR<br />
<code># rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm</code><br />
List new repo:<br />
<code># yum repolist</code><br />
Sample output:</p>
<pre>Loading "skip-broken" plugin
Loading "fastestmirror" plugin
repo id              repo name                                 status
addons               CentOS-5 - Addons                         enabled
base                 CentOS-5 - Base                           enabled
epel                 Extra Packages for Enterprise Linux 5 -   enabled
extras               CentOS-5 - Extras                         enabled
updates              CentOS-5 - Updates                        enabled</pre>
<p>Once installed use yum command to list, view and install the packages:<br />
<code># yum search package-name<br />
# yum install package-name</code><br />
See how to use <a href="http://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/">yum command</a> for installing and searching packages using various repos.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.webramz.com%2Fred-hat-enterprise-linux-centos-linux-enable-epel-extra-packages-for-enterprise-linux-repository%2F';
  addthis_title  = 'Red+Hat+Enterprise+Linux+%2F+CentOS+Linux+Enable+EPEL+%28Extra+Packages+for+Enterprise+Linux%29+Repository';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.webramz.com/red-hat-enterprise-linux-centos-linux-enable-epel-extra-packages-for-enterprise-linux-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
