<?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>TechTutz</title>
	<atom:link href="http://techtutz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techtutz.com</link>
	<description>Technology Tutorials for all!</description>
	<lastBuildDate>Fri, 09 Mar 2012 23:38:14 +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>How-to Upgrade your Memory (RAM)</title>
		<link>http://techtutz.com/how-to-upgrade-your-memory-ram/</link>
		<comments>http://techtutz.com/how-to-upgrade-your-memory-ram/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 21:48:54 +0000</pubDate>
		<dc:creator>Pepper</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=383</guid>
		<description><![CDATA[To do a memory upgrade you will first need to specify what type the card is this includes the amount of pins required for connection, if it is a DDR2 or DDR3 stick, you need to know what you want to upgrade to and, if your motherboard can handle the RAM you want to put [...]]]></description>
			<content:encoded><![CDATA[<p>To do a memory upgrade you will first need to specify what type the card is this includes the amount of pins required for connection, if it is a DDR2 or DDR3 stick, you need to know what you want to upgrade to and, if your motherboard can handle the RAM you want to put in, most new motherboards can hold up to 16 GB of RAM. Once, you have acquired this crucial information. you can now proceed with purchasing your RAM. To upgrade your RAM you must first turn off and open the case to your computer. You can then proceed to the removal of the old RAM, to remove the old memory cards  just push down on the tabs that lock the sticks in place. You can now place to new memory sticks straight down into the channel and press down till the tabs are locked back in place before replacing to case door and running the computer how ever you may run your computer. Voila you have successfully replaced/upgraded your computer&#8217;s memory.</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/OgiOy_OU0L0" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/how-to-upgrade-your-memory-ram/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How-To Change Your Default SSH Port</title>
		<link>http://techtutz.com/how-to-change-your-default-ssh-port/</link>
		<comments>http://techtutz.com/how-to-change-your-default-ssh-port/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 20:20:17 +0000</pubDate>
		<dc:creator>legacy</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=409</guid>
		<description><![CDATA[SSH defaults to port 22, which is known by just about everyone, so it is the most common attack you will experience on your server. I recommend changing it not just to at least shrug off potential attacks but it is one less area for your performance to be decreased. I mean it is probably [...]]]></description>
			<content:encoded><![CDATA[<p>SSH defaults to port 22, which is known by just about everyone, so it is the most common attack you will experience on your server. I recommend changing it not just to at least shrug off potential attacks but it is one less area for your performance to be decreased. I mean it is probably not that bad but if you have 50 bots trying to login to SSH then you will most likely have a small performance overhead(maybe very minimal but still some).</p>
<p>“Well, this all sounds fine and dandy legacy, but how do we change the default port?”</p>
<p>Simple, you need root access but just SSH to /etc/ssh/sshd_conf<br />
edit the port to whatever you want(should be in the first couple lines. Make sure it is not commented out!</p>
<p>then restart SSHD by using the following line.<br />
<code>/etc/init.d/sshd restart</code><script> devfmt_addAjaxBuffer(1, 409); </script><br />
or<br />
<code>service sshd restart</code><script> devfmt_addAjaxBuffer(2, 409); </script></p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/how-to-change-your-default-ssh-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to tweak cPanel, Apache, MySQL and PHP for best performance</title>
		<link>http://techtutz.com/how-to-tweak-cpanel-apache-mysql-and-php-for-best-performance/</link>
		<comments>http://techtutz.com/how-to-tweak-cpanel-apache-mysql-and-php-for-best-performance/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 18:45:19 +0000</pubDate>
		<dc:creator>legacy</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=368</guid>
		<description><![CDATA[cPanel/[tooltip text="Web Host Manager"]WHM[/tooltip], Apache, and PHP are often the root of the cause for when your web server is feeling sluggish. One must be very patient in order to configure your web server for optimal performance. Well, it is either that or to read and implement the suggestions that this article makes. WHM To [...]]]></description>
			<content:encoded><![CDATA[<p>cPanel/[tooltip text="Web Host Manager"]WHM[/tooltip], Apache, and PHP are often the root of the cause for when your web server is feeling sluggish. One must be very patient in order to configure your web server for optimal performance. Well, it is either that or to read and implement the suggestions that this article makes.</p>
<h2 style="text-align: center;">WHM</h2>
<p>To access WHM you will want to go to http://YOURIP:2087 or http://YOURDOMAIN.tld:2087. From here you will want to go to Server Configuration&gt;Tweak Settings and then click on the tab &#8220;Stats Programs&#8221;. In here you will want to disable all of them unless you use them(most people use google analytics nowadays. Now you can go to Service Configuration&gt;Service Manager and disable the following: Eximstats, cPBandwd, entropychat, melange , spamd, and mailman. Now you will also want to disable monitoring for: ipaliases. Some other things that can be done in Tweak settings is to make sure that default catch-all mail address is set to FAIL. You can also 1) Untick Mailman, this is a resource hog. and 2) Change the number of minutes between mail server queues to 180.</p>
<h2 style="text-align: center;">Apache</h2>
<p>The best thing currently for Apache is Varnish. Varnish is an http accelerator that basically makes Apache runs faster. The following will show you how to install Varnish(Note: You must be in shell as root to do this.)</p>
<p>Install Varnish</p>
<p>sudo apt-get install varnish</p>
<p>Now it is time to configure Varnish a bit, first run:</p>
<p>vim /etc/default/varnish</p>
<p>DAEMON_OPTS=&#8221;-a :80 \<br />
-T localhost:6082 \<br />
-f /etc/varnish/default.vcl \<br />
-S /etc/varnish/secret \<br />
-s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G</p>
<p>Step 2 of the configuration should be run like this:</p>
<p>vim /etc/varnish/default.vcl</p>
<p>backend apache {<br />
.host = &#8220;127.0.0.1&#8243;;<br />
.port = &#8220;8008&#8243;;<br />
}<br />
acl purge {<br />
&#8220;localhost&#8221;;<br />
&#8220;127.0.0.1&#8243;;<br />
}<br />
sub vcl_recv {<br />
// Strip cookies for static files:<br />
if (req.url ~ &#8220;\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$&#8221;) {<br />
unset req.http.Cookie;<br />
return(lookup);<br />
}<br />
// Remove has_js and Google Analytics __* cookies.<br />
set req.http.Cookie = regsuball(req.http.Cookie, &#8220;(^|;\s*)(__[a-z]+|has_js)=[^;]*&#8221;, &#8220;&#8221;);<br />
// Remove a &#8220;;&#8221; prefix, if present.<br />
set req.http.Cookie = regsub(req.http.Cookie, &#8220;^;\s*&#8221;, &#8220;&#8221;);<br />
// Remove empty cookies.<br />
if (req.http.Cookie ~ &#8220;^\s*$&#8221;) {<br />
unset req.http.Cookie;<br />
}<br />
if (req.request == &#8220;PURGE&#8221;) {<br />
if (!client.ip ~ purge) {<br />
error 405 &#8220;Not allowed.&#8221;;<br />
}<br />
purge(&#8220;req.url ~ &#8221; req.url &#8221; &amp;&amp; req.http.host == &#8221; req.http.host);<br />
error 200 &#8220;Purged.&#8221;;<br />
}<br />
}<br />
sub vcl_hash {<br />
if (req.http.Cookie) {<br />
set req.hash += req.http.Cookie;<br />
}<br />
}<br />
sub vcl_fetch {<br />
// Strip cookies for static files:<br />
if (req.url ~ &#8220;\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$&#8221;) {<br />
unset beresp.http.set-cookie;<br />
}<br />
// Varnish determined the object was not cacheable<br />
if (!beresp.cacheable) {<br />
set beresp.http.X-Cacheable = &#8220;NO:Not Cacheable&#8221;;<br />
} elsif(req.http.Cookie ~&#8221;(UserID|_session)&#8221;) {<br />
// You don&#8217;t wish to cache content for logged in users<br />
set beresp.http.X-Cacheable = &#8220;NO:Got Session&#8221;;<br />
return(pass);<br />
} elsif ( beresp.http.Cache-Control ~ &#8220;private&#8221;) {<br />
// You are respecting the Cache-Control=private header from the backend<br />
set beresp.http.X-Cacheable = &#8220;NO:Cache-Control=private&#8221;;<br />
return(pass);<br />
} elsif ( beresp.ttl &lt; 1s ) {<br />
// You are extending the lifetime of the object artificially<br />
set beresp.ttl = 300s;<br />
set beresp.grace = 300s;<br />
set beresp.http.X-Cacheable = &#8220;YES:Forced&#8221;;<br />
} else {<br />
// Varnish determined the object was cacheable<br />
set beresp.http.X-Cacheable = &#8220;YES&#8221;;<br />
}<br />
return(deliver);<br />
}</p>
<p>Time to reconfigure Apache a bit:<br />
<pre>vim /etc/apache2/ports.conf

NameVirtualHost *:8008
Listen 8008

After that run:</pre><script> devfmt_addAjaxBuffer(1, 368); </script><br />
<virtualhost --dvfmtsc--=""><br />
<pre>vim /etc/apache2/sites-enabled/000-default
&lt;Virtualhost *:8008&gt;
 ...
&lt;/Virtualhost&gt;</pre><script> devfmt_addAjaxBuffer(2, 368); </script><br />
</virtualhost></p>
<p>Do<!--DVFMTSC-->&nbsp;the<!--DVFMTSC-->&nbsp;above<!--DVFMTSC-->&nbsp;for<!--DVFMTSC-->&nbsp;all<!--DVFMTSC-->&nbsp;VHOSTS.</p>
<p>Time<!--DVFMTSC-->&nbsp;to<!--DVFMTSC-->&nbsp;restart<!--DVFMTSC-->&nbsp;your<!--DVFMTSC-->&nbsp;services:<br />
<pre>service apache restart
service varnish restart

Now you can test varnish

curl -I http://YOURDOMAIN.tld</pre><script> devfmt_addAjaxBuffer(3, 368); </script></p>
<h2 style="text-align: center;">MySQL</h2>
<p>I just suggest doing what mysqltuner tells you as it will be able to help out your specific case. To install mysqltuner simply follow the code below in shell.</p>
<p>wget mysqltuner.pl<br />
chmod 755 mysqltuner.pl<br />
./mysqltuner.pl</p>
<p style="text-align: left;">[box type="info"]Please note that on some systems you may need to remove the mysqltuner that is installed by default if you get any errors. Simply run the following command then do the above commands again. rm mysqltuner.pl[/box]</p>
<h2 style="text-align: center;">PHP</h2>
<p>PHP is a little more tricky to optimize than the others. The first thing you are going to want to do is to install and configure a OPCode Cache. While most of these are available through EasyApache(XCache, eAccelerator) there are some others that you may want to consider installing such as APC(highly recommended out of the rest since the PHP team develops it).</p>
<p>First you will want to install some dependencies(as always you should be logged in as root in shell): yum&nbsp;install&nbsp;pcre-devel</p>
<p>Next you will want to go to WHM and go to Software&gt;Module Installers&gt;PHP Pecl and then search and install &#8220;APC&#8221;.</p>
<p>Congratulations WHM should now install APC successfully!</p>
<p>As a general rule of thumb you should keep the amount of Modules compiled into PHP limited.</p>
<h2 style="text-align: center;">Miscellaneous</h2>
<p>While these are installed to certain parts of your server I wanted to put them here because they really benefit all parts of the server. The below can all be found in EasyApache.</p>
<p>Mod QoS(This will protect you against DoS attacks, especially Slowloris attacks.)</p>
<p>Mod Security(This is a WAF or Web Application Firewall, I think the name speaks for itself.)</p>
<p>Mod Deflate(This can be found in the exhaustive options list and compresses data sent from your web server to the user&#8217;s browser.)</p>
<p>Mod Expires(This is also in the exhaustive options list and will allow you to set expire headers either in your httpd.conf file or your .htaccess file.)</p>
<p>SuHosin(This will harden/secure PHP)</p>
<p>That concludes this tutorial, stay-tuned for more!<br />
<pre>&nbsp;</pre><script> devfmt_addAjaxBuffer(4, 368); </script></p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/how-to-tweak-cpanel-apache-mysql-and-php-for-best-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Management</title>
		<link>http://techtutz.com/new-management/</link>
		<comments>http://techtutz.com/new-management/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 21:28:28 +0000</pubDate>
		<dc:creator>legacy</dc:creator>
				<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=341</guid>
		<description><![CDATA[Hello, TechTutz is now under new management. Expect a lot more Tutorials to be posted in the coming weeks as I put together a team of Techies, geeks, and the like from all corners of the Internet community. Want a chance to become a writer? Use the contact us link at the top. We look [...]]]></description>
			<content:encoded><![CDATA[<p>Hello, TechTutz is now under new management. Expect a lot more Tutorials to be posted in the coming weeks as I put together a team of Techies, geeks, and the like from all corners of the Internet community. Want a chance to become a writer? Use the contact us link at the top. We look forward to the many new things to come out of this site and hope that you can be as excited as we are. Until next time, end transmission&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/new-management/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to Create a PHP/MySQL Powered Blog</title>
		<link>http://techtutz.com/create-php-blog/</link>
		<comments>http://techtutz.com/create-php-blog/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 09:00:15 +0000</pubDate>
		<dc:creator>Mikey</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=275</guid>
		<description><![CDATA[In this tutorial, we&#8217;ll go into how to create your own PHP/MySQL powered blog. This tutorial assumes you have a basic rudimentary working knowledge of PHP, MySQL, and database driven dynamic content sites (such as this one). You can Download the source files from the bottom of the post. Step 1 &#8211; Database Note that [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, we&#8217;ll go into how to create your own PHP/MySQL powered blog. This tutorial assumes you have a basic rudimentary working knowledge of PHP, MySQL, and database driven dynamic content sites (such as this one).</p>
<p>You can <strong><a href="#downloadblog">Download</a> the source files</strong> from the bottom of the post.</p>
<p><span id="more-275"></span></p>
<h1>Step 1 &#8211; Database</h1>
<p>Note that this is a tutorial about how to make a simple BLOG, and as such, I won&#8217;t go into the comments systems, or a user system in this entry. Right now all you will come out with is a blog system where you type what you want to type, and click go, and it&#8217;s displayed.</p>
<p>You need a blog table, with an id field which needs to be unique, a &#8220;title&#8221; field for your blog entries titles, a &#8220;content&#8221; field for the content of your blog, and a &#8220;datetime&#8221; field, so that you know exactly when that entry was added. You may also want to record the IP address of the person who has added the entry.</p>
<h3>The CREATE Code</h3>
<p><pre>CREATE TABLE  `tt_blog` (
`id` INT NOT NULL AUTO_INCREMENT ,
`title` VARCHAR( 140 ) NOT NULL ,
`content` TEXT NOT NULL ,
`datetime` DATETIME NOT NULL ,
`userip` TEXT NOT NULL ,
PRIMARY KEY (  `id` )
) ENGINE = MYISAM</pre><script> devfmt_addAjaxBuffer(1, 275); </script></p>
<h1>Step 2 &#8211; Templating (Header/Footer)</h1>
<p><a href="http://techtutz.com/wp-content/uploads/2011/01/techtutz-header-footer-content.png"><img class="size-medium wp-image-277" style="float: right; display: inline;" title="techtutz-header-footer-content" src="http://techtutz.com/wp-content/uploads/2011/01/techtutz-header-footer-content-242x300.png" alt="Header/Footer example" width="242" height="300" /></a>You&#8217;ll notice in each blog post here on techtutz.com, there are three main elements. These are, the header (outlined in red), the content area (outlined in blue) and the footer (outlined in purple).</p>
<p>This is essentially the same for most blog systems, you have a header, which contains the navigation elements, a logo and sometimes a search bar. A content area, which usually contains the blog entry itself, a sidebar and sometimes a comments form. The footer, which usually contains the copyright to the blog engine, and possibly to the style author.</p>
<p>For our blog system, we&#8217;re going to need these elements, so we&#8217;re going to create simple html files for our header, and our footer, and upload them to our blogs &#8220;tpl&#8221; directory. We&#8217;re going to include these in our PHP files later, so if you name them differently to what I&#8217;ve named them, make sure you take note for later.</p>
<h3>header.html</h3>
<p><pre><!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My PHP/MySQL Powered Blog - TechTutz.com</title>
4fb9565be3e262_
<link rel="stylesheet" href="style.css" />
<meta name="generator" content="http://switchtohtml5.com">
</head>
<body>
<section>
	<header>
		<nav>
			<a href="index.php">Home</a>
			<a href="index.php?p=archive">Archive</a>
		</nav>
	</header></pre><script> devfmt_addAjaxBuffer(2, 275); </script></p>
<h3>footer.html</h3>
<p><pre></section>
<footer>
<p>
&copy; 2011
<a href="http://tutz.techtutz.com/create-php-blog">
How to Create a PHP/MySQL Powered Blog - TechTutz
</a>
</p>
</footer>
</body>
</html></pre><script> devfmt_addAjaxBuffer(3, 275); </script><br />
<strong>Upload</strong> these files to your blog directory under a new directory named &#8220;tpl&#8221;. We&#8217;ll assume it&#8217;s /blog/tpl</p>
<h1>The PHP Code</h1>
<p>I always find it difficult to explain how I do PHP code, so apologies in advance if it seems I&#8217;m going a million miles an hour. This is procedural PHP code, and not Object Oriented Programming, it would be much easier to create a quick blog system in an Object Oriented Framework (such as <a href="http://book.cakephp.org/view/1528/Blog">CakePHP</a>), however it&#8217;s also a lot more confusing to explain to the novice user.</p>
<p>First off, we need to establish a connection to the database.. Create a file named &#8220;db.php&#8221; for convenience.<br />
<pre><?php

mysql_connect('localhost', 'dbuser', 'dbpass') or die(mysql_error());
mysql_select_db('dbname') or die(mysql_error()); 

?></pre><script> devfmt_addAjaxBuffer(4, 275); </script><br />
Now we need to turn our attention to index.php. Let&#8217;s do some preliminary setup of the script, we need to include the header, footer, and database, as well as doing some preliminary sanitisation efforts.<br />
<pre><?php

require ("db.php"); // establish a connection to the database
include ("tpl/header.html"); // include header template

$content = ""; // start empty
$page = strip_tags($_GET['p']); // sanitize data.

// set it so that if page is empty (IE, home page) show archive posts.
if (empty($page)) {
    $page = "archive";
}
        echo $content; // echo out the pre filled content variable.

include ("tpl/footer.html"); // include footer template

?></pre><script> devfmt_addAjaxBuffer(5, 275); </script><br />
Then we need to create the &#8220;Add Entry&#8221; form on index.php?p=add &#8211; this code would look something like this:<br />
<pre>if ($page == 'add') {
    // display the add form..
    if (empty($_POST['addblog'])) {
        $content .= "
        <form action=\"{$_SERVER['PHP_SELF']}?p=add\" method=\"post\">
        <label for=\"title\">Entry Title:</label>
		<input type=\"text\" name=\"title\" id=\"title\" /><br />
        <label for=\"content\">Blog Entry:</label><br />
		4fb9565be40291_<br />
        <input type=\"submit\" name=\"addblog\" id=\"addblog\" />
        </form>
        ";
    } else {</pre><script> devfmt_addAjaxBuffer(6, 275); </script><br />
What we&#8217;re doing in the above code is checking to see if the form has been submitted (which is hasn&#8217;t if you&#8217;re visiting for the first time), and then generating the form.</p>
<p>Then we need to sanitise the data which the user entered, so that they can&#8217;t do bad things to our database or site through XSS or remote queries.<br />
<pre>        // sanitization is important. You could catch some nasty bug.
        $title = mysql_real_escape_string(htmlspecialchars($_POST['title'], ENT_QUOTES));
        $entry = mysql_real_escape_string(htmlspecialchars($_POST['content'], ENT_QUOTES));
        // re enable line breaks.
        $entry = str_replace(array("\\r\\n", "\\r", "\\n"), "", $entry);
        // if the title or content is empty, tell the user it's empty!!
        if ((!empty($title)) && (!empty($entry))) {</pre><script> devfmt_addAjaxBuffer(7, 275); </script><br />
Then we need to actually enter the data into the database..<br />
<pre>mysql_query(
"INSERT INTO `tt_blog`
(`id` ,`title` ,`content` ,`datetime` ,`userip`)
VALUES
(NULL ,  '{$title}',  '{$entry}',  NOW(),  '{$_SERVER['REMOTE_ADDR']}');"
);
                    $content .= "Entry Added!";
        } else {
            $content .= "Error. Please fill out all fields.";
        }</pre><script> devfmt_addAjaxBuffer(8, 275); </script><br />
Well done. We have a functioning &#8220;Add&#8221; Form which checks if the entry is valid or not, and also sanitizes the data which has been input by the user.</p>
<p>Next we need to be working on the archive page, that is the default page the user hits once they are on your site, a list of the five most recent entries.<br />
<pre>if ($page == 'archive') {
        // Loop through the archive
        $getpostsq = mysql_query("SELECT * FROM `tt_blog` ORDER BY `tt_blog`.`datetime` DESC LIMIT 5");
		// get the latest five posts
        while ($getposts = mysql_fetch_assoc($getpostsq)) { // this puts the data into an array which we can use.
            $content .= "<div class=\"archive\">
    <p>
	<em>{$getposts['datetime']}</em>
	» <a href=\"index.php?p={$getposts['id']}\"><strong>{$getposts['title']}</strong></a></p></div>";
        }</pre><script> devfmt_addAjaxBuffer(9, 275); </script><br />
What the above code does is it fetches the latest 5 entries from the database, and we assign it to a variable so that we can use it to construct a link to the page where the full entry will be.</p>
<p>Then we need to FETCH it from the database, and display it on index.php?p=##<br />
<pre>if ((int)$page) {
            $getpostq = mysql_query("SELECT * FROM `tt_blog` WHERE `id` = '$page'");
			// select current ID from database.
            $getpost = mysql_fetch_assoc($getpostq);
			// put the data from the previous query into an array which we can pull from.
            $content .= "<h1>{$getpost['title']}</h1>
    <em class=\"right\">{$getpost['datetime']}</em>
    <blockquote>{$getpost['content']}</blockquote>";
        }</pre><script> devfmt_addAjaxBuffer(10, 275); </script><br />
The (int) makes it so that any INTEGER called by ?p= will be treated as a POST, and not a page. This way we can use index.php?p= for both pages (as in the case of ?p=add), and posts (such as index.php?p=1).</p>
<p>Again we query the database to get the info, and again we put the data we fetch into a usable array</p>
<p>That&#8217;s it! You&#8217;ve done it, successfully created your own publishing platform. You may want to add styling to it, but it works as-is as well.</p>
<p>Do let me know in the comments if you have any suggestions, hints, or if I&#8217;ve done something catastrophically wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/create-php-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW-TO &#8211; Install SMF</title>
		<link>http://techtutz.com/install-smf/</link>
		<comments>http://techtutz.com/install-smf/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 12:00:56 +0000</pubDate>
		<dc:creator>Mikey</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=184</guid>
		<description><![CDATA[&#8220;SMF is written in the popular language PHP and uses a MySQL database. It is designed to provide you with all the features you need from a bulletin board while having an absolute minimal impact on the resources of the server. SMF is the next generation of forum software &#8211; and best of all it [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;SMF is written in the popular language PHP and uses a MySQL database. It is designed to provide you with all the features you need from a bulletin board while having an absolute minimal impact on the resources of the server. SMF is the next generation of forum software &#8211; and best of all it is and will always remain completely free!&#8221;</p></blockquote>
<p>SMF is available from <a href="http://www.simplemachines.org/" target="_blank">simplemachines.org</a>.<span id="more-184"></span></p>
<h2>Preparation</h2>
<p>The first thing you want to do is actually download the SMF package from <a href="http://download.simplemachines.org/" target="_blank">download.simplemachines.org</a> and decompress it on your local system.</p>
<div class="didyouknow"><strong>Don&#8217;t know how?</strong> Read How; <a href="http://howto.techtutz.com/add-a-database-with-phpmyadmin">PHPMyAdmin</a>, or <a href="http://howto.techtutz.com/create-a-mysql-database-command-line">Command Line Shell</a></div>
<p>Next, you&#8217;ll need to make a MySQL database for the SMF data to be installed to. Make sure you note down the database information (username, db name and password) for later.</p>
<p>Now, upload all the files, make sure to keep the directory structure (IE, the files which are contained within /Sources stay in the /Sources folder). Now, <a href="http://howto.techtutz.com/chmod">CHMOD</a> the following files and folders the following values;</p>
<p><pre>
<table>
<tbody>
<tr>
<td><strong>File/Directory</strong></td>
<td><strong>CHMOD Value</strong></td>
</tr>
<tr>
<td>avatars/</td>
<td>777</td>
</tr>
<tr>
<td>attachments/</td>
<td>777</td>
</tr>
<tr>
<td>Packages/</td>
<td>777</td>
</tr>
<tr>
<td>Packages/installed.list</td>
<td>777</td>
</tr>
<tr>
<td>Smileys/</td>
<td>777</td>
</tr>
<tr>
<td>Themes/</td>
<td>777</td>
</tr>
<tr>
<td>Themes/default/languages/Install.english.php</td>
<td>777</td>
</tr>
<tr>
<td>agreement.txt</td>
<td>777</td>
</tr>
<tr>
<td>Settings.php</td>
<td>777</td>
</tr>
<tr>
<td>Settings_bak.php</td>
<td>777</td>
</tr>
<tr>
<td>install.php</td>
<td>777</td>
</tr>
</tbody>
</table>
</pre><script> devfmt_addAjaxBuffer(1, 184); </script></p>
<h2>Installation</h2>
<p>Okay, now with a web browser, go to yoursite.com/install.php, and if you CHMOD&#8217;d everything correctly, you&#8217;ll be greeted with the installer. Fill in the Global Settings and your MySQL details (which you specified earlier), and hit &#8220;Proceed&#8221;, you&#8217;ll be prompted for an Admin user and pass, as well as the database password (for security) and hit next.</p>
<p>Now, tick to delete install.php &#8211; if it didn&#8217;t, you&#8217;ll need to go delete it, and then you&#8217;re done!</p>
<p>Congratulations, and good luck with your new Simple Machines Forum!</p>
<h2>This TechTut in Images</h2>
<p><a href='http://techtutz.com/install-smf/smf-howto1/' title='smf-howto1'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/smf-howto1-150x150.png" class="attachment-thumbnail" alt="smf-howto1" title="smf-howto1" /></a><br />
<a href='http://techtutz.com/install-smf/smf-howto2/' title='smf-howto2'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/smf-howto2-150x150.png" class="attachment-thumbnail" alt="smf-howto2" title="smf-howto2" /></a><br />
<a href='http://techtutz.com/install-smf/smf-howto3/' title='smf-howto3'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/smf-howto3-150x150.png" class="attachment-thumbnail" alt="smf-howto3" title="smf-howto3" /></a><br />
<a href='http://techtutz.com/install-smf/smf-howto4/' title='smf-howto4'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/smf-howto4-150x150.png" class="attachment-thumbnail" alt="smf-howto4" title="smf-howto4" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/install-smf/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HOW-TO &#8211; Install XChat</title>
		<link>http://techtutz.com/install-xchat/</link>
		<comments>http://techtutz.com/install-xchat/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 01:00:15 +0000</pubDate>
		<dc:creator>Mikey</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=182</guid>
		<description><![CDATA[XChat is a full-featured IRC client and includes all basic functionalities that are found in most other IRC clients, including CTCP, DCC file transfers and chats, and a plugin system for various languages. By writing plugins, one can extend the features and customize the functionality of XChat. Ubuntu ..&#38;other APT based systems XChat for ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>XChat is a full-featured IRC client and includes all basic functionalities that are found in most other IRC clients, including CTCP, DCC file transfers and chats, and a plugin system for various languages. By writing plugins, one can extend the features and customize the functionality of XChat.<span id="more-182"></span></p>
<h2></h2>
<h2>Ubuntu</h2>
<h4>..&amp;other APT based systems</h4>
<p>XChat for ubuntu is free, and is open source, so to get it is simply a case of typing the following into the terminal;<br />
<pre>sudo apt-get install xchat</pre><script> devfmt_addAjaxBuffer(1, 182); </script><br />
However, the version in the repositories is often old, so you may want to go to <a href="http://xchat.org/files/binary/rpm/" target="_blank">xchat.org</a> directly and download it from there.</p>
<h2></h2>
<h2>Windows</h2>
<p>Strictly speaking, XChat for Windows <em>should</em> be free, due to it being under the GPL license, and the author having no copyrights registered over the entirety of the code, but the author has deemed that XChat for Windows is now Shareware, and costs $20, from the official site.</p>
<p>There are two separate sites which give you XChat for Windows, the first is <a href="http://xchat.org/windows/" target="_blank">XChat.org</a>, which is the official developers site. The <strong>Unofficial</strong> download site offers &#8216;YChat&#8217; which is XChat for windows renamed and released, and can be found at <a href="http://silverex.org/download/" target="_blank">silverex.org</a></p>
<p>Download the .exe file, and run it, you should have XChat installed quite happily.</p>
<h2></h2>
<h2>Mac OSX</h2>
<p>The version of XChat for Mac OSX is XChat Aqua and can be downloaded for free from here; <a href="http://www.uplinklabs.net/~tycho/projects/xchat-aqua/" target="_blank">http://xchataqua.sourceforge.net/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/install-xchat/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>HOW-TO &#8211; Install Joomla</title>
		<link>http://techtutz.com/how-to-install-joomla/</link>
		<comments>http://techtutz.com/how-to-install-joomla/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 23:13:03 +0000</pubDate>
		<dc:creator>Mikey</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=155</guid>
		<description><![CDATA[&#8220;Joomla is an award-winning content management system (CMS), which enables you to build Web sites and powerful online applications. Many aspects, including its ease-of-use and extensibility, have made Joomla the most popular Web site software available. Best of all, Joomla is an open source solution that is freely available to everyone.&#8221; Joomla is free to [...]]]></description>
			<content:encoded><![CDATA[<blockquote cite="joomla.org"><p>&#8220;Joomla is an award-winning content management system (CMS), which enables you to build Web sites and powerful online applications. Many aspects, including its ease-of-use and extensibility, have made Joomla the most popular Web site software available. Best of all, Joomla is an open source solution that is freely available to everyone.&#8221;</p></blockquote>
<p> Joomla is free to download from <a href="http://www.joomla.org/download.html" target="_blank">joomla.org</a>.<span id="more-155"></span></p>
<h2>Preparation</h2>
<div class="didyouknow"><strong>Don&#8217;t know how?</strong> Read How; <a href="http://howto.techtutz.com/add-a-database-with-phpmyadmin">PHPMyAdmin</a>, or <a href="http://howto.techtutz.com/create-a-mysql-database-command-line">Command Line Shell</a></div>
<p>First of all, you need to set up a database which your Joomla installation will run from. </p>
<p>Next, with the files which you downloaded from <a href="http://joomla.org" target="_blank">Joomla.org</a>, decompress the archive and upload them to your webserver with your favorite FTP client. Make sure you keep the directory structure intact.</p>
<p>Once all the files are uploaded, you need to navigate to the configuration.php-dist file, and rename it to <strong>configuration.php</strong>, then <a href="http://howto.techtutz.com/chmod"><abbr title="How to CHMOD">CHMOD</abbr></a> it to the value of <strong>777</strong>.</p>
<h2>Installation</h2>
<p>Next you need to actually run the installer, you do this by visiting the directory you uploaded Joomla into, (Ie /joomla) and you should be forwarded to the installer (located at yoursite.com/joomla/installation/). Once you&#8217;re at the installer, you need to choose your language and then hit next, in the top right hand corner. You will then be presented with a screen which runs all the checks, all of which should come back as a green &#8220;Yes&#8221;. If they are all yes, hit next.</p>
<p>Next, you need to agree to the license agreement, which you do by simply hitting next, in the top right corner. Now, you will be prompted with a screen where you must enter your database details (from the database you created earlier), enter all the details and hit next.</p>
<p>Now, you&#8217;re prompted with an &#8220;FTP Details&#8221; part of the installer, if you&#8217;re unsure why you would need this, you can leave this set to &#8220;No&#8221; and hit next. Now you need to fill in details such as your site name, admin email and password, etc. Make sure to click the button which says &#8220;Install Sample Data&#8221;.</p>
<p>Now, hit next and you&#8217;ll be prompted to delete the /installation directory.</p>
<p>That&#8217;s it! Joomla is installed!</p>
<h2>Further reading</h2>
<ol>
<li><a href="http://help.joomla.org/">Joomla Help</a></li>
<li><a href="http://extensions.joomla.org/">Joomla Extensions</a></li>
<li><a href="http://forum.joomla.org/">Joomla Forums</a></li>
<li><a href="http://www.joomla24.com/">Free Joomla Templates</a></li>
</ol>
<h2>This TechTut in Images</h2>
<p><a href='http://techtutz.com/how-to-install-joomla/howtojoomla1/' title='howtojoomla1'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/howtojoomla1-150x150.png" class="attachment-thumbnail" alt="howtojoomla1" title="howtojoomla1" /></a><br />
<a href='http://techtutz.com/how-to-install-joomla/howtojoomla2/' title='howtojoomla2'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/howtojoomla2-150x150.png" class="attachment-thumbnail" alt="howtojoomla2" title="howtojoomla2" /></a><br />
<a href='http://techtutz.com/how-to-install-joomla/howtojoomla3/' title='howtojoomla3'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/howtojoomla3-150x150.png" class="attachment-thumbnail" alt="howtojoomla3" title="howtojoomla3" /></a><br />
<a href='http://techtutz.com/how-to-install-joomla/howtojoomla4/' title='howtojoomla4'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/howtojoomla4-150x150.png" class="attachment-thumbnail" alt="howtojoomla4" title="howtojoomla4" /></a><br />
<a href='http://techtutz.com/how-to-install-joomla/howtojoomla5/' title='howtojoomla5'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/howtojoomla5-150x150.png" class="attachment-thumbnail" alt="howtojoomla5" title="howtojoomla5" /></a><br />
<a href='http://techtutz.com/how-to-install-joomla/howtojoomla6/' title='howtojoomla6'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/howtojoomla6-150x150.png" class="attachment-thumbnail" alt="howtojoomla6" title="howtojoomla6" /></a><br />
<a href='http://techtutz.com/how-to-install-joomla/howtojoomla7/' title='howtojoomla7'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/howtojoomla7-150x150.png" class="attachment-thumbnail" alt="howtojoomla7" title="howtojoomla7" /></a><br />
<a href='http://techtutz.com/how-to-install-joomla/howtojoomla8/' title='howtojoomla8'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/howtojoomla8-150x150.png" class="attachment-thumbnail" alt="howtojoomla8" title="howtojoomla8" /></a><br />
<a href='http://techtutz.com/how-to-install-joomla/joomla-featured/' title='joomla-featured'><img width="150" height="150" src="http://techtutz.com/wp-content/uploads/2010/09/joomla-featured-150x150.png" class="attachment-thumbnail" alt="joomla-featured" title="joomla-featured" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/how-to-install-joomla/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>HOW-TO &#8211; Add a Database with PHPMyAdmin</title>
		<link>http://techtutz.com/add-a-database-with-phpmyadmin/</link>
		<comments>http://techtutz.com/add-a-database-with-phpmyadmin/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 03:04:22 +0000</pubDate>
		<dc:creator>Mikey</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[5minutewonder]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=149</guid>
		<description><![CDATA[PHPMyAdmin is a useful MySQL web admin interface, which is free! This tutorial assumes that you&#8217;ve already completed the tutorial on How-to install PHPMyAdmin When PHPMyAdmin is installed, and you want to add a new database, you need to log in with the your username, this is the username you will use in any config [...]]]></description>
			<content:encoded><![CDATA[<p>PHPMyAdmin is a useful MySQL web admin interface, which is free! This tutorial assumes that you&#8217;ve already completed the tutorial on <a href="http://howto.techtutz.com/install-phpmyadmin" target="_blank">How-to install PHPMyAdmin</a></p>
<p><span id="more-149"></span></p>
<p style="text-align: center;"><a href="http://techtutz.com/wp-content/uploads/2010/09/newdb.png"><img class="size-medium wp-image-150 aligncenter" title="newdb" src="http://techtutz.com/wp-content/uploads/2010/09/newdb-300x171.png" alt="" width="300" height="171" /></a></p>
<p>When PHPMyAdmin is installed, and you want to add a new database, you need to log in with the your username, this is the username you will use in any config files and such. Once logged in, simply navigate to the input box which is near the center of the screen, type your database name, choose your database type from the dropdown menu, (if unsure leave it as default), and hit &#8216;Create&#8217;.</p>
<p>Congratulations, You&#8217;re done. To quote the WordPress installer, &#8220;Were you expecting more steps&#8230;?&#8221;</p>
<p>Things to note;</p>
<ol>
<li>The username and password you log in with are the database username and password</li>
<li>The name you enter will be the database name</li>
<li>Logging in (to PHPMyAdmin) and creating a database with the ROOT user, is NOT advised</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/add-a-database-with-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HOW-TO &#8211; Disable ROOT login</title>
		<link>http://techtutz.com/disable-root-login/</link>
		<comments>http://techtutz.com/disable-root-login/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 21:01:00 +0000</pubDate>
		<dc:creator>Mikey</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://techtutz.com/?p=145</guid>
		<description><![CDATA[The root account on unix based servers is the &#8220;super user&#8221;, with it, you can do anything with a simple command. No restrictions are in place on this account. You can even erase the entire filesystem with a simple command. If a hacker were able to gain access to your root account, your entire server [...]]]></description>
			<content:encoded><![CDATA[<p>The root account on unix based servers is the &#8220;super user&#8221;, with it, you can do anything with a simple command. No restrictions are in place on this account. You can even erase the entire filesystem with a simple command. If a hacker were able to gain access to your root account, your entire server and all sites hosted on it are in jeopardy. Hopefully now, you see why it is imperative that the root account is not permitted to log in through the normal channels.<span id="more-145"></span></p>
<p>Just a note, this only applies to VPS solutions and higher, and not shared solutions, where you are never allowed root access.</p>
<h2>Check if you are in the admin group</h2>
<p>Okay, first, you should have a sudo capable user. You can test this by logging into your usual account (you should most certainly have one of these, never ever use the root account as your primary account!), and typing &#8220;<pre>sudo su</pre><script> devfmt_addAjaxBuffer(1, 145); </script>&#8221;. If you have root access after you&#8217;ve typed in your password, you&#8217;re in the sudoers file, and can skip to <a href="#removeroot">disabling root</a></p>
<h2>How to add yourself to the admin group</h2>
<p>If, after running the above command, you get a message saying <pre>"You're not in the sudoers file, this incident will be reported". </pre><script> devfmt_addAjaxBuffer(2, 145); </script> Then you need to add yourself to the admin group. Log into your server as root, and  type <pre>usermod -G wheel username</pre><script> devfmt_addAjaxBuffer(3, 145); </script> where &#8220;username&#8221; is your username (Ie, techtutz, or bob). Then, type <pre>nano /etc/pam.d/su</pre><script> devfmt_addAjaxBuffer(4, 145); </script> and find the line: <pre># auth  required /lib/security/pam_wheel.so use_uid</pre><script> devfmt_addAjaxBuffer(5, 145); </script> and change it to <pre>auth  required /lib/security/pam_wheel.so use_uid</pre><script> devfmt_addAjaxBuffer(6, 145); </script>. Save the file by hitting ctrl+o, and you&#8217;ll be allowed to use &#8216;sudo&#8217; now.</p>
<h2><a id="removeroot">Disabling Root Login</a></h2>
<p>Now that all the preliminary tests are done, you may log into your server via ssh (shell), <strong>as root</strong>, and type the following command: <pre>nano /etc/ssh/ssh_config</pre><script> devfmt_addAjaxBuffer(7, 145); </script> and <abbr title="CTRL + W">find</abbr> the following line; <pre>#PermitRootLogin yes</pre><script> devfmt_addAjaxBuffer(8, 145); </script> and change it to <pre>PermitRootLogin no</pre><script> devfmt_addAjaxBuffer(9, 145); </script></p>
<p>Now, restart the SSH Daemon, by running the service command, like so; <pre>service sshd restart</pre><script> devfmt_addAjaxBuffer(10, 145); </script>, and the root user should be disallowed from logging in now. If you&#8217;re cautious, keep two SSH sessions open to your server, and only work from one of them, so that you don&#8217;t unwittingly lock yourself out of your server.</p>
]]></content:encoded>
			<wfw:commentRss>http://techtutz.com/disable-root-login/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 1490/1704 objects using disk: basic

Served from: techtutz.com @ 2012-05-20 14:38:54 -->
