<?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>Sébastien Wains &#187; RHCE</title>
	<atom:link href="http://www.wains.be/index.php/category/rhce/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wains.be</link>
	<description>Linux, Open Source, VoIP and other stuff</description>
	<lastBuildDate>Tue, 07 Sep 2010 21:25:11 +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>OpenVPN : routing all traffic through the VPN tunnel</title>
		<link>http://www.wains.be/index.php/2008/07/18/openvpn-routing-all-traffic-through-the-vpn-tunnel/</link>
		<comments>http://www.wains.be/index.php/2008/07/18/openvpn-routing-all-traffic-through-the-vpn-tunnel/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 20:47:31 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Debian/Ubuntu]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RHCE]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://www.wains.be/?p=368</guid>
		<description><![CDATA[I&#8217;m really into OpenVPN these days, see my two previous posts about it : Setting up OpenVPN for your road warriors : http://www.wains.be/index.php/2008/07/15/a-vpn-for-remote-users-with-openvpn/ Setting up a VPN between two sites : http://www.wains.be/index.php/2008/06/07/routed-openvpn-between-two-subnets-behind-nat-gateways/ Today : how to route all traffic through the OpenVPN tunnel On the server side : First of all, if you want to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really into OpenVPN these days, see my two previous posts about it :</p>
<p>Setting up OpenVPN for your road warriors :<br />
<a href="http://www.wains.be/index.php/2008/07/15/a-vpn-for-remote-users-with-openvpn/">http://www.wains.be/index.php/2008/07/15/a-vpn-for-remote-users-with-openvpn/</a></p>
<p>Setting up a VPN between two sites :<br />
<a href="http://www.wains.be/index.php/2008/06/07/routed-openvpn-between-two-subnets-behind-nat-gateways/">http://www.wains.be/index.php/2008/06/07/routed-openvpn-between-two-subnets-behind-nat-gateways/</a></p>
<p><strong>Today : how to route all traffic through the OpenVPN tunnel</strong></p>
<p><strong>On the server side :</strong></p>
<p>First of all, if you want to route all your traffic through the VPN tunnel, you need to turn on IP forwarding (also called routing) and add a masquerading rule on the server (where eth0 is the device connecting you to the internet) :</p>
<pre><code>echo "1" &gt; /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -s 10.30.0.0/24 -o eth0 -j MASQUERADE</code></pre>
<p>To make routing persistent, see <a href="http://www.wains.be/index.php/2006/06/06/enable-ip-forward-under-rhelcentos/">http://www.wains.be/index.php/2006/06/06/enable-ip-forward-under-rhelcentos/</a></p>
<p>Then, here&#8217;s the OpenVPN configuration :</p>
<p><code>port    10000<br />
proto   udp<br />
dev     tun<br />
comp-lzo<br />
ca      ca.crt<br />
cert    server.crt<br />
key     server.key<br />
dh      dh1024.pem<br />
duplicate-cn<br />
server  10.30.0.0 255.255.255.0<br />
client-to-client<br />
push    "dhcp-option DOMAIN local.example.org"<br />
push    "dhcp-option DNS 172.16.7.253"<br />
push    "redirect-gateway def1"<br />
keepalive       10 120<br />
persist-key<br />
persist-tun<br />
user nobody<br />
group nogroup<br />
log     vpn.log<br />
verb    1<br />
chroot /tmp</code></p>
<p>You can see the option <strong>redirect-gateway</strong> that is responsible for creating all the routes on the client computer when the connection is set up.</p>
<p>The two other push options are only taken into account by Windows clients (to my knowledge).<br />
If you want to change the DNS resolution of your linux clients, you need to use the up and down options on the client (see below).</p>
<p><strong>Client configuration :</strong></p>
<p>vpn.conf :</p>
<pre><code>client
dev tun
proto udp
remote vpn.example.org
port 10000
nobind
persist-key
persist-tun
ca ./ca.crt
cert ./user.crt
key ./user.key
verb 5
up ./up.sh
down ./down.sh
ping 60
ping-restart 120</code></pre>
<p>up.sh :</p>
<p><code>#!/bin/sh<br />
mv /etc/resolv.conf /etc/resolv.conf.bak<br />
echo "search local.example.org" &gt; /etc/resolv.conf<br />
echo "nameserver 172.16.7.253" &gt;&gt; /etc/resolv.conf</code></p>
<p>down.sh :</p>
<p><code>#!/bin/sh<br />
mv /etc/resolv.conf.bak /etc/resolv.conf</code></p>
<p>When connecting to the server (with verbose option set to 5), we can see the server pushing the route settings to the client.</p>
<p><code>Fri Jul 18 23:22:19 2008 us=838005 ifconfig tun0 10.30.0.6 pointopoint 10.30.0.5 mtu 1500<br />
Fri Jul 18 23:22:19 2008 us=843211 route add -net 72.x.x.x netmask 255.255.255.255 gw 172.16.7.253<br />
Fri Jul 18 23:22:19 2008 us=845178 route add -net 0.0.0.0 netmask 128.0.0.0 gw 10.30.0.5<br />
Fri Jul 18 23:22:19 2008 us=848568 route add -net 128.0.0.0 netmask 128.0.0.0 gw 10.30.0.5<br />
Fri Jul 18 23:22:19 2008 us=850460 route add -net 10.30.0.0 netmask 255.255.255.0 gw 10.30.0.5</code></p>
<p>On the client, the routes :</p>
<pre><code>$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
72.x.x.x  172.16.7.253   255.255.255.255 UGH   0      0        0 wlan0
10.30.0.5       0.0.0.0         255.255.255.255 UH    0      0        0 tun0
172.16.7.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0
10.30.0.0       10.30.0.5       255.255.255.0   UG    0      0        0 tun0
0.0.0.0         10.30.0.5       128.0.0.0       UG    0      0        0 tun0
128.0.0.0       10.30.0.5       128.0.0.0       UG    0      0        0 tun0
0.0.0.0         172.16.7.253   0.0.0.0         UG    0      0        0 wlan0</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2008/07/18/openvpn-routing-all-traffic-through-the-vpn-tunnel/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>VSftpd on RHEL</title>
		<link>http://www.wains.be/index.php/2007/04/10/vsftpd-on-rhel/</link>
		<comments>http://www.wains.be/index.php/2007/04/10/vsftpd-on-rhel/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 09:07:50 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/04/10/vsftpd-on-rhel/</guid>
		<description><![CDATA[FTP server on RHEL RPM : vsftpd Config : /etc/vsftpd/vsftpd.conf By default : - anonymous users will fall in a chroot located in /var/ftp/pub. They have read access only. - local users are connecting in their /home and are not chrooted In order to chroot local users use in the config : chroot_local_user=YES Thanks to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>FTP server on RHEL</strong></p>
<p>RPM : vsftpd</p>
<p>Config : /etc/vsftpd/vsftpd.conf</p>
<p>By default :<br />
- anonymous users will fall in a chroot located in /var/ftp/pub. They have read access only.<br />
- local users are connecting in their /home and are not chrooted</p>
<p>In order to chroot local users use in the config :<br />
<code>chroot_local_user=YES</code></p>
<p>Thanks to Toutim for pointing out a mistake I&#8217;ve made in this article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/04/10/vsftpd-on-rhel/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SWAP space under RHEL/CentOS</title>
		<link>http://www.wains.be/index.php/2007/03/27/swap-space-under-rhelcentos/</link>
		<comments>http://www.wains.be/index.php/2007/03/27/swap-space-under-rhelcentos/#comments</comments>
		<pubDate>Tue, 27 Mar 2007 11:38:56 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/03/27/swap-space-under-rhelcentos/</guid>
		<description><![CDATA[Adding a 250 MB swap file to the system Create an empty 250M file : dd if=/dev/zero of=/swapfile bs=1024 count=256000 Create the swap on the newly created file : mkswap /swapfile Enable the new swap file : swapon /swapfile Edit fstab and add : /swapfile swap swap defaults 0 0 Verify if the new swap [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Adding a 250 MB swap file to the system</strong></p>
<p><strong>Create an empty 250M file :</strong><br />
<code>dd if=/dev/zero of=/swapfile bs=1024 count=256000</code></p>
<p><strong>Create the swap on the newly created file :</strong><br />
<code>mkswap /swapfile</code></p>
<p><strong>Enable the new swap file :</strong><br />
<code>swapon /swapfile</code></p>
<p><strong>Edit fstab and add :</strong><br />
<code>/swapfile swap swap defaults 0 0</code></p>
<p><strong>Verify if the new swap space is enabled : </strong><br />
<code>cat /proc/swaps<br />
free -m</code></p>
<p>A good idea is to have your swap partition as an LVM volume.. So you can always resize it if your needs are growing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/03/27/swap-space-under-rhelcentos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Managing LVM on Redhat-based systems</title>
		<link>http://www.wains.be/index.php/2007/03/26/managing-lvm-on-redhat-based-systems/</link>
		<comments>http://www.wains.be/index.php/2007/03/26/managing-lvm-on-redhat-based-systems/#comments</comments>
		<pubDate>Mon, 26 Mar 2007 12:40:13 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/03/26/managing-lvm-on-redhat-based-systems/</guid>
		<description><![CDATA[Steps : 1. Creation of Physical Volumes (container of volume groups) 2. Creation of Volume Groups (container of logical volumes) 3. Creation of Logical Volumes (&#8220;partitions&#8221;) 4. Formatting the Logical Volumes 5. (optional) Resizing Logical Volumes 1. Creation of Physical Volumes (PV) pvcreate /dev/hda4 pvdisplay It is good practice to always use &#8220;(pv&#124;vg&#124;lv)display&#8221; after creating [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Steps :</strong><br />
1. Creation of Physical Volumes (container of volume groups)<br />
2. Creation of Volume Groups (container of logical volumes)<br />
3. Creation of Logical Volumes (&#8220;partitions&#8221;)<br />
4. Formatting the Logical Volumes<br />
5. (optional) Resizing Logical Volumes</p>
<p><span id="more-227"></span></p>
<p><strong>1. Creation of Physical Volumes (PV)</strong></p>
<p><code>pvcreate /dev/hda4<br />
pvdisplay</code></p>
<p>It is good practice to always use &#8220;(pv|vg|lv)display&#8221; after creating a volume.</p>
<p>/dev/hda4 is an empty partition.. see fdisk manpages for help.</p>
<p><strong>2. Creation of Volume Groups (VG)</strong></p>
<p><code>vgcreate VolGroup00 /dev/hda4<br />
vgdisplay</code></p>
<p>We are naming the volume group &#8220;VolGroup00&#8243;, call it whatever you like.<br />
The VG will take the whole partition space here. You can specify the size by using the &#8220;-s&#8221; option.</p>
<p><strong>3. Creation of Logical Volumes (LV)</strong></p>
<p><code>lvcreate --size 500M --name LogVol00 VolGroup00<br />
lvdisplay</code></p>
<p>A 500M Logical Volume has been creating inside &#8220;VolGroup00&#8243;.</p>
<p><strong>4. Formatting the newly created Logical Volume</strong></p>
<p><code>mkfs.ext3 /dev/VolGroup00/LogVol00<br />
mount /dev/VolGroup00/LogVol00 /somedir</code></p>
<p><strong>5. (optional) Resizing a Logical Volume</strong></p>
<p><code>umount /somedir<br />
lvextend -v -L +100M /dev/VolGroup00/LogVol00<br />
e2fsck -f /dev/VolGroup00/LogVol00<br />
resize2fs /dev/VolGroup00/LogVol00<br />
mount /dev/VolGroup00/LogVol00 /somedir</code></p>
<p>We made the Logical Volume 100M bigger.<br />
Then, you need to resize the ext3 partition inside the Logical Volume.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/03/26/managing-lvm-on-redhat-based-systems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quota on RHEL/CentOS</title>
		<link>http://www.wains.be/index.php/2007/03/23/quota-on-rhelcentos/</link>
		<comments>http://www.wains.be/index.php/2007/03/23/quota-on-rhelcentos/#comments</comments>
		<pubDate>Fri, 23 Mar 2007 15:20:08 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/03/23/quota-on-rhelcentos/</guid>
		<description><![CDATA[Here are the steps to implementing quotas on a RedHat based system : We will enable quotas on /home on the /dev/hda3 partition. Create user : useradd user1 passwd user1 Edit /etc/fstab : From : /dev/hda3 /home ext3 defaults 1 2 To : /dev/hda3 /home ext3 defaults,usrquota,grpquota 1 2 Remount the disk (make sure it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Here are the steps to implementing quotas on a RedHat based system :</p>
<p>We will enable quotas on /home on the /dev/hda3 partition.</p>
<p><span id="more-224"></span></p>
<p><strong>Create user :</strong><br />
<code>useradd user1<br />
passwd user1</code></p>
<p><strong>Edit /etc/fstab :</strong><br />
From :<br />
<code>/dev/hda3 /home ext3 defaults 1 2</code><br />
To :<br />
<code>/dev/hda3 /home ext3 defaults,usrquota,grpquota 1 2</code></p>
<p><strong>Remount the disk (make sure it&#8217;s not in use) :</strong><br />
<code>mount -o remount /home</code></p>
<p><strong>Check if usrquota and grpquota are enabled :</strong><br />
<code>mount | grep /home</code></p>
<p><strong>Create quota files :</strong><br />
<code>quotacheck -cvug /home</code></p>
<p>This creates /home/aquota.user and /home/aquota.group</p>
<p><strong>Check quota :</strong><br />
<code>quotacheck -avug</code></p>
<p><strong>Enable quota for user1 :</strong><br />
<code>edquota user1</code><br />
Edit soft and hard limits (1000 = 1 MB) or inode values.</p>
<p><strong>Check the quota for user1 :</strong><br />
<code>quota user1</code></p>
<p><strong>Enable quota :</strong><br />
<code>quotaon -avug</code></p>
<p>In addition :</p>
<p>Through a cron, run everynight when the filesystem is not used :<br />
<code>quotaoff -avug &amp;&amp; quotacheck -avug &amp;&amp; quotaon --avug</code></p>
<p>Get quota stats :<br />
<code>repquota -a</code></p>
<p><strong>Warn users when their quota has been reached : </strong><br />
<code>warnquota</code></p>
<p>For some reason I had to manually edit /etc/quottab for warnquota to work</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/03/23/quota-on-rhelcentos/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>CentOS + RAID with mdadm</title>
		<link>http://www.wains.be/index.php/2007/03/12/centos-raid-with-mdadm/</link>
		<comments>http://www.wains.be/index.php/2007/03/12/centos-raid-with-mdadm/#comments</comments>
		<pubDate>Mon, 12 Mar 2007 13:03:52 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/03/12/centos-raid-with-mdadm/</guid>
		<description><![CDATA[RHCE exam requires you to be able to create a RAID array on a running system, as well as with the installer. I won&#8217;t explain here how to deal with the installer as it&#8217;s pretty easy. 1. create the partitions Using fdisk or else Set the ID type to &#8220;fd&#8221; (Linux RAID autodetect) Say we [...]]]></description>
			<content:encoded><![CDATA[<p>RHCE exam requires you to be able to create a RAID array on a running system, as well as with the installer.</p>
<p>I won&#8217;t explain here how to deal with the installer as it&#8217;s pretty easy.</p>
<p><span id="more-222"></span></p>
<p><strong>1. create the partitions</strong></p>
<p>Using fdisk or else<br />
Set the ID type to &#8220;fd&#8221; (Linux RAID autodetect)</p>
<p>Say we got here /dev/hda2 and /dev/hdb2</p>
<p><strong>2. create the RAID array with the first drive only</strong></p>
<p>mdadm &#8211;create /dev/md0 &#8211;level=1 &#8211;raid-devices=2 /dev/hda2 missing</p>
<p>That&#8217;s my way of dealing with the creation of an array. You can obviously create the array with the 2 drives now.</p>
<p><strong>3. Formatting the new array in ext3</strong></p>
<p>mke2fs -j -c /dev/md0</p>
<p>-j for ext3<br />
-c for check</p>
<p><strong>4. Adding the other drive to the array</strong></p>
<p>mdadm &#8211;add /dev/md0 /dev/hdb2</p>
<p>You should hear the drives working. They are actually synching<br />
Type : cat /proc/mdstat to see what is actually happening.</p>
<p><strong>5. Edit fstab</strong></p>
<p>Edit /etc/fstab</p>
<p>Add a line to get the array mounting when the system boots </p>
<p><code>/dev/md0 /raid ext3 defaults 0 2</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/03/12/centos-raid-with-mdadm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up http/https on CentOS</title>
		<link>http://www.wains.be/index.php/2007/03/06/setting-up-httphttps-on-centos/</link>
		<comments>http://www.wains.be/index.php/2007/03/06/setting-up-httphttps-on-centos/#comments</comments>
		<pubDate>Tue, 06 Mar 2007 15:20:27 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/03/06/setting-up-httphttps-on-centos/</guid>
		<description><![CDATA[Packages needed : httpd + deps Package needed for https : mod_ssl yum install httpd mod_ssl service httpd start chkconfig httpd on Done ! I&#8217;m not sure what they could ask about Apache at the RHCE exam.. ? Virtual domains ?]]></description>
			<content:encoded><![CDATA[<p>Packages needed : httpd + deps<br />
Package needed for https : mod_ssl</p>
<p>yum install httpd mod_ssl</p>
<p>service httpd start<br />
chkconfig httpd on</p>
<p>Done !</p>
<p>I&#8217;m not sure what they could ask about Apache at the RHCE exam.. ? Virtual domains ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/03/06/setting-up-httphttps-on-centos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up NFS + autofs under CentOS 4</title>
		<link>http://www.wains.be/index.php/2007/02/28/setting-up-nfs-under-centos-4/</link>
		<comments>http://www.wains.be/index.php/2007/02/28/setting-up-nfs-under-centos-4/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 17:26:02 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/02/28/setting-up-nfs-under-centos-4/</guid>
		<description><![CDATA[Packages needed : nfs-utils Server side Edit /etc/exports : /home *(rw,sync) Start service and make sure it&#8217;ll start at boot service nfs start chkconfig nfs on Client side Check if you can reach the server : rpcinfo -p 10.0.0.254 Manually mounting the shared folder mount -t nfs 10.0.0.254:/home /home Setting up autofs on the client [...]]]></description>
			<content:encoded><![CDATA[<p>Packages needed : nfs-utils</p>
<p><span id="more-215"></span></p>
<p><strong>Server side</strong></p>
<p>Edit /etc/exports :<br />
<code>/home *(rw,sync)</code></p>
<p>Start service and make sure it&#8217;ll start at boot<br />
<code>service nfs start<br />
chkconfig nfs on</code></p>
<p><strong>Client side</strong></p>
<p>Check if you can reach the server :<br />
<code>rpcinfo -p 10.0.0.254</code></p>
<p>Manually mounting the shared folder<br />
<code>mount -t nfs 10.0.0.254:/home /home</code></p>
<p><strong>Setting up autofs on the client side to automount the NFS share :</strong></p>
<p>Package needed : autofs</p>
<p>Let&#8217;s say we have a user &#8220;admin&#8221;</p>
<p><strong>Edit /etc/auto.master :</strong><br />
<code>/home /etc/auto.misc --timeout 60</code></p>
<p><strong>Edit /etc/auto.misc :</strong><br />
<code>admin -rw,soft,rsize=8192,wsize=8192 server:/home/admin</code></p>
<p><strong>Start the service :</strong><br />
<code>service autofs start</code></p>
<p>It should mount the NFS share.</p>
<p><strong>Check the status :</strong><br />
<code>service autofs status</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/02/28/setting-up-nfs-under-centos-4/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting up NIS under CentOS 4</title>
		<link>http://www.wains.be/index.php/2007/02/28/setting-up-nis-under-centos-4/</link>
		<comments>http://www.wains.be/index.php/2007/02/28/setting-up-nis-under-centos-4/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 15:30:12 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/02/28/setting-up-nis-under-centos-4/</guid>
		<description><![CDATA[Server : server.lab.local (10.0.0.254) Client : client1.lab.local (10.0.0.1) Server side : Packages needed : yp-tools ypbind ypserv portmap Edit /etc/yp.conf : domain lab.local server server ypserver server Following this scheme : domain ${domain} server ${host} ypserver ${host} By default /etc/ypserv.conf is ok. Edit /etc/sysconfig/network and add : NISDOMAIN=lab.local At the prompt : # domainname lab.local [...]]]></description>
			<content:encoded><![CDATA[<p>Server : server.lab.local (10.0.0.254)<br />
Client : client1.lab.local (10.0.0.1)</p>
<p><strong>Server side :</strong></p>
<p>Packages needed : yp-tools ypbind ypserv portmap</p>
<p><span id="more-214"></span></p>
<p><strong>Edit /etc/yp.conf :</strong><br />
<code>domain lab.local server server<br />
ypserver server</code></p>
<p>Following this scheme :<br />
domain ${domain} server ${host}<br />
ypserver ${host}</p>
<p><strong>By default /etc/ypserv.conf is ok.</strong></p>
<p><strong>Edit /etc/sysconfig/network and add :</strong><br />
<code>NISDOMAIN=lab.local</code></p>
<p><strong>At the prompt :</strong><br />
<code># domainname lab.local<br />
# ypdomainname lab.local</code></p>
<p><strong>Still under the prompt :</strong><br />
<code>service portmap start<br />
chkconfig portmap on</code></p>
<p><strong>Start the NIS server :</strong><br />
<code>service ypserv start</code></p>
<p><strong>Make sure it&#8217;s actually running : </strong><br />
<code># rpcinfo -u localhost ypserv</code></p>
<p>Output should look like :<br />
<code>program 100004 version 1 ready and waiting<br />
program 100004 version 2 ready and waiting</code></p>
<p>Build the NIS maps :<br />
<code>/usr/lib/yp/ypinit -m</code><br />
There you should specify the machines that will run a NIS server, when done hit ctrl + D</p>
<p><strong>Start ypbind, yppasswdd, ypxfrd :</strong><br />
<code># service ypbind start<br />
# service yppasswdd start<br />
# service ypxfrd start</code></p>
<p><strong>Make sure the required services will start at boot : </strong><br />
<code>for service in ypserv ypbind yppasswdd ypxfrd; do chkconfig $service on; done</code></p>
<p><strong>Client side :</strong></p>
<p>Packages needed : yp-tools ypbind portmap</p>
<p><strong>At the prompt :</strong><br />
<code># authconfig</code><br />
or<br />
<code># system-config-authentication</code></p>
<p>There you should select &#8220;Use NIS&#8221; then select &#8220;Next&#8221;<br />
Then fill in the required info :<br />
Domain : lab.local<br />
Server : server.lab.local</p>
<p>Click OK</p>
<p>Your client machine should be properly configured and attached to the NIS server now.<br />
Verify with :<br />
<code>client1# rpcinfo -u localhost ypbind</code></p>
<p>Then, check the NIS server map with :<br />
<code>client1# ypcat passwd</code></p>
<p>You should see the list of accounts on the NIS server.</p>
<p><strong>Make sure the needed services will start at boot on the client :</strong><br />
<code>for service in portmap ypbind; do chkconfig $service on; done</code></p>
<p><strong>Edit /etc/hosts and add :</strong><br />
<code>10.0.0.254 server.lab.local server</code><br />
This is very important, for some reason, after setting up NIS auth, when pinging &#8220;server.lab.local&#8221; it was actually pinging the localhost. (if someone has a clue as to why it does that, drop me a line. I sniffed the traffic and noticed some NIS traffic when trying to ping the server)</p>
<p><strong>Now, back to the server side !</strong></p>
<p><strong>Adding new users to the NIS server :</strong></p>
<p><code>server# useradd account<br />
server# passwd account<br />
server# cd /var/yp<br />
server# make</code></p>
<p>Make will update the NIS maps</p>
<p>More info :</p>
<p>http://cern91.tuxfamily.org/linux/indexnet.php?page=nis</p>
<p>http://bradthemad.org/tech/notes/redhat_nis_setup.php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/02/28/setting-up-nis-under-centos-4/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Creating a local CentOS mirror</title>
		<link>http://www.wains.be/index.php/2007/02/26/creating-a-local-centos-mirror/</link>
		<comments>http://www.wains.be/index.php/2007/02/26/creating-a-local-centos-mirror/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 16:46:31 +0000</pubDate>
		<dc:creator>Sébastien Wains</dc:creator>
				<category><![CDATA[RHCE]]></category>

		<guid isPermaLink="false">http://www.wains.be/index.php/2007/02/26/creating-a-local-centos-mirror/</guid>
		<description><![CDATA[For my RHCE prep, I&#8217;m setting up a small lab of 3 machines.. one machine will act as the server.. For my ease of use, I decided to build a local mirror of the CentOS repository (base and updates). I had downloaded the 4 ISO images of CentOS 4.4 overnight and burnt them. Please consider [...]]]></description>
			<content:encoded><![CDATA[<p>For my RHCE prep, I&#8217;m setting up a small lab of 3 machines.. one machine will act as the server..<br />
For my ease of use, I decided to build a local mirror of the CentOS repository (base and updates).</p>
<p>I had downloaded the 4 ISO images of CentOS 4.4 overnight and burnt them.</p>
<p>Please consider the following :<br />
I&#8217;m only building a local copy of the base and updates repo for CentOS 4.4 for the i386 architecture.</p>
<p><span id="more-212"></span></p>
<p><strong>Follow these steps :</strong></p>
<p><code>mkdir -p /var/www/html/mirror/centos/4.4/os/i386/<br />
ln -s /var/www/html/mirror/centos/4.4 /var/www/html/mirror/centos/4</code></p>
<p>Insert CD1<br />
<code>cp -a /media/cdrom/* /var/www/html/mirror/4.4/os/i386/</code><br />
When done<br />
<code>eject /dev/cdrom</code></p>
<p>Repeat the previous steps for CD2, CD3 and CD4 (say yes when asking for overwriting)</p>
<p>When done, you should make sure your base repository is up to date<br />
<code>rsync -avzH --delete eu-msync.centos.org::CentOS/4.4/os/i386/ /var/www/html/mirror/centos/4.4/os/i386/</code></p>
<p>Then, synchronize the &#8220;updates&#8221; repository, this should take a while and will download a massive amount of data (around 6.3 Gb when I built the mirror)<br />
<code>mkdir -p /var/www/html/mirror/centos/4.4/updates/i386/<br />
rsync -avzH --delete eu-msync.centos.org::CentOS/4.4/updates/i386/ /var/www/html/mirror/centos/4.4/updates/i386/</code></p>
<p><strong>Make the mirror available through NFS (no security consideration here ! quick and easy way) :</strong><br />
vi /etc/exports :<br />
<code>/var/www/html/mirror/centos/4/os/i386 *(rw,sync)</code></p>
<p>Start NFS :<br />
<code>service nfs start<br />
chkconfig nfs on</code></p>
<p>Server : server<br />
Path : /var/www/html/mirror/centos/4/os/i386/</p>
<p><strong>Making the mirror available through HTTP :</strong><br />
<code>service httpd start<br />
chkconfig httpd on</code></p>
<p>Path : http://server/mirror/centos/4/os/i386/</p>
<p><strong>Please note :<br />
If you do use the CentOS rsync service, it is implied that you are providing a mirror for public use and give the CentOS admins authority to publicise the mirror</strong></p>
<p>If you use the rsync service to build a local mirror for testing/learning purpose, please just synchronize it once. DON&#8217;T ABUSE.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wains.be/index.php/2007/02/26/creating-a-local-centos-mirror/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
