<?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/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tequilafish.com</link>
	<description>Ran-dumb ramblings of me...</description>
	<lastBuildDate>Thu, 26 Jan 2012 23:30:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</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&amp;b=2" 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&amp;b=2" 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>2</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&amp;b=2" 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&amp;b=2" 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>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&amp;b=2" 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>
	</channel>
</rss>

