<?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>Linux Admin Zone &#187; apache</title>
	<atom:link href="http://linuxadminzone.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxadminzone.com</link>
	<description>Adding more reasons to celebrate Open Source.</description>
	<lastBuildDate>Wed, 09 May 2012 10:17:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Disable ssl ver 2 in apache for pci compliance</title>
		<link>http://linuxadminzone.com/disable-ssl-ver-2-in-apache-for-pci-compliance/</link>
		<comments>http://linuxadminzone.com/disable-ssl-ver-2-in-apache-for-pci-compliance/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 16:36:51 +0000</pubDate>
		<dc:creator>jagbir</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://linuxadminzone.com/?p=157</guid>
		<description><![CDATA[You need to disable SSL ver 2 and enable SSL ver 3 in apache for PCI compliance. Its very easy to do. Following settings will set SSL ver 3 and also disable older/unsecure cipher suite in Redhat/centos/fedora Linux server: 1. Open /etc/httpd/conf.d/ssl.conf and add or if these lines already there, edit them as per follows: [...]]]></description>
			<content:encoded><![CDATA[<p>You need to disable SSL ver 2 and enable SSL ver 3 in apache for PCI compliance. Its very easy to do. Following settings will set SSL ver 3 and also disable older/unsecure cipher suite in Redhat/centos/fedora Linux server:<br />
1. Open /etc/httpd/conf.d/ssl.conf and add or if these lines already there, edit them as per follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## Disbale SSLv2 and enable SSLv3</span>
SSLProtocol <span style="color: #660033;">-All</span> +SSLv3 +TLSv1
SSLCipherSuite HIGH:<span style="color: #000000; font-weight: bold;">!</span>SSLv2:<span style="color: #000000; font-weight: bold;">!</span>ADH:<span style="color: #000000; font-weight: bold;">!</span>aNULL:<span style="color: #000000; font-weight: bold;">!</span>eNULL:<span style="color: #000000; font-weight: bold;">!</span>NULL</pre></div></div>

<p>2. Reload httpd service to apply the new settings:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/init.d/httpd reload</span></pre></div></div>

<p>3. Verify the settings by connecting to SSL ver 3 protocol:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># openssl s_client -connect localhost:443 -ssl3</span></pre></div></div>

<p>It should connect. you can also try connecting to SSL ver 2 which should result in error. Request the PCI test again and it should not complain about Apache SSL related issues. </p>
]]></content:encoded>
			<wfw:commentRss>http://linuxadminzone.com/disable-ssl-ver-2-in-apache-for-pci-compliance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Apache url rewriting with masking</title>
		<link>http://linuxadminzone.com/apache-url-rewriting-with-masking/</link>
		<comments>http://linuxadminzone.com/apache-url-rewriting-with-masking/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 10:57:13 +0000</pubDate>
		<dc:creator>jagbir</dc:creator>
				<category><![CDATA[Web Server]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_proxy]]></category>
		<category><![CDATA[url proxy]]></category>
		<category><![CDATA[url rewrite]]></category>

		<guid isPermaLink="false">http://linuxadminzone.com/?p=125</guid>
		<description><![CDATA[I got an assignment where I&#8217;ve to move some apps from a server (due to immense load) to different server without changing URLs. Main software app should remains in first server and all other smaller apps should be moved to another server but because all apps are integrated (for seamless login etc) with each other, [...]]]></description>
			<content:encoded><![CDATA[<p>I got an assignment where I&#8217;ve to move some apps from a server (due to immense load) to different server without changing URLs. Main software app should remains in first server and all other smaller apps should be moved to another server but because all apps are integrated (for seamless login etc) with each other, URL on the browser should not change when browing the main app or any of its subordinate apps residing on different server.</p>
<p>The quick solution is to update httpd.conf in your main server to redirect traffic for certain apps to different server (or domain). Apache will work like a proxy when accessing other apps. for example, here are sample URLs:</p>
<p>Main Application: http://www.maindomain.com/<br />
Pages of main application: http://www.maindomain.com/something.html<br />
Other application 1: http://www.maindomain.com/wiki/<br />
Other application 2: http://www.maindomain.com/forums/</p>
<p>Here&#8217;s what I&#8217;ve used, open httpd.conf and add following lines in it: </p>
<blockquote><p>RewriteEngine on<br />
RewriteRule ^/wiki/(.*) http://otherdomain.com/wiki/$1 [P,L]<br />
RewriteRule ^/forums/(.*) http://otherdomain.com/forums/$1 [P,L]</p>
<p>ProxyPassReverse / http://otherdomain.com/</p></blockquote>
<p>Details:<br />
Pls make sure that mod_proxy and mod_rewrite are loaded in apache. In above lines: </p>
<p>line 1: Turns on rewrite engine provided by mod_rewrite<br />
line 2 and 3: A rewrite rule to parse the url and detect the word (wiki) in begining of it. if word is there, then rewrite url using different domains (or IP address). The last parameter [P] indicates that its a proxy request.</p>
<p>line 4: URL that needs to be masked while browsing. </p>
<p>Save file, restart/reload httpd service and check. It worked in my case but your requirement may be different, I recommend having of a look of <a href="httpd.apache.org/docs/2.0/misc/rewriteguide.html">official documentation</a> for url rewriting.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxadminzone.com/apache-url-rewriting-with-masking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix subversion/svn child exit signal segmentation fault error in Apache</title>
		<link>http://linuxadminzone.com/fix-subversion-svn-child-exit-signal-segmentation-fault-error-in-apache/</link>
		<comments>http://linuxadminzone.com/fix-subversion-svn-child-exit-signal-segmentation-fault-error-in-apache/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 17:36:22 +0000</pubDate>
		<dc:creator>jagbir</dc:creator>
				<category><![CDATA[Subversion]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://linuxadminzone.com/?p=102</guid>
		<description><![CDATA[When running subversion with apache, how good config you&#8217;d done, you may still found that your svn repos are not accessible through http:// or https:// and most probably you&#8217;ll find this error in your apache error logs: child pid 6485 exit signal Segmentation fault (11) In my CentOS 5.2 box with httpd 2.2.3 and subversion [...]]]></description>
			<content:encoded><![CDATA[<p>When running subversion with apache, how good config you&#8217;d done, you may still found that your svn repos are not accessible through http:// or https:// and most probably you&#8217;ll find this error in your apache error logs: </p>
<blockquote><p>
child pid 6485 exit signal Segmentation fault (11)
</p></blockquote>
<p>In my CentOS 5.2 box with httpd 2.2.3 and subversion 1.6.1, this error caused enough headache for me and claimed long time before I was able to find out the root cause. The problem is caused by collision of apr and apu utilities which are installed by both subversion and Apache. These packages are required to access svn via apache. The subversion-deps package contains apr and apr-util version 0.9.x,  but apache 2.2.x uses apr and apr-util 1.2.x, and subversion and apache must be using the same version of apr and apr-util, else things can result in above error. </p>
<p>To get a fix, you need to re-compile subversion and inform that it should use Apache&#8217;s apr and apr-util packs instead of it&#8217;s own. You should search for apr-1-config and apu-1-config files in your server and then supply their path while running configure. I found both in my /usr/bin/ directory.</p>
<blockquote><p>
# cd subversion-1.6.1<br />
# ./configure &#8211;with-apr=/usr/bin/apr-1-config &#8211;with-apr-util=/usr/bin/apu-1-config<br />
# make<br />
# make install
</p></blockquote>
<p>Now config your apache to access your repositories, you can find a quick howto <a href="http://linuxadminzone.com/configure-password-based-subversion-access-via-http-for-multiple-users/">here</a>. It should run fine. Please post a comment in case you still not able to access your repos using Apache.</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxadminzone.com/fix-subversion-svn-child-exit-signal-segmentation-fault-error-in-apache/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Download, install and configure perlbal to load balance web server</title>
		<link>http://linuxadminzone.com/download-install-and-configure-perlbal-to-load-balance-web-server/</link>
		<comments>http://linuxadminzone.com/download-install-and-configure-perlbal-to-load-balance-web-server/#comments</comments>
		<pubDate>Tue, 20 May 2008 10:24:58 +0000</pubDate>
		<dc:creator>jagbir</dc:creator>
				<category><![CDATA[Load Balancer]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[load balance]]></category>
		<category><![CDATA[perlbal]]></category>

		<guid isPermaLink="false">http://linuxadminzone.com/?p=12</guid>
		<description><![CDATA[Perlbal is fast and efficient web server, reverse proxy(load balancer). Here are quick steps to get started with it. I have tested perlbal-1.60 on my CentOS 5 box. There are many other possible ways to do the same and the way which worked for me, may not work for you. Step 1. Download perlbal OR [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.danga.com/perlbal/">Perlbal</a> is fast and efficient web server, reverse proxy(load balancer). Here are quick steps to get started with it. I have tested perlbal-1.60 on my CentOS 5 box. There are many other possible ways to do the same and the way which worked for me, may not work for you.</p>
<p>Step 1. <a href="http://code.google.com/p/perlbal/">Download perlbal</a> OR install it via perl cpan, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell
cpan-<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #c20cb9; font-weight: bold;">install</span> perlbal</pre></div></div>

<p>Step 2. Find out its sample config (/root/.cpan/build/Perlbal-1.60/doc/config-guide.txt) or if you downloaded and compiled it, file will be there. Put this file in /etc/perlbal as perlbal.conf.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>perlbal
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.cpan<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>Perlbal-<span style="color: #000000;">1.60</span><span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>config-guide.txt <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>perlbal<span style="color: #000000; font-weight: bold;">/</span>perlbal.conf</pre></div></div>

<p>Step 3. Update the perlbal.conf file as per your requirements.<br />
for example, we are using it as load balancer, here is sample config</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>perlbal<span style="color: #000000; font-weight: bold;">/</span>perlbal.conf
CREATE POOL my_apaches
SET nodefile = conf<span style="color: #000000; font-weight: bold;">/</span>nodelist.dat  <span style="color: #666666; font-style: italic;"># IP of backend Apache servers.</span>
&nbsp;
CREATE SERVICE balancer
SET listen          = 0.0.0.0:<span style="color: #000000;">80</span>
SET role            = reverse_proxy
SET pool            = my_apaches
SET persist_client  = on
SET persist_backend = on
SET verify_backend  = on
ENABLE balancer
&nbsp;
<span style="color: #666666; font-style: italic;"># Keep an internal management port open to reconfigure pool automatically via telnet</span>
CREATE SERVICE mgmt
SET role   = management
SET listen = 127.0.0.1:<span style="color: #000000;">60000</span>
ENABLE mgmt</pre></div></div>

<p>Step 4. Start perlbal module as daemon.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ perlbal <span style="color: #660033;">-d</span></pre></div></div>

<p>Step 5. Test by connecting through management port</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ telnel 127.0.0.1 <span style="color: #000000;">60000</span></pre></div></div>

<p>Step 6. One major concern is that the backend servers will log entries with IP address of load balancer instead of actual user&#8217;s IP. To overcome this issue, install and configure mod_rpaf for apache at backend servers. Login in backend server and install the module:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>stderr.net<span style="color: #000000; font-weight: bold;">/</span>apache<span style="color: #000000; font-weight: bold;">/</span>rpaf<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>mod_rpaf-<span style="color: #000000;">0.6</span>.tar.gz
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> xzf mod_rpaf-<span style="color: #000000;">0.6</span>.tar.gz
$ <span style="color: #7a0874; font-weight: bold;">cd</span> mod_rpaf-<span style="color: #000000;">0.6</span>
$ apxs <span style="color: #660033;">-i</span> <span style="color: #660033;">-c</span> <span style="color: #660033;">-n</span> mod_rpaf-<span style="color: #000000;">2.0</span>.so mod_rpaf-<span style="color: #000000;">2.0</span>.c
$ <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf
LoadModule rpaf_module modules<span style="color: #000000; font-weight: bold;">/</span>mod_rpaf-<span style="color: #000000;">2.0</span>.so
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 192.168.0.1  <span style="color: #666666; font-style: italic;">## replace your IP of load balancer</span>
RPAFheader X-Forwarded-For
&nbsp;
$ service httpd restart</pre></div></div>

<p><strong>Testing</strong></p>
<p>Step 1. Create a simple perl file and put it in cgi-bin directory of all backend servers.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #000000; font-weight: bold;">/</span>test.pl
<span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
print <span style="color: #ff0000;">&quot;Content-Type: text/html<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
print <span style="color: #ff0000;">&quot; Web server load balance testing &quot;</span>;
print <span style="color: #ff0000;">&quot;Web Server running fine.&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;"># Fetch IP of server</span>
my <span style="color: #007800;">$ifout</span> =<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span> eth0 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> inet<span style="color: #000000; font-weight: bold;">`</span>;
<span style="color: #007800;">$ifout</span> =~ m<span style="color: #000000; font-weight: bold;">/</span>\s+inet\saddr:<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>\d\.<span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>\s.+<span style="color: #000000; font-weight: bold;">/</span>g;
&nbsp;
print <span style="color: #ff0000;">&quot;This page is fetched from: $1 Server.&quot;</span>;</pre></div></div>

<p>Step 2. Start testing from browser and try to access the perl script from your load balancer server. Add more backends (by updating perlbal.conf) and test again. As per the load you will notice that perl script will be fetched from different back ends.</p>
<p><strong>Adding / removing backends on the fly</strong></p>
<p>Step 1. To maximum utilize the load balanced environment, there should be some technique by which backend servers can be added or removed on fly in the pool of perlbal as per the load. The topic of measuring load of backend servers and then making right decision is beyond the scope of this post. I developed some perl scripts to achieve the same in Amazon EC2[aws.amazon.com/ec2] environment, where we can create/remove servers on fly. If you are also on EC2, just post a comment or send mail to me and I will happily give scripts to you. Updating perlbal using a perl script with the help of Net::Telnet module is very easy. Here&#8217;s sample code:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">use</span> Net<span style="color: #339933;">::</span><span style="color: #006600;">Telnet</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$telnet</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> Net<span style="color: #339933;">::</span><span style="color: #006600;">Telnet</span><span style="color: #009900;">&#40;</span>Host<span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">$loadbalancerIP</span><span style="color: #339933;">,</span>Port<span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #cc66cc;">60000</span><span style="color: #339933;">,</span>Timeout<span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> Errmode<span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #ff0000;">'Die'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$telnet</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>print<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;pool my_apaches add $newserverIP&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$telnet</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>waitfor<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'/OK/i'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$telnet</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>close<span style="color: #339933;">;</span></pre></div></div>

<p>Its Done. Play with it. One of the noticed minus point (as of ver 1.60), perlbal is not so efficient/capable while handling https connections. In case you have website which doesnt require https connections, perlbal should be given preferrence.</p>
<p>An alternate to perlbal is haproxy load balancer, I&#8217;ve covered it <a href="http://linuxadminzone.com/install-and-configure-haproxy-the-software-based-loadbalancer-in-ubuntu/">here</a>, <a href="http://linuxadminzone.com/how-to-install-setup-and-config-haproxy-loadbalancer-for-content-switching/">here</a> and <a href="http://linuxadminzone.com/enable-or-fix-logging-for-haproxy-load-balancer/">here</a> as well. </p>
<p>You may also like to read:</p>
<p>* <a href="http://linuxadminzone.com/install-and-configure-haproxy-the-software-based-loadbalancer-in-ubuntu/">Install and configure haproxy load balancer</a>, lightweight and fast alternative of perlbal/apache proxy.<br />
* <a href="http://linuxadminzone.com/enable-or-fix-logging-for-haproxy-load-balancer/">Enable or fix logging for Haproxy or perlbal load balancer.</a><br />
* <a href="http://linuxadminzone.com/how-to-install-setup-and-config-haproxy-loadbalancer-for-content-switching/">Install and setup haproxy load balancer for content switching.</a><br />
* <a href="http://linuxadminzone.com/5-steps-to-secure-your-linux-server/"> 5 steps to secure your Linux Server </a><br />
* <a href="http://linuxadminzone.com/ensuring-secure-access-to-production-linux-servers/"> Ensuring secure access to production Linux Servers </a><br />
* <a href="http://linuxadminzone.com/bash-script-to-backup-essential-log-files-of-linux-server/"> Bash script to backup essential log files in Linux </a> </p>
]]></content:encoded>
			<wfw:commentRss>http://linuxadminzone.com/download-install-and-configure-perlbal-to-load-balance-web-server/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

