<?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>mikwat code &#187; linux</title>
	<atom:link href="http://code.mikwat.com/archives/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://code.mikwat.com</link>
	<description>A coder's daily explorations through PHP, Java, CSS, JavaScript, Linux, OS X, Apache, Tomcat, and everything else.</description>
	<lastBuildDate>Wed, 20 Feb 2008 22:14:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Find and Replace String in Multiple Files</title>
		<link>http://code.mikwat.com/archives/23</link>
		<comments>http://code.mikwat.com/archives/23#comments</comments>
		<pubDate>Mon, 01 Oct 2007 22:53:11 +0000</pubDate>
		<dc:creator>mikwat</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://code.mikwat.com/archives/23</guid>
		<description><![CDATA[Periodically I need to replace a string in multiple files on Linux.  I find myself looking up this command or a variant every time.
grep -rl OLDSTRING *.FILEEXTENSION &#124; xargs perl -pi~ -e 's/OLDSTRING/NEWSTRING/'
]]></description>
			<content:encoded><![CDATA[<p>Periodically I need to replace a string in multiple files on Linux.  I find myself looking up this command or a variant every time.</p>
<p><code>grep -rl OLDSTRING *.FILEEXTENSION | xargs perl -pi~ -e 's/OLDSTRING/NEWSTRING/'</code></p>
]]></content:encoded>
			<wfw:commentRss>http://code.mikwat.com/archives/23/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSL + gzip Compression with Apache and Tomcat</title>
		<link>http://code.mikwat.com/archives/21</link>
		<comments>http://code.mikwat.com/archives/21#comments</comments>
		<pubDate>Mon, 27 Aug 2007 16:28:25 +0000</pubDate>
		<dc:creator>mikwat</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://code.mikwat.com/archives/21</guid>
		<description><![CDATA[My setup is a single Fedora Core 6 server running Apache 2.2.4 (with mod_ssl and mod_proxy) and Tomcat 5.
With mod_ssl the following virtualhost is setup using an SSL certificate from GoDaddy.  Notice the SSLCertificateChainFile /etc/httpd/conf/ssl.crt/gd_intermediate_bundle.crt reference.  This intermediate certificate comes from GoDaddy and is required.  I didn&#8217;t catch this at first and [...]]]></description>
			<content:encoded><![CDATA[<p>My setup is a single Fedora Core 6 server running <a href="/archives/category/apache">Apache</a> 2.2.4 (with mod_ssl and mod_proxy) and <a href="/archives/category/tomcat">Tomcat</a> 5.</p>
<p>With <strong>mod_ssl</strong> the following virtualhost is setup using an SSL certificate from GoDaddy.  Notice the <strong>SSLCertificateChainFile /etc/httpd/conf/ssl.crt/gd_intermediate_bundle.crt</strong> reference.  This intermediate certificate comes from GoDaddy and is required.  I didn&#8217;t catch this at first and couldn&#8217;t understand what my web browser was unhappy about.  When I called GoDaddy support they told me my certificate was setup correctly and worked in all of there &#8220;off-site&#8221; test browsers.  They were no help, so I continued to dig around and finally found the answer.</p>
<p>The <strong>mod_proxy</strong> lines pass all requests to the <a href="/archives/category/tomcat">Tomcat</a> instance listening on port 9014.</p>
<p><b>/etc/httpd/conf.d/ssl.conf</b></p>
<pre>
&lt;virtualhost&gt;
DocumentRoot  /var/www/html/
ServerName    myserver.com:433</virtualhost>  SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/myserver.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/myserver.key
SSLCertificateChainFile /etc/httpd/conf/ssl.crt/gd_intermediate_bundle.crt
SetEnvIf User-Agent ".*MSIE.*"
         nokeepalive ssl-unclean-shutdown
         downgrade-1.0 force-response-1.0
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
CustomLog logs/ssl_request_log
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

ProxyPreserveHost On
ProxyPass / http://localhost:9014/
ProxyPassReverse / http://localhost:9014/
SetEnv proxy-nokeepalive 1
&lt;/virtualserver&gt;
</pre>
<p>For the <a href="/archives/category/tomcat">Tomcat</a> setup, a proxy connector is configured to listen on port 9014 and to proxy port 443 requests (SSL).  The communication between <a href="/archives/category/apache">Apache</a> and <a href="/archives/category/tomcat">Tomcat</a> is not secure, but this is not a concern since this communication is local to the server.  Finally, compression is turned on for several common mime-types.</p>
<p><b>server.xml</b></p>
<pre>
  ...
  &lt;Connector acceptCount="100" connectionTimeout="60000" disableUploadTimeout="true" port="9014" redirectPort="8944"
  scheme="https" proxyPort="443" compression="on" compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript"/&gt;
  ...
</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.mikwat.com/archives/21/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Tomcat Proxy Connector</title>
		<link>http://code.mikwat.com/archives/3</link>
		<comments>http://code.mikwat.com/archives/3#comments</comments>
		<pubDate>Sun, 01 Apr 2007 17:22:24 +0000</pubDate>
		<dc:creator>mikwat</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://code.mikwat.com/?p=3</guid>
		<description><![CDATA[I ran into some trouble configuring Apache/Tomcat on Fedora Core 6 using the Proxy AJP Module this week.  Here are my final settings and a brief description of the problem and solution.
/etc/httpd/conf.d/proxy_ajp.conf :

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
ProxyPass / http://localhost:9013/

server.xml :

&#60;Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" port="9013" redirectPort="8943" proxyName="www.myhost.com" proxyPort="80"/&#62;

After settings things up, nothing worked.  I found the [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into some trouble configuring <a href="/archives/category/apache">Apache</a>/<a href="/archives/category/tomcat">Tomcat</a> on Fedora Core 6 using the Proxy AJP Module this week.  Here are my final settings and a brief description of the problem and solution.</p>
<p>/etc/httpd/conf.d/proxy_ajp.conf :<br />
<code><br />
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so<br />
ProxyPass / http://localhost:9013/<br />
</code></p>
<p>server.xml :<br />
<code><br />
&lt;Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" port="9013" redirectPort="8943" proxyName="www.myhost.com" proxyPort="80"/&gt;<br />
</code></p>
<p>After settings things up, nothing worked.  I found the following error in the Apache logfile:<br />
<code><br />
[Fri Mar 30 02:23:34 2007] [error] (13)Permission denied: proxy: HTTP: attempt to connect to 127.0.0.1:9013 (localhost) failed<br />
[Fri Mar 30 02:23:34 2007] [error] ap_proxy_connect_backend disabling worker for (localhost)<br />
</code></p>
<p>After digging around <a href="/archives/category/google">Google</a> a bit, I finally found the following solution:</p>
<p><a href="http://uppertank.net/blog/?m=200512" onclick="pageTracker._trackPageview('/outgoing/uppertank.net/blog/?m=200512&amp;referer=');">http://uppertank.net/blog/?m=200512</a></p>
<p><code><br />
[root@clue conf]# getsebool -a<br />
allow_execmem –&gt; active<br />
allow_execmod –&gt; active<br />
allow_execstack –&gt; active<br />
allow_kerberos –&gt; inactive<br />
allow_ypbind –&gt; inactive<br />
dhcpd_disable_trans –&gt; inactive<br />
httpd_builtin_scripting –&gt; active<br />
httpd_can_network_connect –&gt; inactive<br />
httpd_disable_trans –&gt; inactive<br />
httpd_enable_cgi –&gt; active<br />
httpd_enable_homedirs –&gt; active<br />
httpd_ssi_exec –&gt; active<br />
httpd_tty_comm –&gt; inactive<br />
httpd_unified –&gt; active<br />
mysqld_disable_trans –&gt; inactive<br />
named_disable_trans –&gt; inactive<br />
named_write_master_zones –&gt; inactive<br />
nscd_disable_trans –&gt; inactive<br />
ntpd_disable_trans –&gt; inactive<br />
portmap_disable_trans –&gt; inactive<br />
postgresql_disable_trans –&gt; inactive<br />
read_default_t –&gt; active<br />
snmpd_disable_trans –&gt; inactive<br />
squid_connect_any –&gt; inactive<br />
squid_disable_trans –&gt; inactive<br />
syslogd_disable_trans –&gt; inactive<br />
use_nfs_home_dirs –&gt; inactive<br />
use_samba_home_dirs –&gt; inactive<br />
winbind_disable_trans –&gt; inactive<br />
ypbind_disable_trans –&gt; inactive<br />
[root@clue conf]# setsebool httpd_can_network_connect true<br />
[root@clue conf]# getsebool httpd_can_network_connect<br />
httpd_can_network_connect –&gt; active<br />
[root@clue conf]#<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://code.mikwat.com/archives/3/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
