<?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"
	>

<channel>
	<title>LAMP Tips!</title>
	<atom:link href="http://lamptips.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lamptips.com</link>
	<description>Tips, tricks and (good) hacks</description>
	<pubDate>Thu, 14 Aug 2008 01:26:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Too many arguments with tar</title>
		<link>http://lamptips.com/too-many-arguments-with-tar/</link>
		<comments>http://lamptips.com/too-many-arguments-with-tar/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 01:20:36 +0000</pubDate>
		<dc:creator>Geoff W.</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[ARG_MAX]]></category>

		<category><![CDATA[compress]]></category>

		<category><![CDATA[tar]]></category>

		<category><![CDATA[too many arguments]]></category>

		<guid isPermaLink="false">http://lamptips.com/?p=17</guid>
		<description><![CDATA[Occasionally, when compressing directories with large numbers of files and/or directories contained within them, you will get an error stating: Too many arguments.
This is not an error from the application - rather it is an error from the shell tell you the ARG_MAX limit has been reached. Here is what you can do to avoid/get [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally, when compressing directories with large numbers of files and/or directories contained within them, you will get an error stating: Too many arguments.</p>
<p>This is not an error from the application - rather it is an error from the shell tell you the ARG_MAX limit has been reached. Here is what you can do to avoid/get around that:</p>
<p><span id="more-17"></span></p>
<p>If you find that you can not compress a directory because it contains to many files, you can do one of two things:</p>
<p>Compress the container directory or:</p>
<p>Generate the file list<br />
<strong>find -iname '*.ext' &gt; file_list.txt</strong></p>
<p>Run tar, passing it the file list<br />
<strong>tar czvf archive.tar.gz --files-from file_list.txt</strong></p>
<p>Shorthand of this would be:<br />
<strong>find . -name '*.ext' -print | tar -cvzf archive.tar.gz --files-from -</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lamptips.com/too-many-arguments-with-tar/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MySQL &#8220;How big are my databases?&#8221;</title>
		<link>http://lamptips.com/mysql-how-big-are-my-databases/</link>
		<comments>http://lamptips.com/mysql-how-big-are-my-databases/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 12:40:11 +0000</pubDate>
		<dc:creator>Dan S.</dc:creator>
		
		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Information]]></category>

		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://lamptips.com/?p=14</guid>
		<description><![CDATA[If you're like many of the MySQL users out there and do not have access to the MySQL command line, or perhaps you do have access to the MySQL command line and just want to know how to determine how big your databases and tables are, this is for you!

The INFORMATION_SCHEMA database contains a wealth [...]]]></description>
			<content:encoded><![CDATA[<p>If you're like many of the MySQL users out there and do not have access to the MySQL <strong>command line</strong>, or perhaps you do have access to the MySQL command line and just want to know how to determine how big your databases and tables are, this is for you!</p>
<p><span id="more-14"></span></p>
<p>The <strong>INFORMATION_SCHEMA</strong> database contains a wealth of information regarding your database(s), but is only available for MySQL 5.0 and up. One way I like to query the INFORMATION_SCHEMA database will return the <strong>Database | Table | Size</strong> for each table you've got. Here's what the SQL looks like:</p>
<pre class="sql"><span style="color: #993333; font-weight: bold;">SELECT</span> TABLE_SCHEMA <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">'Database'</span>, TABLE_NAME <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">'Table'</span>,
CONCAT<span style="color: #66cc66;">&#40;</span>ROUND<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>DATA_LENGTH + INDEX_LENGTH - DATA_FREE<span style="color: #66cc66;">&#41;</span> / <span style="color: #cc66cc;">1024</span> / <span style="color: #cc66cc;">1024</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #ff0000;">&quot; MB&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> Size <span style="color: #993333; font-weight: bold;">FROM</span> INFORMATION_SCHEMA.<span style="color: #993333; font-weight: bold;">TABLES</span>;</pre>
<p>Once you execute this SQL, you will get a nice list of your tables, along with their size, in MB. Feel free to adjust as necessary to retrieve additional data, or in different formats. If you have a format you really like, <strong>share it!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lamptips.com/mysql-how-big-are-my-databases/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MySQL &#8220;Too Many Connections&#8221;</title>
		<link>http://lamptips.com/mysql-too-many-connections/</link>
		<comments>http://lamptips.com/mysql-too-many-connections/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 06:50:27 +0000</pubDate>
		<dc:creator>Dan S.</dc:creator>
		
		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Errors]]></category>

		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://lamptips.com/?p=13</guid>
		<description><![CDATA[There isn't a day that goes by without someone, somewhere, reaching the maximum number of concurrent connections to their MySQL database. Generally, the solution is to increase this value; However this is not the best solution, nor does it alway help.

What MySQL users need to understand is that queries generally execute very fast. A busy [...]]]></description>
			<content:encoded><![CDATA[<p>There isn't a day that goes by without someone, somewhere, reaching the <strong>maximum</strong> number of concurrent <strong>connections</strong> to their MySQL database. Generally, the solution is to increase this value; However this is not the best solution, nor does it alway help.</p>
<p><span id="more-13"></span></p>
<p>What MySQL users need to understand is that queries generally execute <em>very fast</em>. A busy server should really never need more than 200 concurrent connections for any given user. The trick in solving this problem is to understand why it is happening. What is stopping your queries from executing fast?</p>
<p>Many times, the problem is as simple as your daily backups running. If your database is large and the backup takes 10 or 15 minutes to process, then all of the queries coming into the database will queue up and wait for the backup to finish. Processing 20 - 50 queries per second, it's not hard to do the math - your server could easily hit 200 connections queued waiting for the backup to finish - within seconds.</p>
<p>Solutions to this case can range from the simple, for instance, scheduling your backups to run at a time where you do not expect any traffic - to the more complex such as using<strong> replication </strong>as a backup aid. (Replication is something I will get into in later postings.)</p>
<p>Lastly, a backup of connections can always be caused from table<strong> locking </strong>issues, or slow queries (they take a long time). Running 1 complex query which takes 300 - 500 seconds to complete may indeed lock your table, preventing other queries from accessing the same data. You can always get a hint at what kind of queries are taking a long time to execute by logging the slowest of them. This "slow-query-log" can be enabled in your MySQL configuration file, commonly located at<em> /etc/my.cnf</em> by adding the following under the "[mysqld]" section:</p>
<p>log-slow-queries=/the/log/file/path</p>
<p>Where /the/log/file/path is wherever you want the file kept. You must restart MySQL after adding this setting.</p>
<p>When analyzing this file, it's always helpful to use "<strong>mysqldumpslow</strong>". I'm not going to give you all the answers, but if you want to learn how to use it to help analyze your slow query log, try:</p>
<p>mysqldumpslow --help</p>
]]></content:encoded>
			<wfw:commentRss>http://lamptips.com/mysql-too-many-connections/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Linking Files</title>
		<link>http://lamptips.com/linking-files/</link>
		<comments>http://lamptips.com/linking-files/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 19:07:01 +0000</pubDate>
		<dc:creator>Geoff W.</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Linux SymLink]]></category>

		<category><![CDATA[Symlinks]]></category>

		<guid isPermaLink="false">http://lamptips.com/?p=8</guid>
		<description><![CDATA[Create a symlink to a file rather than copying it to a new location

The command is formatted as follows:
ln -s existing_file new_file
You can use this to link directories as well.
ln -s /usr/src /usr/local/src
]]></description>
			<content:encoded><![CDATA[<p>Create a symlink to a file rather than copying it to a new location</p>
<p><span id="more-8"></span></p>
<p>The command is formatted as follows:</p>
<p><strong>ln -s existing_file new_file</strong></p>
<p>You can use this to link directories as well.</p>
<p><strong>ln -s /usr/src /usr/local/src</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lamptips.com/linking-files/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hide Apache Version Number</title>
		<link>http://lamptips.com/hide-apache-version-number/</link>
		<comments>http://lamptips.com/hide-apache-version-number/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 18:39:27 +0000</pubDate>
		<dc:creator>Geoff W.</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[hide apache version]]></category>

		<guid isPermaLink="false">http://lamptips.com/?p=7</guid>
		<description><![CDATA[Add to httpd.conf

ServerSignature Off
ServerTokens Prod
]]></description>
			<content:encoded><![CDATA[<p>Add to httpd.conf</p>
<p><span id="more-7"></span></p>
<p><strong>ServerSignature Off<br />
ServerTokens Prod</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lamptips.com/hide-apache-version-number/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Disable HTTP Trace Method</title>
		<link>http://lamptips.com/disable-http-trace-method/</link>
		<comments>http://lamptips.com/disable-http-trace-method/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 17:55:00 +0000</pubDate>
		<dc:creator>Geoff W.</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Apache Trace]]></category>

		<category><![CDATA[Disable TRACE]]></category>

		<category><![CDATA[http trace]]></category>

		<category><![CDATA[TRACE Method]]></category>

		<guid isPermaLink="false">http://lamptips.com/?p=6</guid>
		<description><![CDATA[Disable the TRACE Method for PCI Compliance

Add this to your httpd.conf
TraceEnable off
Alternatively, if not using 1.3.34 or 2.0.55+, you can add this to your httpd.conf:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
]]></description>
			<content:encoded><![CDATA[<p>Disable the TRACE Method for PCI Compliance</p>
<p><span id="more-6"></span></p>
<p>Add this to your httpd.conf</p>
<p><strong>TraceEnable off</strong></p>
<p>Alternatively, if not using 1.3.34 or 2.0.55+, you can add this to your httpd.conf:</p>
<p><strong>RewriteEngine On<br />
RewriteCond %{REQUEST_METHOD} ^TRACE<br />
RewriteRule .* - [F]</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lamptips.com/disable-http-trace-method/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Disable weak ciphers and older TLS support</title>
		<link>http://lamptips.com/disable-weak-ciphers-and-older-tls-support/</link>
		<comments>http://lamptips.com/disable-weak-ciphers-and-older-tls-support/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 17:46:28 +0000</pubDate>
		<dc:creator>Geoff W.</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Disable SSL2]]></category>

		<category><![CDATA[Disable SSLv2]]></category>

		<guid isPermaLink="false">http://lamptips.com/?p=5</guid>
		<description><![CDATA[Disable SSLv2/TLS1 for PCI Compliance

Add the following to httpd.conf:
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT56:+HIGH:+MEDIUM:-SSLv2:-RC4:+EXP
]]></description>
			<content:encoded><![CDATA[<p>Disable SSLv2/TLS1 for PCI Compliance</p>
<p><span id="more-5"></span></p>
<p>Add the following to httpd.conf:</p>
<p><strong>SSLProtocol all -SSLv2<br />
SSLCipherSuite ALL:!ADH:!EXPORT56:+HIGH:+MEDIUM:-SSLv2:-RC4:+EXP</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lamptips.com/disable-weak-ciphers-and-older-tls-support/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Install APC</title>
		<link>http://lamptips.com/install-apc/</link>
		<comments>http://lamptips.com/install-apc/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 15:54:59 +0000</pubDate>
		<dc:creator>Geoff W.</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[APC]]></category>

		<category><![CDATA[PHP Performance]]></category>

		<category><![CDATA[PHP Tuning]]></category>

		<guid isPermaLink="false">http://www.lamptips.com/?p=3</guid>
		<description><![CDATA[To help with PHP's performance in a non-cgi environment, install APC.

It's as easy as:
pecl install apc
You'll just have to add the extension in your PHP.ini and restart Apache.
Check out the APC Homepage
]]></description>
			<content:encoded><![CDATA[<p>To help with PHP's performance in a non-cgi environment, install APC.</p>
<p><span id="more-3"></span></p>
<p>It's as easy as:</p>
<p><strong>pecl install apc</strong></p>
<p>You'll just have to add the extension in your PHP.ini and restart Apache.</p>
<p>Check out the <a href="http://us.php.net/manual/en/book.apc.php">APC Homepage</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lamptips.com/install-apc/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
