<?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>Tequila Fish &#187; Apache</title>
	<atom:link href="http://www.tequilafish.com/category/tech/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tequilafish.com</link>
	<description>Ran-dumb ramblings of me...</description>
	<lastBuildDate>Wed, 28 Jul 2010 02:58:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Apache: Address already in use: make_sock: could not bind to address 0.0.0.0:80</title>
		<link>http://www.tequilafish.com/2009/03/08/apache-address-already-in-use-make_sock-could-not-bind-to-address-000080/</link>
		<comments>http://www.tequilafish.com/2009/03/08/apache-address-already-in-use-make_sock-could-not-bind-to-address-000080/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 21:19:53 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[lsof]]></category>
		<category><![CDATA[make_sock]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/?p=235</guid>
		<description><![CDATA[Every now and then my Apache webserver becomes un-responsive, and attempting to restart it with apachectl graceful gives me the following error: Address already in use: make_sock: could not bind to address 0.0.0.0:80 This error means that there is already a process running that is using port 80, so Apache is unable to start up [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2009%2F03%2F08%2Fapache-address-already-in-use-make_sock-could-not-bind-to-address-000080%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2009%2F03%2F08%2Fapache-address-already-in-use-make_sock-could-not-bind-to-address-000080%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Every now and then my Apache webserver becomes un-responsive, and attempting to restart it with <strong><tt>apachectl graceful</tt></strong> gives me the following error:</p>
<p><code>Address already in use: make_sock: could not bind to address 0.0.0.0:80</code></p>
<p>This error means that there is already a process running that is using port 80, so Apache is unable to start up and use it.  To solve this problem, we need to figure out what process is currently using the port in question and kill it so that Apache can start.  Use <strong><tt>lsof</tt></strong> to find out what is using our port:</p>
<p><code>shell&gt; lsof -i :80<br />
COMMAND   PID   USER   FD   TYPE     DEVICE SIZE NODE NAME<br />
httpd   23506 apache    3u  IPv6 1206927465       TCP *:http (LISTEN)</code></p>
<p>You can see from the output of lsof that an httpd process already exists under PID 23506.  This is simple enough to get rid of:</p>
<p><code>shell&gt; kill -9 23506<br />
shell&gt; lsof -i :80<br />
shell&gt; apachectl start</code></p>
<p>I run <strong><tt>lsof</tt></strong> again after issuing the <strong><tt>kill</tt></strong> command to make sure that whatever was using port 80 is gone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2009/03/08/apache-address-already-in-use-make_sock-could-not-bind-to-address-000080/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP &amp; ionCube Loader: &#8216;The Loader must appear as the first entry in the php.ini file in Unknown on line 0&#8242;</title>
		<link>http://www.tequilafish.com/2008/02/18/php-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0/</link>
		<comments>http://www.tequilafish.com/2008/02/18/php-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 23:00:29 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[ioncube]]></category>
		<category><![CDATA[loader]]></category>
		<category><![CDATA[optimizer]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2008/02/18/php-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0/</guid>
		<description><![CDATA[I received the following in my Apache error_log when attempting to load the ionCube loader in my php.ini file: PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0 This is because ionCube must be loaded before any of the Zend extensions are. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2008%2F02%2F18%2Fphp-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2008%2F02%2F18%2Fphp-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I received the following in my Apache error_log when attempting to load the ionCube loader in my php.ini file:</p>
<p><code>PHP Fatal error:  [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0</code></p>
<p>This is because ionCube must be loaded before any of the Zend extensions are.  So if you have the Zend extension/optimizer loaded, your php.ini should look like this to get ionCube to work:</p>
<p><code>[Zend]<br />
zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.1.so<br />
zen_extension_ts=/usr/local/ioncube/ioncube_loader_lin_5.1_ts.so<br />
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0<br />
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0<br />
zend_optimizer.version=3.3.0a<br />
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so<br />
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so</code></p>
<p>----------------<br />
Now playing: <a href="http://www.foxytunes.com/artist/tommy+mccook+%26+the+aggrovators/track/a+loving+melody">Tommy McCook &#038; The Aggrovators - A Loving Melody</a><br />
via <a href="http://www.foxytunes.com/signatunes/">FoxyTunes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2008/02/18/php-ioncube-loader-the-loader-must-appear-as-the-first-entry-in-the-phpini-file-in-unknown-on-line-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_rewrite &amp; PHP: How to match urlencoded plus sign (+ = %2B)</title>
		<link>http://www.tequilafish.com/2007/12/06/mod_rewrite-php-how-to-match-urlencoded-plus-sign/</link>
		<comments>http://www.tequilafish.com/2007/12/06/mod_rewrite-php-how-to-match-urlencoded-plus-sign/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 05:37:21 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[%2b]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[plus]]></category>
		<category><![CDATA[urlencode]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2007/12/06/mod_rewrite-php-how-to-match-urlencoded-plus-sign-%2b/</guid>
		<description><![CDATA[I ran into trouble when trying to pass a urlencode()'ed plus sign into a web address being processed by mod_rewrite. $url = 'http://www.server.com/browsealpha/name+has+plus+in+it/'; $url = urlencode($url); // http://www.server.com/browsealpha/name%2Bhas%2Bplus%2Bin%2Bit/ This $url variable gets echo()'d as a link in a page, so once it's clicked and loaded in the browser, I then needed mod_rewrite to translate that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F12%2F06%2Fmod_rewrite-php-how-to-match-urlencoded-plus-sign%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F12%2F06%2Fmod_rewrite-php-how-to-match-urlencoded-plus-sign%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I ran into trouble when trying to pass a <a href="http://us.php.net/urlencode"><tt>urlencode()</tt></a>'ed plus sign into a web address being processed by mod_rewrite.</p>
<p><code>$url = 'http://www.server.com/browsealpha/name+has+plus+in+it/';<br />
$url = urlencode($url); // http://www.server.com/browsealpha/name%2Bhas%2Bplus%2Bin%2Bit/</code></p>
<p>This <tt>$url</tt> variable gets <tt>echo()</tt>'d as a link in a page, so once it's clicked and loaded in the browser, I then needed mod_rewrite to translate that to the actual URL, which is:</p>
<p><code>http://www.server.com/browsealpha.php?name=name%2Bhas%2Bplus%2Bin%2Bit</code></p>
<p>Here is the RewriteRule I was using to match:</p>
<p><code># match any name containing any combination of letters, numbers, and the % sign (to match urlencoded URLs)<br />
RewriteRule ^browsealpha/([%\w]*)/?$ /browsealpha.php?name=$1 [QSA,L]</code></p>
<p>This rule should match <tt>http://www.server.com/browsealpha/name%2Bhas%2Bplus%2Bin%2Bit/</tt> but for some reason it wouldn't work.  After hours of frustration, I found <a href="http://cssbeauty.com/skillshare/discussion/2311/">a</a> <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=34602">few</a> <a href="http://us.php.net/urlencode">threads</a> mentioning the need to <tt>urlencode()</tt> the string <strong>twice</strong>, like so:</p>
<p><code>urlencode(urlencode($variable));</code></p>
<p>IT WORKS!!!  Apparently this is because mod_rewrite automatically decodes the urlencoded URL, so if you pass in <tt>%2B</tt>, PHP sees it as <tt>%2B0</tt>.  If you double encode, mod_rewrite decodes the first one, and PHP receives the second one (which is now <tt>%2B</tt>, which is what we want).</p>
<p>----------------<br />
Now playing: <a href="http://www.foxytunes.com/artist/autechre/track/444">Autechre - 444</a><br />
via <a href="http://www.foxytunes.com/signatunes/">FoxyTunes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2007/12/06/mod_rewrite-php-how-to-match-urlencoded-plus-sign/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Apache VirtualHost on Ubuntu</title>
		<link>http://www.tequilafish.com/2007/08/02/apache-virtualhost-on-ubuntu/</link>
		<comments>http://www.tequilafish.com/2007/08/02/apache-virtualhost-on-ubuntu/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 01:24:20 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[virtualhost]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2007/08/02/apache-virtualhost-on-ubuntu/</guid>
		<description><![CDATA[Here's a quickie tutorial on how to add Virtual Hosts to Apache on Ubuntu. This tutorial assumes that you have a basic understanding of Apache configuration and that your Apache is installed and able to serve websites. cd /etc/apache2/sites-available sudo vim yourdomain.com.conf and enter your VirtualHost directive. Below I've put the most basic example, see [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F08%2F02%2Fapache-virtualhost-on-ubuntu%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F08%2F02%2Fapache-virtualhost-on-ubuntu%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Here's a quickie tutorial on how to add Virtual Hosts to Apache on Ubuntu.  This tutorial assumes that you have a basic understanding of Apache configuration and that your Apache is installed and able to serve websites.</p>
<ol>
<li><strong><tt>cd /etc/apache2/sites-available</tt></strong></li>
<li><strong><tt>sudo vim yourdomain.com.conf</tt></strong> and enter your VirtualHost directive.  Below I've put the most basic example, see <a href="http://httpd.apache.org/docs/2.0/mod/core.html#virtualhost">Apache docs</a> for details and additional features:<br />
<code>&lt;VirtualHost *&gt;<br />
&nbsp;&nbsp;ServerName yourdomain.com<br />
&nbsp;&nbsp;DocumentRoot /home/youruser/public_html<br />
&lt;/VirtualHost&gt;</code><br />
Save &#038; exit.
</li>
<li><strong><tt>sudo vim /etc/hosts</tt></strong> and add your new domain to the <tt>127.0.0.1 localhost</tt> line so it looks like this:<br />
<code>127.0.0.1       localhost yourdomain.com</code><br />
Save &#038; exit.</li>
<li>Enable your new virtualhost:<br />
<code>sudo a2ensite yourdomain.com.conf</code>
</li>
<li>Reload the Apache configuration:<br />
<code>sudo /etc/init.d/apache2 reload</code>
</li>
</ol>
<p>That's it!  Repeat for each of your VirtualHosts.</p>
<p>----------------<br />
Now playing: <a href="http://www.foxytunes.com/artist/al%c3%a8may%c3%a8hu+esh%c3%a8t%c3%a9/track/tchero+adari+n%c3%a8gn">AlÃ¨mayÃ¨hu EshÃ¨tÃ© - Tchero Adari NÃ¨gn</a><br />
via <a href="http://www.foxytunes.com/signatunes/">FoxyTunes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2007/08/02/apache-virtualhost-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Squirrelmail and Very Large (Big-Ass) Inboxes</title>
		<link>http://www.tequilafish.com/2007/02/20/squirrelmail-and-very-large-big-ass-inboxes/</link>
		<comments>http://www.tequilafish.com/2007/02/20/squirrelmail-and-very-large-big-ass-inboxes/#comments</comments>
		<pubDate>Tue, 20 Feb 2007 22:14:15 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[memory_limit]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[squirrelmail]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2007/02/20/squirrelmail-and-very-large-big-ass-inboxes/</guid>
		<description><![CDATA[We have an account with a VERY large inbox (over 80,000 emails), and when logging into Squirrelmail the main pane would not load. Instead we'd be prompted by the browser to download a right_main.php file. Accounts with smaller inboxes would load fine, so I figured it had something to do with system resources. This is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F02%2F20%2Fsquirrelmail-and-very-large-big-ass-inboxes%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2007%2F02%2F20%2Fsquirrelmail-and-very-large-big-ass-inboxes%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>We have an account with a VERY large inbox (over 80,000 emails), and when logging into <a href="http://www.squirrelmail.org/">Squirrelmail</a> the main pane would not load. Instead we'd be prompted by the browser to download a <strong><tt>right_main.php</tt></strong> file.  Accounts with smaller inboxes would load fine, so I figured it had something to do with system resources.  This is an easy fix.  Open up your <strong><tt>php.ini</tt></strong> file, and increase the <strong><tt>memory_limit</tt></strong> value to something larger than the default <tt>8M</tt>.  Restart Apache and try opening your big-ass inbox again.  If it still doesn't work, increase <tt>memory_limit</tt> again.  Repeat until your inbox will load, but be careful if you have little RAM.  I was able to load my 80,000+ inbox by setting <strong><tt>memory_limit = 32M</tt></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2007/02/20/squirrelmail-and-very-large-big-ass-inboxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FCKeditor Error: this.DOMDocument has no properties</title>
		<link>http://www.tequilafish.com/2006/12/07/fckeditor-error-thisdomdocument-has-no-properties/</link>
		<comments>http://www.tequilafish.com/2006/12/07/fckeditor-error-thisdomdocument-has-no-properties/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 02:29:01 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[FCKeditor]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2006/12/07/fckeditor-error-thisdomdocument-has-no-properties/</guid>
		<description><![CDATA[In my prior post I ran into a problem with FCKeditor on Apache having to do with serving JavaScript files as the proper MIME type. I ran into a similar problem with XML files when trying to load multiple instances of FCK textareas: Error: this.DOMDocument has no properties Source File: http://www.mysite.com/FCKeditor/editor/js/fckeditorcode_gecko.js Line: 43 This is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2006%2F12%2F07%2Ffckeditor-error-thisdomdocument-has-no-properties%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2006%2F12%2F07%2Ffckeditor-error-thisdomdocument-has-no-properties%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In my prior post I ran into a problem with FCKeditor on Apache having to do with serving JavaScript files as the proper MIME type.  I ran into a similar problem with XML files when trying to load multiple instances of FCK textareas:<br />
<code>Error: this.DOMDocument has no properties<br />
Source File: http://www.mysite.com/FCKeditor/editor/js/fckeditorcode_gecko.js<br />
Line: 43</code><br />
This is easily fixed in the same way, by telling Apache how to properly serve XML files.  Put this in your <tt>httpd.conf</tt> or an <tt>.htaccess</tt> file:<br />
<code>AddType text/xml .xml</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2006/12/07/fckeditor-error-thisdomdocument-has-no-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FCKeditor in Firefox &#8211; Illegal Character JavaScript error</title>
		<link>http://www.tequilafish.com/2006/12/07/fckeditor-in-firefox-illegal-character-javascript-error/</link>
		<comments>http://www.tequilafish.com/2006/12/07/fckeditor-in-firefox-illegal-character-javascript-error/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 01:38:28 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[FCKeditor]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2006/12/07/fckeditor-in-firefox-illegal-character-javascript-error/</guid>
		<description><![CDATA[For some reason, FCKeditor would not load in Firefox 2.0 even though it loaded in IE just fine. Turns out Apache was serving up the javascript files as the wrong FileType, so Firefox would choke on some jibberish characters: Error: illegal character Source File: http://www.myserver.com/FCKeditor/editor/js/fckeditorcode_gecko.js Line: 1, Column: 1 Source Code: Ã¯Â»Â¿/* The fix is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2006%2F12%2F07%2Ffckeditor-in-firefox-illegal-character-javascript-error%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2006%2F12%2F07%2Ffckeditor-in-firefox-illegal-character-javascript-error%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>For some reason, FCKeditor would not load in Firefox 2.0 even though it loaded in IE just fine.  Turns out Apache was serving up the javascript files as the wrong FileType, so Firefox would choke on some jibberish characters:<br />
<code>Error: illegal character<br />
Source File: http://www.myserver.com/FCKeditor/editor/js/fckeditorcode_gecko.js<br />
Line: 1, Column: 1<br />
Source Code: Ã¯Â»Â¿/*</code><br />
The fix is easy enough, simply add an <tt>.htaccess</tt> file to your dir containing the following:<br />
<code>AddType application/x-javascript .js</code><br />
Now FCKeditor should work fine in Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2006/12/07/fckeditor-in-firefox-illegal-character-javascript-error/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Serving up a Windows Media Video (WMV) with Apache.</title>
		<link>http://www.tequilafish.com/2006/04/18/serving-up-a-windows-media-video-wmv-with-apache/</link>
		<comments>http://www.tequilafish.com/2006/04/18/serving-up-a-windows-media-video-wmv-with-apache/#comments</comments>
		<pubDate>Wed, 19 Apr 2006 03:32:00 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[wmv]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2006/04/18/serving-up-a-windows-media-video-wmv-with-apache/</guid>
		<description><![CDATA[When trying to serve up a Windows Media Video file from my Apache webserver, I ran into the problem of Firefox being unable to handle the file properly. It would simply load it as a plain text file, resulting in a bunch of jibberish representing the machine code of the video (as if you had [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2006%2F04%2F18%2Fserving-up-a-windows-media-video-wmv-with-apache%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2006%2F04%2F18%2Fserving-up-a-windows-media-video-wmv-with-apache%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>When trying to serve up a Windows Media Video file from my Apache webserver, I ran into the problem of Firefox being unable to handle the file properly.  It would simply load it as a plain text file, resulting in a bunch of jibberish representing the machine code of the video (as if you had opened the video with Notepad).  It turns out that with a stock install, Apache does not know how to serve this type of file, so it serves it as the default, which is plain text.  It's an easy fix, you simply have to tell Apache how to serve these types of files.  Open up <strong><tt>/etc/mime.types</tt></strong> and add the following line:<br />
<code>video/x-ms-wmv                  wmv</code><br />
You will also need to add the following to your <strong><tt>httpd.conf</tt></strong> file:<br />
<code>AddType video/x-ms-wmv .wmv</code><br />
Save and exit, restart Apache, and your browser should now prompt you for how you want to handle the file (Open/Save).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2006/04/18/serving-up-a-windows-media-video-wmv-with-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache with SSL:  &#8220;dftables: error while loading shared libraries&#8221;</title>
		<link>http://www.tequilafish.com/2005/11/10/apache-with-ssl-dftables-error-while-loading-shared-libraries/</link>
		<comments>http://www.tequilafish.com/2005/11/10/apache-with-ssl-dftables-error-while-loading-shared-libraries/#comments</comments>
		<pubDate>Fri, 11 Nov 2005 02:54:43 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2005/11/10/apache-with-ssl-dftables-error-while-loading-shared-libraries/</guid>
		<description><![CDATA[While updating OpenSSL &#038; Apache on a Linux machine (2.4.7-10smp), I came across an error when running 'make' for Apache: /usr/local/src/httpd-2.0.55/srclib/apr/libtool --silent --mode=link gcc -g -O2 -pthread -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER -I/usr/local/src/httpd-2.0.55/srclib/apr/include -I/usr/local/src/httpd-2.0.55/srclib/apr-util/include -I. -I/usr/local/src/httpd-2.0.55/os/unix -I/usr/local/src/httpd-2.0.55/server/mpm/prefork -I/usr/local/src/httpd-2.0.55/modules/http -I/usr/local/src/httpd-2.0.55/modules/filters -I/usr/local/src/httpd-2.0.55/modules/proxy -I/usr/local/src/httpd-2.0.55/include -I/usr/local/src/httpd-2.0.55/modules/generators -I/usr/local/ssl/include/openssl -I/usr/local/ssl/include -I/usr/local/src/httpd-2.0.55/modules/dav/main -export-dynamic -L/usr/local/ssl/lib -o dftables -L/usr/local/ssl/lib dftables.lo -lssl -lcrypto [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2005%2F11%2F10%2Fapache-with-ssl-dftables-error-while-loading-shared-libraries%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2005%2F11%2F10%2Fapache-with-ssl-dftables-error-while-loading-shared-libraries%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>While updating OpenSSL &#038; Apache on a Linux machine (2.4.7-10smp), I came across an error when running '<tt>make</tt>' for Apache:<br />
<code>/usr/local/src/httpd-2.0.55/srclib/apr/libtool --silent --mode=link gcc  -g -O2 -pthread    -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER   -I/usr/local/src/httpd-2.0.55/srclib/apr/include -I/usr/local/src/httpd-2.0.55/srclib/apr-util/include -I. -I/usr/local/src/httpd-2.0.55/os/unix -I/usr/local/src/httpd-2.0.55/server/mpm/prefork -I/usr/local/src/httpd-2.0.55/modules/http -I/usr/local/src/httpd-2.0.55/modules/filters -I/usr/local/src/httpd-2.0.55/modules/proxy -I/usr/local/src/httpd-2.0.55/include -I/usr/local/src/httpd-2.0.55/modules/generators -I/usr/local/ssl/include/openssl -I/usr/local/ssl/include -I/usr/local/src/httpd-2.0.55/modules/dav/main -export-dynamic -L/usr/local/ssl/lib   -o dftables -L/usr/local/ssl/lib dftables.lo -lssl -lcrypto<br />
./dftables > /usr/local/src/httpd-2.0.55/srclib/pcre/chartables.c<br />
./dftables: error while loading shared libraries: libssl.so.0.9.8: cannot open shared object file: No such file or directory<br />
make[3]: *** [/usr/local/src/httpd-2.0.55/srclib/pcre/chartables.c] Error 127<br />
make[3]: Leaving directory `/usr/local/src/httpd-2.0.55/srclib/pcre'<br />
make[2]: *** [all-recursive] Error 1<br />
make[2]: Leaving directory `/usr/local/src/httpd-2.0.55/srclib/pcre'<br />
make[1]: *** [all-recursive] Error 1<br />
make[1]: Leaving directory `/usr/local/src/httpd-2.0.55/srclib'<br />
make: *** [all-recursive] Error 1</code><br />
I figured this was because of an inconsistency between the two versions of OpenSSL I had on my system.  The system came with the SSL libraries installed in <strong><tt>/usr/lib</tt></strong>, which I had updated as symlinks to my newly &#038; manually installed directory <strong><tt>/usr/local/ssl/lib</tt></strong>.  That wasn't enough.  Apache (dftables specifically) needs to know where the new libraries are, so we must tell it where to look.  Do this by adding our new lib dir to <strong><tt>/etc/ld.so.conf</tt></strong>.  Open it up in your favorite editor and add the following line:<br />
<code>/usr/local/ssl/lib</code><br />
Save &#038; Exit, then run:<br />
<code>/sbin/ldconfig</code><br />
Now re-run <strong><tt>make</tt></strong> in your Apache dir and everything should go smoothly.  Note that you may want to run <strong><tt>make distclean</tt></strong> first just to be sure you start with a clean slate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2005/11/10/apache-with-ssl-dftables-error-while-loading-shared-libraries/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache: Forcing SSL using mod_rewrite and .htaccess</title>
		<link>http://www.tequilafish.com/2005/11/08/forcing-ssl-using-mod_rewrite-and-htaccess/</link>
		<comments>http://www.tequilafish.com/2005/11/08/forcing-ssl-using-mod_rewrite-and-htaccess/#comments</comments>
		<pubDate>Tue, 08 Nov 2005 21:51:02 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.tequilafish.com/2005/11/08/forcing-ssl-using-mod_rewrite-and-htaccess/</guid>
		<description><![CDATA[If you want to force all connections to your Apache web server to use SSL (https), you can do so with a simple .htaccess file inside the directory you want to protect: # Force SSL connections RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] Make sure you get all the proper spacing in there, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.tequilafish.com%2F2005%2F11%2F08%2Fforcing-ssl-using-mod_rewrite-and-htaccess%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.tequilafish.com%2F2005%2F11%2F08%2Fforcing-ssl-using-mod_rewrite-and-htaccess%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you want to force all connections to your Apache web server to use SSL (https), you can do so with a simple <tt>.htaccess</tt> file inside the directory you want to protect:<br />
<code># Force SSL connections<br />
RewriteEngine On<br />
RewriteCond %{SERVER_PORT} !^443$<br />
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]</code></p>
<p>Make sure you get all the proper spacing in there, or else it won't work!  I spent quite a bit of time pulling my hair out trying to get this to work, only to find out I was missing a space somewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tequilafish.com/2005/11/08/forcing-ssl-using-mod_rewrite-and-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
