<?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>Hack Admin &#187; centos</title>
	<atom:link href="http://www.hackadmin.com/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackadmin.com</link>
	<description></description>
	<lastBuildDate>Tue, 16 Mar 2010 21:31:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IP Failover For Web Cluster</title>
		<link>http://www.hackadmin.com/2010/02/22/ip-failover-for-web-cluster/</link>
		<comments>http://www.hackadmin.com/2010/02/22/ip-failover-for-web-cluster/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 00:38:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aashish]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[TCP/IP]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=258</guid>
		<description><![CDATA[keepalived provides a strong and robust health checking for LVS clusters. It nginx implements a framework of health checking on multiple layers for server failover, and VRRPv2 stack to handle director failover. How do I install and configure Keepalived for reverse proxy server such as nginx or lighttpd?]]></description>
			<content:encoded><![CDATA[<p>Article by <a href="http://www.hackadmin.com/aashish/">Aashish</a></p>
<p>keepalived provides a strong and robust health checking for LVS clusters. It nginx implements a framework of health checking on multiple layers for server failover, and VRRPv2 stack to handle director failover. How do I install and configure Keepalived for reverse proxy server such as nginx or lighttpd?</p>
<p><span id="more-258"></span><br />
If your are using a LVS director to loadbalance a server pool in a production environment, you may want to have a robust solution for healthcheck &amp; failover. This will also work with reverse proxy server such as nginx.</p>
<p>lb0 &#8211; Linux box directly connected to the Internet via eth1. This is master load balancer.<br />
lb1 &#8211; Linux box directly connected to the Internet via eth1. This is backup load balancer. This will become active if master networking failed.</p>
<p>202.54.1.1 &#8211; This ip moves between lb0 and lb1 server. It is called virtual IP address and it is managed by keepalived.<br />
eth0 is connected to LAN and all other backend software such as Apache, MySQL and so on.</p>
<p><strong>You need to install the following softwares on both lb0 and lb1:<br />
</strong><br />
keepalived for IP failover.<br />
iptables to filter traffic<br />
nginx or lighttpd revers proxy server.</p>
<p><strong>DNS settings should be as follows:</strong></p>
<p><a href="http://hackadmin.in/" target="_blank">hackadmin.in</a> &#8211; Our sample domain name.<br />
<a href="http://lb0.hackadmin.in/" target="_blank">lb0.hackadmin.in</a> &#8211; 202.54.1.11 (real ip assigned to eth1)<br />
<a href="http://lb1.hackadmin.in/" target="_blank">lb1.hackadmin.in</a> &#8211; 202.54.1.12 (real ip assigned to eth1)<br />
<a href="../" target="_blank">www.hackadmin.com</a> &#8211; 202.54.1.1 (VIP for web server) do not assign this IP to any interface.</p>
<p><strong>Install Keepalived</strong></p>
<p>Visit <a href="http://keepalived.org/" target="_blank">keepalived.org</a> to grab latest source code. You can use the wget command to download the same (you need to install keepalived on both lb0 and lb1):</p>
<p># cd /opt</p>
<p># wget <a href="http://www.keepalived.org/software/keepalived-1.1.19.tar.gz" target="_blank">http://www.keepalived.org/software/keepalived-1.1.19.tar.gz</a></p>
<p>#  tar -zxvf keepalived-1.1.19.tar.gz</p>
<p># cd keepalived-1.1.19</p>
<p><strong>Install Kernel Headers</strong></p>
<p>You need to install the following packages:</p>
<p>Kernel-headers &#8211; includes the C header files that specify the interface between the Linux kernel and userspace libraries and programs. The header files define structures and constants that are needed for building most standard programs and are also needed for rebuilding the glibc package.<br />
kernel-devel &#8211; this package provides kernel headers and makefiles sufficient to build modules against the kernel package.</p>
<p>Make sure kernel-headers and kernel-devel packages are installed. If not type the following install the same:<br />
<strong><br />
Compile keepalived</strong></p>
<p><strong>Type the following command:</strong><br />
# ./configure &#8211;with-kernel-dir=/lib/</p>
<div id=":1j0">modules/$(uname -r)/build</p>
<p>Sample outputs:</p>
<p>checking for gcc&#8230; gcc<br />
checking for C compiler default output file name&#8230; a.out<br />
checking whether the C compiler works&#8230; yes<br />
checking whether we are cross compiling&#8230; no<br />
checking for suffix of executables&#8230;<br />
checking for suffix of object files&#8230; o<br />
&#8230;<br />
&#8230;..<br />
..<br />
config.status: creating keepalived/check/Makefile<br />
config.status: creating keepalived/libipvs-2.6/Makefile</p>
<p><strong>Keepalived configuration</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Keepalived version       : 1.1.19<br />
Compiler                 : gcc<br />
Compiler flags           : -g -O2<br />
Extra Lib                : -lpopt -lssl -lcrypto<br />
Use IPVS Framework       : Yes<br />
IPVS sync daemon support : Yes<br />
Use VRRP Framework       : Yes<br />
Use Debug flags          : No</p>
<p><strong>Compile and install the same:</strong><br />
# make &amp;&amp; make install</p>
<p><strong>Create Required Softlinks</strong></p>
<p>Type the following commands to create service and run it at RHEL / CentOS run level #3 :<br />
# cd /etc/sysconfig<br />
# ln -s /usr/local/etc/sysconfig/keepalived .<br />
# cd /etc/rc3.d/<br />
# ln -s /usr/local/etc/rc.d/init.d/keepalived S100keepalived<br />
# cd /etc/init.d/<br />
# ln -s /usr/local/etc/rc.d/init.d/keepalived .<br />
<strong><br />
Configuration</strong></p>
<p>Your main configuration directory is located at /usr/local/etc/keepalived and configuration file name is keepalived.conf. First, make backup of existing configuration:<br />
# cd /usr/local/etc/keepalived<br />
# cp keepalived.conf keepalived.conf.bak<br />
Edit keepalived.conf as follows on lb0:</p>
<p>vrrp_instance VI_1 {<br />
interface eth0<br />
state MASTER<br />
virtual_router_id 51<br />
priority 101<br />
authentication {<br />
auth_type PASS<br />
auth_pass Add-Your-Password-Here<br />
}<br />
virtual_ipaddress {<br />
<a href="http://202.54.1.1/29" target="_blank">202.54.1.1/29</a> dev eth1<br />
}<br />
}</p>
<p>Edit keepalived.conf as follows on lb1 (note priority set to 100 i.e. backup load balancer):</p>
<p>vrrp_instance VI_1 {<br />
interface eth0<br />
state MASTER<br />
virtual_router_id 51<br />
priority 100<br />
authentication {<br />
auth_type PASS<br />
auth_pass Add-Your-Password-Here<br />
}<br />
virtual_ipaddress {<br />
<a href="http://202.54.1.1/29" target="_blank">202.54.1.1/29</a> dev eth1<br />
}<br />
}</p>
<p>Save and close the file. Finally start keepalived on both lb0 and lb1 as follows:<br />
# /etc/init.d/keepalived start</p>
<p>Verify: Keepalived Working Or Not</p>
<p>/var/log/messages will keep track of VIP:<br />
# tail -f /var/log/messages<br />
Sample outputs:</p>
<p>Feb 21 04:06:15 lb0 Keepalived_vrrp: Netlink reflector reports IP 202.54.1.1 added<br />
Feb 21 04:06:20 lb0 Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth1 for 202.54.1.1</p>
<p>Verify that VIP assigned to eth1:<br />
# ip addr show eth1<br />
<strong>Sample outputs:</strong></p>
<p>3: eth1:  mtu 1500 qdisc pfifo_fast qlen 10000<br />
link/ether 00:30:48:30:30:a3 brd ff:ff:ff:ff:ff:ff<br />
inet <a href="http://202.54.1.11/29" target="_blank">202.54.1.11/29</a> brd 202.54.1.254 scope global eth1<br />
inet <a href="http://202.54.1.1/29" target="_blank">202.54.1.1/29</a> scope global secondary eth1</p>
<p><strong>ping failover test</strong></p>
<p>Open UNIX / Linux / OS X desktop terminal and type the following command to ping to VIP:<br />
# ping 202.54.1.1<br />
Login to lb0 and halt the server or take down networking:<br />
# halt<br />
Within seconds VIP should move from lb0 to lb1 and you should not see any drops in ping. On lb1 you should get the following in /var/log/messages:</p>
<p>Feb 21 04:10:07 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) forcing a new MASTER election<br />
Feb 21 04:10:08 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) Transition to MASTER STATE<br />
Feb 21 04:10:09 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) Entering MASTER STATE<br />
Feb 21 04:10:09 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) setting protocol VIPs.<br />
Feb 21 04:10:09 lb1 Keepalived_healthcheckers: Netlink reflector reports IP 202.54.1.1 added<br />
Feb 21 04:10:09 lb1 Keepalived_vrrp: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth1 for 202.54.1.1</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2010/02/22/ip-failover-for-web-cluster/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>How to Recover a Lost MySQL Password</title>
		<link>http://www.hackadmin.com/2010/02/20/how-to-recover-a-lost-mysql-password/</link>
		<comments>http://www.hackadmin.com/2010/02/20/how-to-recover-a-lost-mysql-password/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 18:23:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aashish]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=256</guid>
		<description><![CDATA[This article explains the process that will allow you to recover a lost MySQL password:

Stop the MySQL server process]]></description>
			<content:encoded><![CDATA[<p>Article by <a href="http://www.hackadmin.com/aashish/">Aashish</a></p>
<p>This article explains the process that will allow you to recover a lost MySQL password:</p>
<p>Stop the MySQL server process</p>
<p>Start the MySQL (mysqld) server/daemon process with the<br />
&#8211;skip-grant-tables option so that it will not prompt for password.</p>
<p><span id="more-256"></span></p>
<p>Connect to mysql server as the root user.</p>
<p>Setup new mysql root account password.</p>
<p>Exit and restart the MySQL server.</p>
<p><strong>Example:</strong></p>
<p># service mysqld stop</p>
<p><strong>Output:</strong></p>
<p>Stopping MySQL database server: mysqld.</p>
<p>Then start MySql in safe mode</p>
<p># mysqld_safe &#8211;skip-grant-tables</p>
<p><strong>Output</strong></p>
<p>[1] 5988<br />
Starting mysqld daemon with databases from /var/lib/mysql</p>
<p>Then connect the mysql without any password</p>
<p># mysql -u root</p>
<p>( Then setup password )</p>
<p>mysql&gt; use mysql;</p>
<p>mysql&gt; update user set password=PASSWORD(&#8221;NEW-ROOT-PASSWORD&#8221;) where User=&#8217;root&#8217;;</p>
<div id=":1it">
<p>mysql&gt; flush privileges;</p>
<p>mysql&gt; quit</p>
<p>Then stop mysql</p>
<p># service mysql stop</p>
<p># service mysql start</p>
<p>Then Try your new password :</p>
<p># mysql -u root -p</p>
<p>Good Luck!</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2010/02/20/how-to-recover-a-lost-mysql-password/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Port Redirection through the iptables</title>
		<link>http://www.hackadmin.com/2010/02/19/port-redirection-through-the-iptables/</link>
		<comments>http://www.hackadmin.com/2010/02/19/port-redirection-through-the-iptables/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 03:44:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aashish]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[TCP/IP]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=254</guid>
		<description><![CDATA[How do I redirect 80 port to 8123 using iptables?

You can easily redirect incoming traffic by inserting rules into PREROUTING chain of the nat table. You can set destination port using the REDIRECT target.]]></description>
			<content:encoded><![CDATA[<p>Article by <a href="http://www.hackadmin.com/aashish/">Aashish</a></p>
<p><strong> </strong>How do I redirect 80 port to 8123 using iptables?</p>
<p>You can easily redirect incoming traffic by inserting rules into PREROUTING chain of the nat table. You can set destination port using the REDIRECT target.</p>
<p><span id="more-254"></span><br />
<strong>Syntax<br />
</strong><br />
The syntax is as follows to redirect tcp $srcPortNumber port to $dstPortNumber:</p>
<p>iptables -t nat -A PREROUTING -i eth0 -p tcp &#8211;dport $srcPortNumber -j REDIRECT &#8211;to-port $dstPortNumbe</p>
<p>The syntax is as follows to redirect udp $srcPortNumber port to $dstPortNumber:</p>
<p>iptables -t nat -A PREROUTING -i eth0 -p udp &#8211;dport $srcPortNumber -j REDIRECT &#8211;to-port $dstPortNumber</p>
<p>Replace eth0 with your actual interface name. The following syntax match for source and destination ips:</p>
<p>iptables -t nat -I PREROUTING &#8211;src $SRC_IP_MASK &#8211;dst $DST_IP -p tcp &#8211;dport $portNumber -j REDIRECT &#8211;to-ports $rediectPort</p>
<p><strong>Examples:</strong></p>
<p>In The following example redirects TCP port 25 to port 2525:</p>
<p># iptables -t nat -A PREROUTING -i eth0 -p tcp &#8211;dport 25 -j REDIRECT &#8211;to-port 2525</p>
<p>this example all incoming traffic on port 80 redirect to port 8123</p>
<p># iptables -t nat -I PREROUTING &#8211;src 0/0 &#8211;dst 192.168.1.5 -p tcp &#8211;dport 80 -j REDIRECT &#8211;to-ports 8123</p>
<p><strong>How Do I View NAT Rules?</strong></p>
<p>Type the following command:</p>
<p># iptables -t nat -L -n -v</p>
<p><strong>How Do I Save NAT Redirect Rules?</strong></p>
<p>Type the following command:</p>
<p># iptables-save</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2010/02/19/port-redirection-through-the-iptables/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
		</item>
		<item>
		<title>Apache Modules and Their Functions</title>
		<link>http://www.hackadmin.com/2010/02/18/apache-modules-and-their-functions/</link>
		<comments>http://www.hackadmin.com/2010/02/18/apache-modules-and-their-functions/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 18:04:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aashish]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=249</guid>
		<description><![CDATA[Apache is a powerful and widely-used World-Wide Web (Web) server. One of its strengths is that the modules that it is made of are customizable according to the user's requirements. Ashish Kumar discusses the benefits and the process of customization, along with a brief introduction to some useful modules.]]></description>
			<content:encoded><![CDATA[<p>Article by <a href="http://www.hackadmin.com/aashish/">Aashish</a></p>
<p><strong style="color: #333333;"><span style="font-size: medium;">Apache Performance Modules</span></strong><br style="color: #333333;" /><br style="color: #333333;" /><span style="color: #333333;">Apache is a powerful and widely-used World-Wide Web (Web) server. One of its strengths is that the modules that it is made of are customizable according to the user&#8217;s requirements. Ashish Kumar discusses the benefits and the process of customization, along with a brief introduction to some useful modules.</span><br style="color: #333333;" /><br style="color: #333333;" /></p>
<p><span id="more-249"></span><br />
<span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"> </span></p>
<h2 style="color: #333333;">List of Standard Modules</h2>
<p style="color: #333333;">This appendix (alphabetically) lists of all of the standard modules that are part of the current (version 1.3.x) Apache distribution. Table 1 the modules that are compiled-in by default and Table 2 lists the ones which are not.</p>
<table style="color: #333333;" border="1">
<tbody>
<tr>
<th>MODULE</th>
<th>FUNCTION</th>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_access</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Host based access control</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_actions</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Filetype/method-based script execution</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_alias</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Aliases and redirects</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_asis</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">The .asis file handler</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_auth</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">User authentication using text files</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_autoindex</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Automatic directory listings</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_cgi</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Invoking CGI scripts</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_dir</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Basic directory handling</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_env</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Passing of environments to CGI scripts</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_imap</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">The imagemap file handler</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_include</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Server-parsed documents</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_isapi</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Windows ISAPI extension support</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_log_config</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">User-configurable logging</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_mime</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Determining document types using file extension</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_negotiation</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Content negotiation</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_setenvif</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Set environment variables based on client information</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_status</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Server status display</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_userdir</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">User home directories</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_unique_id</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Generate unique request identifier for every request</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_usertrack</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">User tracking using Cookies</td>
</tr>
</tbody>
</table>
<p><span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"> </span></p>
<p style="color: #333333;">Table 1. Apache Standard Modules Compiled-In by Default.</p>
<table style="color: #333333;" border="1">
<tbody>
<tr>
<th>MODULE</th>
<th>FUNCTION</th>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_auth_anon</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Anonymous user authentication, FTP-style</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_auth_db</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">User authentication using Berkeley DB files</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_auth_dbm</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">User authentication using DBM files</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_cern_meta</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Support for HTTP header metafiles</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_digest</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">MD5 authentication</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_example</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Demonstrates Apache API</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_expires</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Apply Expires: headers to resources</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_headers</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Add arbitrary HTTP headers to resources</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_info</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Server configuration information</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_log_agent</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Logging of user agents</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_log_referer</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Logging of document references</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_mime_magic</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Determining document types using &#8220;magic numbers&#8221;</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_mmap_static</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Mapping files into memory for faster serving</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_proxy</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Caching proxy abilities</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_rewrite</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Powerful URI-to-filename mapping using regular expressions</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_so</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Experimental support for loading modules (DLLs on Windows) at runtime (not compiled-in the UNIX distribution)</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_speling</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Automatically correct minor typos in URLs</td>
</tr>
</tbody>
</table>
<p style="color: #333333;">Table 2. Apache Standard Modules Not Compiled-In by Default.</p>
<h2 style="color: #333333;"><a style="color: #005488;" name="126daf85273bb1e9_126dacf4e92051a1_app2"></a>Appendix II : List of Nonstandard Modules</h2>
<p style="color: #333333;">This appendix is a list of some nonstandard Apache modules. The selection is biased towards modules for programming language support and Web site administration. See Table 3.</p>
<table style="color: #333333;" border="1">
<tbody>
<tr>
<th>MODULE</th>
<th>FUNCTION</th>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">apache_ssl</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">SSL extensions for Apache</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_bandwidth</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Limit bandwidth based on number of connections</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_cint</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Embedded C/C++ interpreter module for apache</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Chili!ASP</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Active Server Pages module</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">ColdFusion Module</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Interface to the ColdFusion application server (Windows NT only)</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Cookie Authentication</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Fake Basic authentication using Cookies</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">dir_log_module</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Implements per-directory logging</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Distributed Permanence Control Apache Module</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Module designed to work with RCS and CVS to encourage the permanence of document version/editions on the Web</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">FastCGI</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Keeps CGI processes alive to avoid per-hit forks</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">GIF Counter</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Basic GIF counter</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Hotwired Mod_include</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Hotwired extensions to mod_include</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Indexer</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Configurable directory listing module</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Java Wrapper Module</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Enables execution of Java applications as CGI directly</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_allowdev</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Restricts access to filespace more efficiently</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_auth_ldap</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Apache LDAP authentication module</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_auth_mysql</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mySQL authentication module</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_auth_udp</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">External authentication using UDP</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_cgisock</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Socket implementation of the CGI</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_format</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Formats C, C++, and Java source code using HTML</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_gunzip</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">On-the-fly decompression of HTML documents</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_hosts_access</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Allows you to use the hosts.allow and hosts.deny files to configure access to Apache</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_javascript</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">JavaScript module (ECMA-262)</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_jserv</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Java servlet interface</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_neoinclude</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">NeoWebScript &#8211; Tcl scripting extension</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_perl</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Embeds Perl language interpreter and provides a Perl interface to the server API</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_ssl</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Free Apache interface to SSLeay</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_weborb</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Directly invokes CORBA-objects to handle CGI requests</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_auth_msql</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Basic authentication with the mSQL database</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">parselog</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Perl script to parse and store logs by server and date</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">PHP</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Server-side scripting language with extensive database support</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">mod_pyapache</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Embedded Python language interpreter</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">TalentSoft WebPlus (Web+)</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Web+ (WebPlus) application development tool/database middleware. Supports Linux, Apache API, mySQL, miniSQL, PostgreSQL, etc.</td>
</tr>
<tr>
<td style="margin: 0px; font-family: arial,sans-serif; color: #000000;" valign="top">WebCounter</td>
<td style="margin: 0px; font-family: arial,sans-serif;" valign="top">Page counter</td>
</tr>
</tbody>
</table>
<p><br style="color: #333333;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2010/02/18/apache-modules-and-their-functions/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>How to Create Connection Limits with Iptables</title>
		<link>http://www.hackadmin.com/2010/02/18/how-to-create-connection-limits-with-iptables/</link>
		<comments>http://www.hackadmin.com/2010/02/18/how-to-create-connection-limits-with-iptables/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 15:21:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aashish]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[TCP/IP]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=243</guid>
		<description><![CDATA[How do I restrict the number of connections used by a single IP address to my server for port 80 and 25 using iptables?

You need to use the connection limit modules which allows you to restrict the number of parallel TCP connections to a server per client IP address (or address block). This is useful to protect your server or vps box against flooding, spamming or content scraping.]]></description>
			<content:encoded><![CDATA[<p>Article by <a href="http://www.hackadmin.com/aashish/">Aashish</a><br />
<span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"><span style="font-size: medium;"><strong></strong></span></span></p>
<p>How do I restrict the number of connections used by a single IP address to my server for port 80 and 25 using iptables?</p>
<p>You need to use the connection limit modules which allows you to restrict the number of parallel TCP connections to a server per client IP address (or address block). This is useful to protect your server or vps box against flooding, spamming or content scraping.</p>
<p><span id="more-243"></span><br />
<strong>Syntax</strong><br />
The syntax is as follows:</p>
<p># /sbin/iptables -A INPUT -p tcp &#8211;syn &#8211;dport $port -m connlimit &#8211;connlimit-above N -j REJECT &#8211;reject-with tcp-reset</p>
<p>save the changes see iptables-save man page, the following is redhat and friends specific command service iptables save</p>
<p><strong>Example</strong>: Limit SSH Connections Per IP / Host</p>
<p>Only allow 3 ssh connections per client host:</p>
<p># /sbin/iptables  -A INPUT -p tcp &#8211;syn &#8211;dport 22 -m connlimit &#8211;connlimit-above 3 -j REJECT</p>
<p>save the changes see iptables-save man page, the following is redhat and friends specific command service iptables save</p>
<p><strong>Example</strong>: Limit HTTP Connections Per IP / Host</p>
<p>Only allow 20 http connections per IP (MaxClients is set to 60 in httpd.conf):</p>
<p># /sbin/iptables -A INPUT -p tcp &#8211;syn &#8211;dport 80 -m connlimit &#8211;connlimit-above 20 -j REJECT &#8211;reject-with tcp-reset<br />
save the changes see iptables-save man page, the following is redhat and friends specific command service iptables save</p>
<p><strong>Skip proxy server IP 1.2.3.4 from this kind of limitations:</strong></p>
<p># /sbin/iptables -A INPUT -p tcp &#8211;syn &#8211;dport 80 -d ! 1.2.3.4 -m connlimit-above 20 -j REJECT &#8211;reject-with tcp-reset</p>
<p>Enjoy it&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2010/02/18/how-to-create-connection-limits-with-iptables/feed/</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
		<item>
		<title>ISCSI Target ( Server )</title>
		<link>http://www.hackadmin.com/2010/02/16/iscsi-target-server/</link>
		<comments>http://www.hackadmin.com/2010/02/16/iscsi-target-server/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 16:12:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aashish]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=231</guid>
		<description><![CDATA[Article by Aashish
 


Storage resource located on an iSCSI server known as a &#8220;target&#8221;. An iSCSI target usually represents nothing but hard disk storage. As with initiators, software to provide an iSCSI target is available for most mainstream operating systems.

iSCSI initiator (client)

An initiator functions as an iSCSI client. An initiator typically serves the same purpose [...]]]></description>
			<content:encoded><![CDATA[<p>Article by <a href="http://www.hackadmin.com/aashish/">Aashish</a></p>
<p><span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"> </span></p>
<div style="text-align: center;"><strong><span style="font-size: medium;"><br />
</span></strong></div>
<p>Storage resource located on an iSCSI server known as a &#8220;target&#8221;. An iSCSI target usually represents nothing but hard disk storage. As with initiators, software to provide an iSCSI target is available for most mainstream operating systems.</p>
<p><span id="more-231"></span><br />
<strong>iSCSI initiator (client)<br />
</strong><br />
An initiator functions as an iSCSI client. An initiator typically serves the same purpose to a computer as a SCSI bus adapter would, except that instead of physically cabling SCSI devices (like hard drives and tape changers), an iSCSI initiator sends SCSI commands over an IP network.</p>
<p><strong>Debian / Ubuntu Linux Install tgt<br />
</strong><br />
Type the following command to install Linux target framework user-space tools:</p>
<p>$ sudo apt-get install tgt</p>
<p>CentOS / RHEL / Red Hat Linux Install tgt</p>
<p>RHEL 5.2 and older version do not have tgt tools. However, RHEL 5.3 (preview version) comes with tgt tools.</p>
<p>tgtadm &#8211; Linux SCSI Target Administration Utility</p>
<p>tgtadm is used to monitor and modify everything about Linux SCSI target software: targets, volumes, etc. This tool allows a system to serve block-level SCSI storage to other systems that have a SCSI initiator. This capability is being initially deployed as a Linux iSCSI target, serving storage over a network to any iSCSI initiator.</p>
<p>Start tgtd</p>
<p>To start the tgtd, enter:</p>
<p># /usr/sbin/tgtd</p>
<p>Under RHEL 5.3 to start the tgtd service, enter:</p>
<p># /etc/init.d/tgtd start</p>
<p><strong>Define an iscsi target name<br />
</strong><br />
The following example creates a target with id 1 (the iqn is 19 iqn.2001-04.com.example:storage.disk2.amiens.sys1.xyz) and adds a 20 logical unit (backed by /dev/hdc1)with lun 1.</p>
<p># tgtadm &#8211;lld iscsi &#8211;op new &#8211;mode target &#8211;tid 1 -T iqn.2001-04.com.example:storage.disk2.amiens.sys1.xyz<br />
To view the current configuration, enter:</p>
<p># tgtadm &#8211;lld iscsi &#8211;op show &#8211;mode target<br />
<strong><br />
Sample output:</strong></p>
<p>Target 1: iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz</p>
<p>System information:</p>
<p>Driver: iscsi</p>
<p>Status: running</p>
<p>I_T nexus information:</p>
<p>LUN information:</p>
<p>LUN: 0</p>
<p>Type: controller</p>
<p>SCSI ID: deadbeaf1:0</p>
<p>SCSI SN: beaf10</p>
<p>Size: 0</p>
<p>Online: No</p>
<p>Poweron/Reset: Yes</p>
<p>Removable media: No</p>
<p>Backing store: No backing store</p>
<p>Account information:</p>
<p>ACL information:</p>
<p>Add a logical unit to the target (/dev/sdb1):</p>
<p># tgtadm &#8211;lld iscsi &#8211;op new &#8211;mode logicalunit &#8211;tid 1 &#8211;lun 1 -b /dev/sdb1</p>
<p><strong>Note:-</strong><span> </span>about home computer / test system</p>
<p>Most production boxes will only use iSCSI root with real iSCSI devices, but for testing purposes it can be quite useful to set up an iSCSI target on your image server. This is useful for testing and learning iSCSI target and iSCSI initiator at home, simply use filesystem for testing purpose. Use dd command to create diskbased filesystem:</p>
<p># dd if=/dev/zero of=/fs.iscsi.disk bs=1M count=512</p>
<p>Add /fs.iscsi.disk as a logical unit to the target:</p>
<p># tgtadm &#8211;lld iscsi &#8211;op new &#8211;mode logicalunit &#8211;tid 1 &#8211;lun 1 -b /fs.iscsi.disk</p>
<p>Now, you should able to view details:</p>
<p># tgtadm &#8211;lld iscsi &#8211;op show &#8211;mode target</p>
<p><strong>Sample output:<br />
</strong><br />
Target 1: iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz</p>
<p>System information:</p>
<p>Driver: iscsi</p>
<p>Status: running</p>
<p>I_T nexus information:</p>
<p>LUN information:</p>
<p>LUN: 0</p>
<p>Type: controller</p>
<p>SCSI ID: deadbeaf1:0</p>
<p>SCSI SN: beaf10</p>
<p>Size: 0</p>
<p>Online: No</p>
<p>Poweron/Reset: Yes</p>
<p>Removable media: No</p>
<p>Backing store: No backing store</p>
<p>LUN: 1</p>
<p>Type: disk</p>
<p>SCSI ID: deadbeaf1:1</p>
<p>SCSI SN: beaf11</p>
<p>Size: 512M</p>
<p>Online: Yes</p>
<p>Poweron/Reset: Yes</p>
<p>Removable media: No</p>
<p>Backing store: /fs.iscsi.disk</p>
<p>Account information:</p>
<p>ACL information:</p>
<p>Accept iSCSI Target</p>
<p>To enable the target to accept any initiators, enter:</p>
<p># tgtadm &#8211;lld iscsi &#8211;op bind &#8211;mode target &#8211;tid 1 -I ALL</p>
<p>This should open network port # 3260:</p>
<p># netstat -tulpn | grep 3260</p>
<p><strong>Sample output:<br />
</strong><br />
tcp 0 0<span> </span><a style="color: #005488;" href="http://0.0.0.0:3260/" target="_blank">0.0.0.0:3260</a><span> </span>0.0.0.0:* LISTEN 27328/tgtd<br />
tcp6 0 0 :::3260 :::* LISTEN 27328/tgtd</p>
<p>And you are done. Your system is configured as iSCSI Target. Remote client computer can access this computers hard disk over network. Your can use cluster aware filesystem to setup real shared storage for small business. Open TCP port 3260 in your firewall, if required.</p>
<p><strong>For Client<br />
</strong>Install Required Package</p>
<p>iscsi-initiator-utils RPM package &#8211; The iscsi package provides the server daemon for the iSCSI protocol, as well as the utility programs used to manage it. iSCSI is a protocol for distributed disk access using SCSI commands sent over Internet Protocol networks. This package is available under Redhat Enterprise Linux / CentOS / Fedora Linux and can be installed using yum command:</p>
<p># yum install iscsi-initiator-utils</p>
<p>A note about Debian / Ubuntu Linux</p>
<p>If you are using Debian / Ubuntu Linux install open-iscsi package, enter:</p>
<p>$ sudo apt-get install open-iscsi</p>
<p>iSCSI Configuration</p>
<p>There are three steps needed to set up a system to use iSCSI storage:</p>
<p>1. iSCSI startup using the init script or manual startup. You need to edit and configure iSCSI</p>
<p>via /etc/iscsi/iscsid.conf file</p>
<p>2. Discover targets.</p>
<p>3. Automate target logins for future system reboots.</p>
<p>4. You also need to obtain iSCSI username, password and storage server IP address (target host)</p>
<p><strong>Step # 1: Configure iSCSI</strong></p>
<p>Open /etc/iscsi/iscsid.conf with vi text editor:</p>
<p># vi /etc/iscsi/iscsid.conf</p>
<p>Setup username and password:</p>
<p>node.session.auth.username = My_ISCSI_USR_NAME</p>
<p>node.session.auth.password = MyPassword</p>
<p>discovery.sendtargets.auth.username = My_ISCSI_USR_NAME</p>
<p>discovery.sendtargets.auth.password = MyPassword</p>
<p>Where,</p>
<p>* node.session.* is used to set a CHAP username and password for initiator authentication by the target(s).<br />
* discovery.sendtargets.* is used to set a discovery session CHAP username and password for the initiator authentication by the target(s)</p>
<p>You may also need to tweak and set other options. Refer to man page for more information. Now start the iscsi service:</p>
<p># /etc/init.d/iscsi start</p>
<p><strong>Step # 2: Discover targets</strong><br />
Now use iscsiadm command, which is a command-line tool allowing discovery and login to iSCSI targets, as well as access and management of the open-iscsi database. If your storage server IP address is 192.168.1.5, enter:</p>
<p># iscsiadm -m discovery -t sendtargets -p 192.168.1.5</p>
<p># /etc/init.d/iscsi restart</p>
<p>Now there should be a block device under /dev directory. To obtain new device name, type:</p>
<p># fdisk -l</p>
<p>or</p>
<p># tail -f /var/log/messages</p>
<p><strong>Output:<br />
</strong>Oct 10 12:42:20 ora9is2 kernel: Vendor: EQLOGIC Model: 100E-00 Rev: 3.2<br />
Oct 10 12:42:20 ora9is2 kernel: Type: Direct-Access ANSI SCSI revision: 05<br />
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: 41963520 512-byte hdwr sectors (21485 MB)<br />
Oct 10 12:42:20 ora9is2 kernel: sdd: Write Protect is off<br />
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: drive cache: write through<br />
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: 41963520 512-byte hdwr sectors (21485 MB)<br />
Oct 10 12:42:20 ora9is2 kernel: sdd: Write Protect is off<br />
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: drive cache: write through<br />
Oct 10 12:42:20 ora9is2 kernel: sdd: unknown partition table<br />
Oct 10 12:42:20 ora9is2 kernel: sd 3:0:0:0: Attached scsi disk sdd<br />
Oct 10 12:42:20 ora9is2 kernel: sd 3:0:0:0: Attached scsi generic sg3 type 0<br />
Oct 10 12:42:20 ora9is2 kernel: rtc: lost some interrupts at 2048Hz.<br />
Oct 10 12:42:20 ora9is2 iscsid: connection0:0 is operational now<br />
/dev/sdd is my new block device.</p>
<p><strong>Step # 3: Format and Mount iSCSI Volume<br />
</strong><br />
You can now partition and create a filesystem on the target using usual fdisk and mkfs.ext3 commands:</p>
<p># fdisk /dev/sdd</p>
<p># mke2fs -j -m 0 -O dir_index /dev/sdd1</p>
<p><strong>OR<br />
</strong><br />
# mkfs.ext3 /dev/sdd1</p>
<p>Tip: If your volume is large size like 1TB, run mkfs.ext3 in background using nohup:</p>
<p># nohup mkfs.ext3 /dev/sdd1 &amp;</p>
<p>Mount new partition:</p>
<p># mkdir /mnt/iscsi</p>
<p># mount /dev/sdd1 /mnt/iscsi</p>
<p><strong>Step #4: Mount iSCSI drive automatically at boot time<br />
</strong><br />
First make sure iscsi service turned on at boot time:</p>
<p># chkconfig iscsi on</p>
<p>Open /etc/fstab file and append config directive:</p>
<p>/dev/sdd1 /mnt/iscsi ext3 _netdev 0 0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2010/02/16/iscsi-target-server/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>How To Set Red hat / CentOS Linux Remote Backup / Snapshot Server</title>
		<link>http://www.hackadmin.com/2010/02/15/how-to-set-red-hat-centos-linux-remote-backup-snapshot-server/</link>
		<comments>http://www.hackadmin.com/2010/02/15/how-to-set-red-hat-centos-linux-remote-backup-snapshot-server/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 18:29:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aashish]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[rsnapshot]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=224</guid>
		<description><![CDATA[Article by Aashish
How To Set Red hat / CentOS Linux Remote Backup / Snapshot Server

Q. I am using an HP RAID 6 server running RHEL 5.x. I&#8217;d like this box to act as a backup server for my other Red Hat DNS and Web server. The server must keep backup in hourly, daily and monthly [...]]]></description>
			<content:encoded><![CDATA[<p>Article by <a href="http://www.hackadmin.com/aashish/">Aashish</a></p>
<p><strong>How To Set Red hat / CentOS Linux Remote Backup / Snapshot Server<br />
</strong><br />
<strong>Q.</strong> I am using an HP RAID 6 server running RHEL 5.x. I&#8217;d like this box to act as a backup server for my other Red Hat DNS and Web server. The server must keep backup in hourly, daily and monthly format. How do I configure my Red Hat / CentOS Linux server as remote backup or snapshot server? </p>
<p><span id="more-224"></span><br />
<strong>A.</strong> rsnapshot is easy, reliable and a good disaster recovery backup solution. It is a remote backup program that uses rsync to take backup snapshots of your filesystems. It uses hard links to save space on disk and offers following features:</p>
<p><strong>• Filesystem snapshot</strong> &#8211; for local or remote systems.</p>
<p><strong>• Database backup</strong> &#8211; MySQL backup</p>
<p><strong>• Secure</strong> &#8211; Traffic between remote backup server is always encrypted using openssh</p>
<p><strong>• Full backup</strong> &#8211; plus incremental</p>
<p><strong>• Easy to restore</strong> &#8211; Files can restored by the users who own them, without the root user getting involved.</p>
<p><strong>• Automated backup</strong> &#8211; Runs in background via cron.</p>
<p><strong>• Bandwidth friendly</strong> &#8211; rsync used to save bandwidth </p>
<p><strong>Sample setup</strong></p>
<p>• snapshot.example.com &#8211; HP box with RAID 6 configured with Red Hat / CentOS Linux ac as backup server for other clients.</p>
<p>• DNS ns1.example.com &#8211; Red Hat server act as primary name server.</p>
<p>• DNS ns2.example.com &#8211; Red Hat server act as secondary name server.</p>
<p>• www.example.com &#8211; Red Hat running Apache web server.</p>
<p>• mysql.example.com &#8211; Red Hat mysql server.</p>
<p><strong>Install rsnapshot</strong></p>
<p>Login to snapshot.example.com. Download rsnapshot rpm file, enter: WARNING! These examples only works on Red hat / CentOS / Suse / RHEL / Fedora Linux. See Debian / Ubuntu Linux backup server instructions here.</p>
<p># cd /tmp</p>
<p># wget http://www.rsnapshot.org/downloads/rsnapshot-1.3.0-1.noarch.rpm</p>
<p># wget http://www.rsnapshot.org/downloads/rsnapshot-1.3.0-1.noarch.rpm.md5</p>
<p>Verify rpm file for integrity, enter</p>
<p># md5sum -c rsnapshot-1.3.0-1.noarch.rpm.md5</p>
<p><strong>Sample output:</strong><br />
rsnapshot-1.3.0-1.noarch.rpm: OK<br />
Install rsnapshot, enter:</p>
<p># rpm -ivh rsnapshot-1.3.0-1.noarch.rpm<br />
Sample output:<br />
Preparing&#8230; ########################################### [100%]<br />
1:rsnapshot ########################################### [100%]</p>
<p><strong>Configure rsnapshot</strong></p>
<p>You need to perform following steps</p>
<p>Step # 1: Configure passwordless login</p>
<p>To perform remote backup you need to setup passwordless login using openssh. Create ssh rsa key and upload them to all servers using scp (note you are overwriting ~/ssh/authorized_keys2 files).You need to type following commands on snapshot.example.com server:</p>
<p># ssh-keygen -t rsa</p>
<p># scp .ssh/id_rsa.pub root@ns1.example.com:.ssh/authorized_keys2</p>
<p># scp .ssh/id_rsa.pub root@ns2.example.com:.ssh/authorized_keys2</p>
<p># scp .ssh/id_rsa.pub root@www.example.com:.ssh/authorized_keys2</p>
<p># scp .ssh/id_rsa.pub root@mysql.example.com:.ssh/authorized_keys2</p>
<p>Step # 2: Configure rsnapshot</p>
<p>The default configuration file is located at /etc/rsnapshot.conf. Open configuration file using a text editor, enter:</p>
<p># vi /etc/rsnapshot.conf</p>
<p><strong>Configuration rules</strong></p>
<p>You must follow two configuration rules:</p>
<p>• rsnapshot config file requires tabs between elements.</p>
<p>• All directories require a trailing slash. For example, /home/ is correct way to specify directory, but /home is wrong.</p>
<p>First, specify root directory to store all snapshots such as /snapshots/ or /dynvol/snapshot/ as per your RAID setup, enter:</p>
<p>snapshot_root /raiddisk/snapshots/</p>
<p>You must separate snapshot_root and /raiddisk/snapshots/ by a [tab] key i.e. type snapshot_root hit [tab] key once and type /raiddisk/snapshots/.</p>
<p><strong>Define snapshot intervals</strong></p>
<p>You need to specify backup intervals i.e. specify hourly, daily, weekly and monthly intervals:</p>
<p>interval hourly 6</p>
<p>interval daily 7</p>
<p>interval weekly 4</p>
<p>interval monthly 3</p>
<p>The line &#8220;interval hourly 6&#8243; means 6 hourly backups a day. Feel free to adapt configuration as per your backup requirements and snapshot frequency.</p>
<p><strong>Remote backup directories</strong></p>
<p>To backup /var/named/ and /etc/ directory from ns1.example.com and ns2.example.com, enter:</p>
<p>backup root@ns1.example.com:/etc/ ns1.example.com/</p>
<p>backup root@ns1.example.com:/var/named/ ns1.example.com/</p>
<p>backup root@ns2.example.com:/etc/ ns2.example.com/</p>
<p>backup root@ns2.example.com:/var/named/ ns2.example.com/</p>
<p>To backup /var/www/, /var/log/httpd/ and /etc/ directory from www.example.com, enter</p>
<p>backup root@www.example.com:/var/www/ www.example.com/</p>
<p>backup root@www.example.com:/etc/ www.example.com/</p>
<p>backup root@www.example.com:/var/log/httpd/ www.example.com/</p>
<p>To backup mysql database files stored at /var/lib/mysql/, enter:</p>
<p>backup root@mysql.example.com:/var/lib/mysql/ mysql.example.com/dbdump/Save and close the file. To test your configuration, enter:</p>
<p># rsnapshot configtest</p>
<p>Sample output:</p>
<p>Syntax OK</p>
<p><strong>Schedule cron job</strong></p>
<p>Create /etc/cron.d/rsnapshot cron file. Following values used correspond to the examples in<br />
#vim /etc/rsnapshot.conf.</p>
<p>0 */4 * * * /usr/bin/rsnapshot hourly</p>
<p>50 23 * * * /usr/bin/rsnapshot daily</p>
<p>40 23 * * 6 /usr/bin/rsnapshot weekly</p>
<p>30 23 1 * * /usr/bin/rsnapshot monthly</p>
<p>Save and close the file. Now rsnapshot will work as follows to backup files from remote boxes:</p>
<p>1. 6 hourly backups a day (once every 4 hours, at 0,4,8,12,16,20)</p>
<p>2. 1 daily backup every day, at 11:50PM</p>
<p>3. 1 weekly backup every week, at 11:40PM, on Saturdays (6th day of week)</p>
<p>4. 1 monthly backup every month, at 11:30PM on the 1st day of the month<br />
<strong><br />
How do I see backups?</strong></p>
<p>To see backup change directory to</p>
<p># cd /raiddisk/snapshots/</p>
<p># ls -l</p>
<p>Sample output:<br />
drwxr-xr-x 4 root root 4096 2008-07-04 06:04 daily.0<br />
drwxr-xr-x 4 root root 4096 2008-07-03 06:04 daily.1<br />
drwxr-xr-x 4 root root 4096 2008-07-02 06:03 daily.2<br />
drwxr-xr-x 4 root root 4096 2008-07-01 06:02 daily.3<br />
drwxr-xr-x 4 root root 4096 2008-06-30 06:02 daily.4<br />
drwxr-xr-x 4 root root 4096 2008-06-29 06:05 daily.5<br />
drwxr-xr-x 4 root root 4096 2008-06-28 06:04 daily.6<br />
drwxr-xr-x 4 root root 4096 2008-07-05 18:05 hourly.0<br />
drwxr-xr-x 4 root root 4096 2008-07-05 15:06 hourly.1<br />
drwxr-xr-x 4 root root 4096 2008-07-05 12:06 hourly.2<br />
drwxr-xr-x 4 root root 4096 2008-07-05 09:05 hourly.3<br />
drwxr-xr-x 4 root root 4096 2008-07-05 06:04 hourly.4<br />
drwxr-xr-x 4 root root 4096 2008-07-05 03:04 hourly.5<br />
drwxr-xr-x 4 root root 4096 2008-07-05 00:05 hourly.6<br />
drwxr-xr-x 4 root root 4096 2008-07-04 21:05 hourly.7<br />
drwxr-xr-x 4 root root 4096 2008-06-22 06:04 weekly.0<br />
drwxr-xr-x 4 root root 4096 2008-06-15 09:05 weekly.1<br />
drwxr-xr-x 4 root root 4096 2008-06-08 06:04 weekly.2</p>
<p><strong>How do I restore backup?</strong></p>
<p>Let us say you would like to restore a backup for www.example.com. Type the command as follows (select day and date from ls -l output):</p>
<p># cd /raiddisk/snapshots/<br />
# ls -l</p>
<p># cd hourly.0/www.example.com/</p>
<p># scp -r var/www/ root@www.example.com:/var/www/</p>
<p># scp -r etc/httpd/ root@www.example.com:/etc/httpd/</p>
<p><strong>How do I exclude files from backup?</strong></p>
<p>To exclude files from backup, open rsnapshot.conf file and add following line:</p>
<p>exclude_file /etc/rsnapshot.exclude.www.example.com</p>
<p>Create /etc/rsnapshot.exclude.www.example.com as follows:</p>
<p>/var/www/tmp/</p>
<p>/var/www/*.cache</p>
<p>That&#8217;s It!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2010/02/15/how-to-set-red-hat-centos-linux-remote-backup-snapshot-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Static Routes in CentOS 5.2</title>
		<link>http://www.hackadmin.com/2008/11/04/static-routes-in-centos-52/</link>
		<comments>http://www.hackadmin.com/2008/11/04/static-routes-in-centos-52/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 20:29:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 5.2]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[route-etho]]></category>
		<category><![CDATA[static route]]></category>
		<category><![CDATA[static routes]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/2008/11/04/static-routes-in-centos-52/</guid>
		<description><![CDATA[To add a static route in CentOS 5.2 create a file specific to the interface in /etc/sysconfig/network-scripts.
For example, if you are adding routes where the route&#8217;s gateway will be on the network in use on eth0, you will create the following file:  route-eth0
In the file add the following parameters:
GATEWAY0=192.168.195.2
NETMASK0=255.255.255.0
ADDRESS0=10.0.0.0
For each subsequent route statement increment [...]]]></description>
			<content:encoded><![CDATA[<p>To add a static route in CentOS 5.2 create a file specific to the interface in /etc/sysconfig/network-scripts.</p>
<p><span id="more-15"></span>For example, if you are adding routes where the route&#8217;s gateway will be on the network in use on eth0, you will create the following file:  route-eth0</p>
<p>In the file add the following parameters:</p>
<p><code>GATEWAY0=192.168.195.2<br />
NETMASK0=255.255.255.0<br />
ADDRESS0=10.0.0.0</code></p>
<p>For each subsequent route statement increment the number that is appended to each parameter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2008/11/04/static-routes-in-centos-52/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Net-SNMP Startup Issues and package updates.</title>
		<link>http://www.hackadmin.com/2008/04/16/net-snmp-startup-issues-and-package-updates/</link>
		<comments>http://www.hackadmin.com/2008/04/16/net-snmp-startup-issues-and-package-updates/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 22:57:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Repair]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[centos 4.5]]></category>
		<category><![CDATA[error message]]></category>
		<category><![CDATA[net-snmp]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/2008/04/16/net-snmp-startup-issues-and-package-updates/</guid>
		<description><![CDATA[I ran into an issue the other day installing net-snmp-utils via yum on a CentOS 4.5  box and it just happened to me again.  This time however, I didn&#8217;t install the net-snmp-utils, it was from the original load of net-snmp.  Basically, I typically just do a:
yum -y install net-snmp
Then copy over my [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an issue the other day installing net-snmp-utils via yum on a CentOS 4.5  box and it just happened to me again.  This time however, I didn&#8217;t install the net-snmp-utils, it was from the original load of net-snmp.  Basically, I typically just do a:</p>
<p>yum -y install net-snmp</p>
<p>Then copy over my default snmpd.conf file and fire it up.</p>
<p>In these instances however, snmpd either refused to start or gave the following error in /var/log/messages:</p>
<p><span id="more-6"></span><code>Apr 16 18:14:35 msx-db01 kernel: audit(1208384075.250:6): avc:  denied  { read } for  pid=27712 comm="snmpd" name="snmpd.conf" dev=sda3 ino=7241736 scontext=root:system_r:snmpd_t tcontext=root:object_r:tmp_t tclass=file<br />
Apr 16 18:14:35 msx-db01 kernel: audit(1208384075.265:7): avc:  denied  { read } for  pid=27712 comm="snmpd" name="snmpd.conf" dev=sda3 ino=7241736 scontext=root:system_r:snmpd_t tcontext=root:object_r:tmp_t tclass=file<br />
Apr 16 18:14:35 msx-db01 snmpd[27712]: Warning: no access control information configured.   It's unlikely this agent can serve any useful purpose in this state.   Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent.<br />
Apr 16 18:14:35 msx-db01 snmpd[27712]: NET-SNMP version 5.1.2<br />
</code></p>
<p>I tried to use snmpconf as suggested even though I knew my snmpd.conf file was fine.  snmpconf was not on the system so I didn&#8217;t waste any time trying to find out how to get it.</p>
<p>So the fix is to install the net-snmp-libs package, not sure what it updates but it works.</p>
<p><code>yum -y install net-snmp-libs</code></p>
<p>The catch after that is (at least in all 3 of my situations) the following error on the yum install:</p>
<p><code>Transaction Check Error:   file /usr/share/man/man8/ext2online.8.gz from install of e2fsprogs-1.35-12.11.el4_6.1 conflicts with file from package e2fsprogs-1.35-12.4.EL4</code></p>
<p>So, back to the hack admin package manager of choice *yum* :</p>
<p><code>yum update e2fsprogs</code></p>
<p>Once it&#8217;s updated, the net-snmp-libs goes in as expected.</p>
<p>So what&#8217;s the deal with all this?  I dunno, what the hell do utilities for ext2 have to do with my ability to run snmp monitoring?  Who gives a shit and if you know, you&#8217;re probably on the wrong site.  At any rate, my monitoring works and I&#8217;ll leave the rest to the server fairies.</p>
<p>Moral of the story: If your shit works, do you really need to understand it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2008/04/16/net-snmp-startup-issues-and-package-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

