<?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>gHacks technology news &#187; LAMP</title>
	<atom:link href="http://www.ghacks.net/tag/lamp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Wed, 25 Nov 2009 11:56:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to: Install a LAMP server</title>
		<link>http://www.ghacks.net/2009/07/23/how-to-install-a-lamp-server/</link>
		<comments>http://www.ghacks.net/2009/07/23/how-to-install-a-lamp-server/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 17:43:55 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[lamp server]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tasksel]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=14678</guid>
		<description><![CDATA[If you&#8217;ve read enough of my Ghacks tutorials you have most likely come across mention of a LAMP server. If you are not sure what a LAMP server is:

Linux
Apache
MySQL
P (can mean PHP or PERL &#8211; depends upon your needs)

LAMP servers are very popular, cheap, effective, flexible, and reliable servers. But how are they installed? Actually, [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve read enough of my Ghacks tutorials you have most likely come across mention of a LAMP server. If you are not sure what a LAMP server is:</p>
<ul>
<li>Linux</li>
<li>Apache</li>
<li>MySQL</li>
<li>P (can mean PHP or PERL &#8211; depends upon your needs)</li>
</ul>
<p>LAMP servers are very popular, cheap, effective, flexible, and reliable servers. But how are they installed? Actually, it&#8217;s not that hard. In this tutorial I am going to show you how to install a LAMP in two different ways: From the command line (using separate tools) and using the <em>tasksel</em> tool.</p>
<p><span id="more-14678"></span><strong>Hardware needed</strong></p>
<p>Fortunately a LAMP server can be installed on lower-end hardware and still serve as a fairly efficient server. Naturally if you are going to be using your LAMP server for high traffic, you will want to select your hardware wisely.</p>
<p><strong>Install prerequisite</strong></p>
<p>Before you begin the installation of your server you will need to have your operating system installed. This is the &#8220;L&#8221; of LAMP. So find your favorite Linux distribution and install the operating system. For the purposes of this installation I am going to be installing on a Ubuntu 9.04 server installation. This will be a console only server (no GUI desktop) which is fine because the installation is done via command line only.</p>
<p>Once you have your operating system installed you are ready to install your server.</p>
<p><strong>Apache</strong></p>
<p>This is the easiest portion to install. Either log in to your console or open up a terminal window (if you are working from a GUI desktop) and enter the following command:<br />
<code>sudo apt-get install apache2</code></p>
<p>You will have to enter your sudo user password for this installation to continue. Once this installation is complete check it by pointing a browser to that server IP address. You should instantly know if Apache is up and running.</p>
<p><strong>PHP</strong></p>
<p>For the purposes of this article we will assume the &#8220;P&#8221; stands for PHP. To install PHP (and all of its requirements) issue the command:</p>
<p><code>sudo apt-get install php5 libapache2-mod-php5</code></p>
<p>Once this installation is complete restart Apache with the command:</p>
<p><code>sudo /etc/init.d/apache2 restart</code></p>
<p>Let&#8217;s make sure this portion works properly. To test this create a file in the Apache document root (for this install it will be <strong>/var/www</strong>) called test.php. The contents of this file will be:<br />
<code>&lt; ?php phpinfo(); ?&gt;</code></p>
<p>Save that file and then point your browser to http://IP_ADDRESS/test.php</p>
<p>Where IP_ADDRESS is the actual IP address of your server.</p>
<p>You should see &#8220;Test PHP Page&#8221; written on your browsers page. If so, you&#8217;re good to go.</p>
<p><strong>MySQL</strong></p>
<p>Now to install MySQL. To do this issue the command:</p>
<p><code>sudo apt-get install mysql-server</code></p>
<p>Once this is done you then need to set a password for MySQL. To do this issue the command:</p>
<p><code>mysql -u root</code></p>
<p>which will put you in the MySQL prompt. From this prompt (which looks like <em>mysql&gt; </em>) enter the command:<br />
<code>SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORD');</code></p>
<p>Where YOURPASSWORD is the password you want to use for the mysql user.</p>
<p>Now start your MySQL server with the command:</p>
<p><code>/etc/init.d/mysql start</code></p>
<p>That&#8217;s it. Your LAMP server is up and running.</p>
<p><strong>The quick version</strong></p>
<p>You can actually install a full-on LAMP server on a (Ubuntu server install) with a single command:</p>
<p><code>sudo tasksel</code></p>
<p>You will need to select LAMP from the list and you will eventually be prompted for a MySQL password. That&#8217;s it.</p>
<p><strong>Final thoughts</strong></p>
<p>Getting a powerful, flexible web server up and running will take you less time and effort than you think. LAMP servers are an outstanding choice for your web servers&#8217; needs.</p>

	Tags: <a href="http://www.ghacks.net/tag/apache/" title="apache" rel="tag">apache</a>, <a href="http://www.ghacks.net/tag/lamp/" title="LAMP" rel="tag">LAMP</a>, <a href="http://www.ghacks.net/tag/lamp-server/" title="lamp server" rel="tag">lamp server</a>, <a href="http://www.ghacks.net/tag/mysql/" title="mysql" rel="tag">mysql</a>, <a href="http://www.ghacks.net/tag/php/" title="php" rel="tag">php</a>, <a href="http://www.ghacks.net/tag/tasksel/" title="tasksel" rel="tag">tasksel</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/12/28/portable-web-server/" title="Portable Web Server (December 28, 2008)">Portable Web Server</a> (8)</li>
	<li><a href="http://www.ghacks.net/2009/02/16/php-what-it-does-and-what-it-doesnt/" title="PHP &#8211; what it does and what it doesn&#8217;t (February 16, 2009)">PHP &#8211; what it does and what it doesn&#8217;t</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/09/17/local-apache-web-server-wampserver/" title="Local Apache Web Server Wampserver (September 17, 2009)">Local Apache Web Server Wampserver</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/01/02/web-development-standardizing-variables-to-code-faster/" title="Web Development: Standardizing variables to code faster (January 2, 2009)">Web Development: Standardizing variables to code faster</a> (18)</li>
	<li><a href="http://www.ghacks.net/2009/02/01/web-development-php-what-role-does-it-fill/" title="Web Development: PHP &#8211; what role does it fill (February 1, 2009)">Web Development: PHP &#8211; what role does it fill</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/07/23/how-to-install-a-lamp-server/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; what it does and what it doesn&#8217;t</title>
		<link>http://www.ghacks.net/2009/02/16/php-what-it-does-and-what-it-doesnt/</link>
		<comments>http://www.ghacks.net/2009/02/16/php-what-it-does-and-what-it-doesnt/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 19:28:22 +0000</pubDate>
		<dc:creator>Jeremiah</dc:creator>
				<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[website development]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=10600</guid>
		<description><![CDATA[PHP is a Server side scripting language. Its primary competitors are ASP (Microsoft), JSP (Sun), CFM (Adobe), and Perl (often called cgi by hosting companies, although it is not the only cgi language).
PHP was originally created in 1995, so as a technology it is fairly mature. Version 5.x is the latest stable version and 6 [...]]]></description>
			<content:encoded><![CDATA[<p>PHP is a Server side scripting language. Its primary competitors are ASP (Microsoft), JSP (Sun), CFM (Adobe), and Perl (often called cgi by hosting companies, although it is not the only cgi language).<br />
PHP was originally created in 1995, so as a technology it is fairly mature. Version 5.x is the latest stable version and 6 is under development. It is currently running almost 20 million websites including big names like <a href="http://www.ghacks.net/2009/10/17/facebook-login/">Facebook</a>.</p>
<p>The most common server architecture on which PHP is found is called LAMP (for Linux + Apache + MySQL + PHP). All of the elements of LAMP are open source, meaning that the source code of the application is freely available. This means that the cost of setting up a server running LAMP is reduced (No License Fees), so LAMP based web hosting tends to be the least expensive solution available.</p>
<p>The Internet is built on a client-server architecture. On the client side we have the user and the browser. One the server side we have the server and its script interpreter (In our case, Apache and PHP).<br />
Because PHP runs on the server side, we cannot use it for flashy client side effects, things like animations and auto-complete cannot be performed by php because php is only running on the server. For client side programming we could use javascript, Flash/Flex, Silverlight, or JavaFX.</p>
<p><span id="more-10600"></span>What we can do with PHP is access a database, connect to other websites/services for information, and build a page out of smaller pieces, which we then deliver to the client for rendering.</p>
<p>I think it is important to indicate at this time that there are four levels at which you can work with PHP.</p>
<ol>
<li>Scripting &#8211; this is where you take a small script and add it (integrate) into an existing page.</li>
<li>Coding &#8211; this is where you write scripts as needed to add basic functionality to your site.</li>
<li>Development &#8211; this is where you write an full application in PHP.</li>
<li>Architect &#8211; this is where you properly design an application that develop it into an application. Like development but puts a lot more thought into a good foundation.</li>
</ol>
<p>Depending on your actual needs, several of these layers could be overkill for your task. The following articles will mainly be focused on the first two levels &#8211; scripting, and coding. In Scripting and coding we have two primary tasks we accomplish. One makes your job as webmaster easier. The second adds new functionality to your site.</p>
<p><a href="http://www.jeremiahstover.com">Jeremiah Stover</a> is a Software Engineer and a Business IT Consultant at <a href="http://www.pragmatic-development.com">Pragmatic Development</a>. He has hands on experience and regularly provides practical advice in Business, Marketing, IT equipment and software. His Specialties include interpersonal communications, design skills, teaching and instruction. Right now he spends most of his time developing web applications in PHP and MySQL.</p>

	Tags: <a href="http://www.ghacks.net/tag/css/" title="css" rel="tag">css</a>, <a href="http://www.ghacks.net/tag/html/" title="html" rel="tag">html</a>, <a href="http://www.ghacks.net/tag/lamp/" title="LAMP" rel="tag">LAMP</a>, <a href="http://www.ghacks.net/tag/mysql/" title="mysql" rel="tag">mysql</a>, <a href="http://www.ghacks.net/tag/php/" title="php" rel="tag">php</a>, <a href="http://www.ghacks.net/tag/web-dev/" title="web dev" rel="tag">web dev</a>, <a href="http://www.ghacks.net/tag/web-development/" title="web development" rel="tag">web development</a>, <a href="http://www.ghacks.net/tag/website-development/" title="website development" rel="tag">website development</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/02/01/web-development-php-what-role-does-it-fill/" title="Web Development: PHP &#8211; what role does it fill (February 1, 2009)">Web Development: PHP &#8211; what role does it fill</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/02/02/ghacks-web-development-pdf-article-compilation-january-09/" title="Ghacks Web Development PDF Article Compilation January 09 (February 2, 2009)">Ghacks Web Development PDF Article Compilation January 09</a> (6)</li>
	<li><a href="http://www.ghacks.net/2009/01/31/web-development-html-playground/" title="Web Development: HTML Playground (January 31, 2009)">Web Development: HTML Playground</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/03/16/web-development-roundup/" title="Web development roundup (March 16, 2009)">Web development roundup</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/03/09/scriptastique-web-development-roundup/" title="Scriptastique web development roundup (March 9, 2009)">Scriptastique web development roundup</a> (4)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/02/16/php-what-it-does-and-what-it-doesnt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Install Drupal on a LAMP Server</title>
		<link>http://www.ghacks.net/2009/02/10/install-drupal-on-a-lamp-server/</link>
		<comments>http://www.ghacks.net/2009/02/10/install-drupal-on-a-lamp-server/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 00:19:03 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[content management system]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=10132</guid>
		<description><![CDATA[Drupal is one of the most popular of all the Content Management Systems (CMS). Drupal can power: Community portals, discussion forums, corporate sites, personal sites, blogs, e-commerce, and more. Drupal is open source (released under the GPL) and the only real installation restriction is that of the database. Drupal must use either a MySQL or [...]]]></description>
			<content:encoded><![CDATA[<p>Drupal is one of the most popular of all the Content Management Systems (CMS). Drupal can power: Community portals, discussion forums, corporate sites, personal sites, blogs, e-commerce, and more. <a title="Drupal" href="http://www.drupal.org" target="_blank">Drupal</a> is open source (released under the GPL) and the only real installation restriction is that of the database. Drupal must use either a MySQL or a PosgreSQL database to connect to.</p>
<p>One of the simplest installation is on a LAMP (Linux Apache MySQL PHP) server. Before you go on, however, I will highly suggest you install PhpMyAdmin so the database creation is simple. For more information take a look at my <a href="http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/">Install PhpMyAdmin for easy MySQL Administration</a> article. Once you have PhpMyAdmin installed you will want to create a database for your installation. You can name the database whatever you want, just make sure you remember the name. With your LAMP server up and running you have the most difficult aspect of the installation out of the way. All that is left is the actual installation of Drupal.</p>
<p><span id="more-10132"></span>Your first step is to download the latest release of Drupal from the <a title="Drupal download page" href="http://drupal.org/drupal-6.9" target="_blank">Drupal download page</a>. Once you have that file downloaded move it to your web servers&#8217; document root. You will need root access to undertake these steps so you will with <em>su<strong> </strong></em>to root or use <em>sudo</em>.</p>
<p>Unpack the Drupal file. This will most likely be done with the <em>tar xvzf drupal-XXX.tar.gz </em>command (Where <em>XXX</em> is the actual realease number). This will create a new directory called <strong>drupal-XXX </strong>(Where <strong>XXX</strong> is the release number). Now, I always change the name of this directory for simplicity. I will either rename this directory to <strong>main</strong> or something easy to remember. You can also move the entire contents of the directory into the document root. The only issue this can cause is if you are installing multiple sites on the same server. For that reason I tend to keep the Drupal install in its very own directory.</p>
<p>Once you have this file unpacked and the directory renamed, the fun begins. Fire up your browser and point it to <em>http://path/to/installation/ </em>(Where <em>path/to/installation </em>is the entire path to the Drupal installation. For example <em>http://192.168.1.10/main/</em>.) This will automatically start up the installation process.</p>
<div id="attachment_10442" class="wp-caption alignleft" style="width: 310px"><a href="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install1.png"><img class="size-medium wp-image-10442" src="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install1-500x382.png" alt="Step 1" width="300" height="229" /></a><p class="wp-caption-text">Step 1</p></div>
<p>The first step in the installation is to select your language. The default will be English. If you need to install Drupal in another language select the obvious link. Once you click the appropriate link you will be taken to the next step.</p>
<div id="attachment_10443" class="wp-caption alignright" style="width: 310px"><a href="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install2.png"><img class="size-medium wp-image-10443" src="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install2-500x382.png" alt="Step 2" width="300" height="229" /></a><p class="wp-caption-text">Step 2</p></div>
<p>Step 2 requires that you change the name of the <em>default.settings.php </em>to <em>settings.php</em>. This file will be found in the <strong>/var/www/html/main/sites/default/ </strong>directory (This will depend upon your installation of course.) You also need to change the permissions of this file so it is writable by the web server. You can do this with the command <em>chmod g+w settings.php</em>. One last step is to create the directory <strong>sites/default/files</strong> with the command (from within your web servers&#8217; document root) <em>mkdir sites/default/files</em>. You may get another error when you click <em>try again</em>. If you do this is a permissions error. Enter the command <em>chmod -R g+w sites/default/files</em> which should solve the problem.</p>
<div id="attachment_10444" class="wp-caption alignleft" style="width: 310px"><a href="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install4.png"><img class="size-medium wp-image-10444" src="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install4-500x382.png" alt="Step 3" width="300" height="229" /></a><p class="wp-caption-text">Step 3</p></div>
<p>Now it is time to set up your database. Remember the database you created with PhpMyAdmin? This is where that information goes.</p>
<p>Once you fill out this information click Save and Continue to move on. You&#8217;re almost done.</p>
<div id="attachment_10446" class="wp-caption alignright" style="width: 310px"><a href="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install51.png"><img class="size-medium wp-image-10446" src="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install51-500x382.png" alt="Step 4" width="300" height="229" /></a><p class="wp-caption-text">Step 4</p></div>
<p>Just a couple more steps. Now you can remove write permissions on the settings.php file (<em>chmod o-w settings.php</em>) and enter the configuration information for your site. The information you need to provide is self explanitory. Once you have finished save the information and you&#8217;re done. You will be greeted with the &#8220;Installation Complete&#8221; page!</p>
<div id="attachment_10447" class="wp-caption alignleft" style="width: 310px"><a href="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install6.png"><img class="size-medium wp-image-10447" src="http://www.ghacks.net/wp-content/uploads/2009/02/drupal_install6-500x382.png" alt="Installation Complete" width="300" height="229" /></a><p class="wp-caption-text">Installation Complete</p></div>
<p><strong>Final Thoughts</strong></p>
<p>You can now log in with your administrator name (you will have created that in the site configuration page above) and start building your site. Drupal is an outstanding Content Management System you will quickly come to depend upon for many of your website rollouts.</p>

	Tags: <a href="http://www.ghacks.net/tag/cms/" title="CMS" rel="tag">CMS</a>, <a href="http://www.ghacks.net/tag/content-management-system/" title="content management system" rel="tag">content management system</a>, <a href="http://www.ghacks.net/tag/drupal/" title="Drupal" rel="tag">Drupal</a>, <a href="http://www.ghacks.net/tag/lamp/" title="LAMP" rel="tag">LAMP</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/phpmyadmin/" title="phpmyadmin" rel="tag">phpmyadmin</a>, <a href="http://www.ghacks.net/tag/website/" title="website" rel="tag">website</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/" title="Install phpmyadmin for easy MySQL administration (December 20, 2008)">Install phpmyadmin for easy MySQL administration</a> (6)</li>
	<li><a href="http://www.ghacks.net/2009/01/22/back-up-your-apache-web-directory-and-database-with-this-simple-script/" title="Back up your Apache web directory and database with this simple script (January 22, 2009)">Back up your Apache web directory and database with this simple script</a> (0)</li>
	<li><a href="http://www.ghacks.net/2008/08/05/zoundry-raven-portable-blog-editor/" title="Zoundry Raven portable Blog Editor (August 5, 2008)">Zoundry Raven portable Blog Editor</a> (6)</li>
	<li><a href="http://www.ghacks.net/2008/02/07/yoggie-pico-personal-mobile-security-computer/" title="Yoggie PICO Personal Mobile Security Computer (February 7, 2008)">Yoggie PICO Personal Mobile Security Computer</a> (3)</li>
	<li><a href="http://www.ghacks.net/2008/07/27/wordpress-issues/" title="Wordpress Issues (July 27, 2008)">Wordpress Issues</a> (16)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/02/10/install-drupal-on-a-lamp-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Back up your Apache web directory and database with this simple script</title>
		<link>http://www.ghacks.net/2009/01/22/back-up-your-apache-web-directory-and-database-with-this-simple-script/</link>
		<comments>http://www.ghacks.net/2009/01/22/back-up-your-apache-web-directory-and-database-with-this-simple-script/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 18:58:34 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[automated backups]]></category>
		<category><![CDATA[backup-solution]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=10060</guid>
		<description><![CDATA[I administer a lot of web sites. And all of these web sites need backup solutions. Since most of those web sites use LAMP servers it only made sense to set up a backup system using the available, included open source tools. It didn&#8217;t take long to create a solid backup system and, with the [...]]]></description>
			<content:encoded><![CDATA[<p>I administer a lot of web sites. And all of these web sites need backup solutions. Since most of those web sites use LAMP servers it only made sense to set up a backup system using the available, included open source tools. It didn&#8217;t take long to create a solid backup system and, with the help of cron, automate that system so that Apache&#8217;s document root and the website databases were backed up regularly and without user intervention.</p>
<p>The script made use of the following tools: date, cat, tar, mv, and rm. That&#8217;s it. The script will create backups with the date in the file name and then move the backups to a central location. Without further adieu, let&#8217;s get to the script.</p>
<p><span id="more-10060"></span><em>#! /bin/sh</em></p>
<p><em>TMP=&#8221;/tmp/&#8221;</em></p>
<p><em>#Format the date in YEAR-MO-DY format<br />
TODAY=`date +%F`</em></p>
<p><em># Check to see if there is a lastbackup file in /tmp, if not create it,<br />
# if so then set LAST equal to $TODAY<br />
if [ -f /tmp/lastbackup ]; then<br />
LAST=`cat /tmp/lastbackup`<br />
else<br />
LAST=$TODAY<br />
fi</em></p>
<p><em># Set the web directory backup name to the following<br />
WEB_FILENAME=&#8221;inc-&#8221;$TODAY&#8221;-web.tar.gz&#8221;</em></p>
<p><em># Set database backup name to the following<br />
DB_FILENAME=&#8221;inc-&#8221;$TODAY&#8221;-db.tar.gz&#8221;</em></p>
<p><em># this tars up my web directory into web.tar.gz tarball.<br />
/bin/tar -czf $TMP$WEB_FILENAME &#8211;after-date=$LAST /var/www/html</em></p>
<p><em># Move the web back to the backup directory<br />
/bin/mv $TMP$WEB_FILENAME /data</em></p>
<p><em># Remove web backup file from temp director<br />
rm $TMP$WEB_FILENAME</em></p>
<p><em># this tars up my database directory into $TODAY-db.tar.gz tarball.<br />
/bin/tar -czf $TMP$DB_FILENAME &#8211;after-date=$LAST /var/lib/mysql</em></p>
<p><em># Move the backup database to the backup directory<br />
/bin/mv $TMP$DB_FILENAME /data</em></p>
<p><em># Remove web backup file from temp directory<br />
rm $TMP$DB_FILENAME<br />
</em></p>
<p>What I wanted this to do is create daily backups and move the backups to the <strong>/data</strong> directory on the drive housing the server. These backups will be saved for one month. After the month is completed i have a second script that deletes the months backups prior to running the next backup (so there is always a backup to fall to). How I made use of this script is simple. I save the script (called <strong>backup.sh</strong>) in the root user directory and create a second script called <strong>rm_backups.sh</strong> that looks like this:</p>
<p><em>#! /bin/sh</em></p>
<p><em>rm /data/*gz</em></p>
<p>With these two files in place I create two cron entries. The first cron entry is for running the <strong>backup.sh</strong> script and looks like:</p>
<p>0 23 * * *     ~/backup.sh</p>
<p>The second cron entry is for running the <strong>rm_backups.sh</strong> script and looks like:</p>
<p>0 20 1 * *     ~/rm_backups.sh</p>
<p>Both of the above cron jobs are created as the root user.</p>
<p><strong>Final Thoughts</strong></p>
<p>Naturally this solution could be easily modified (using such tools rsync) to set up an offsite backup solution. What should be obvious is that creating a simple, flexible server backup system on Linux is easy. With the help of a little ingenuity, you can create your own automated backup service.</p>

	Tags: <a href="http://www.ghacks.net/tag/automated-backups/" title="automated backups" rel="tag">automated backups</a>, <a href="http://www.ghacks.net/tag/backup-solution/" title="backup-solution" rel="tag">backup-solution</a>, <a href="http://www.ghacks.net/tag/backups/" title="backups" rel="tag">backups</a>, <a href="http://www.ghacks.net/tag/cat/" title="cat" rel="tag">cat</a>, <a href="http://www.ghacks.net/tag/cron/" title="cron" rel="tag">cron</a>, <a href="http://www.ghacks.net/tag/date/" title="date" rel="tag">date</a>, <a href="http://www.ghacks.net/tag/lamp/" title="LAMP" rel="tag">LAMP</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/tar/" title="tar" rel="tag">tar</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/01/11/using-cron-to-automate-linux-tasks/" title="Using Cron to Automate Linux Tasks (January 11, 2009)">Using Cron to Automate Linux Tasks</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/02/15/quick-archiving-in-gnome/" title="Quick Archiving in GNOME (February 15, 2009)">Quick Archiving in GNOME</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/10/10/linux-back-in-time-backup-made-easy/" title="Linux Back In Time: Backup made easy (October 10, 2009)">Linux Back In Time: Backup made easy</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/02/19/installing-firefox-and-flash-from-source/" title="Installing Firefox and Flash From Source (February 19, 2009)">Installing Firefox and Flash From Source</a> (8)</li>
	<li><a href="http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/" title="Install phpmyadmin for easy MySQL administration (December 20, 2008)">Install phpmyadmin for easy MySQL administration</a> (6)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/01/22/back-up-your-apache-web-directory-and-database-with-this-simple-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install phpmyadmin for easy MySQL administration</title>
		<link>http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/</link>
		<comments>http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 01:17:26 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[The Web]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux database server]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=9194</guid>
		<description><![CDATA[I have been working with LAMP (Linux Apache, MySQL, PHP) servers for a long time. But not matter how much experience I have with them one of the first things I, do after the LAMP installation, is to install phpMyAdmin. This tool makes database administration so much easier than the command line. And when your [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working with LAMP (Linux Apache, MySQL, PHP) servers for a long time. But not matter how much experience I have with them one of the first things I, do after the LAMP installation, is to install phpMyAdmin. This tool makes database administration so much easier than the command line. And when your job is rolling out sites that depend upon MySQL databases, you know how quickly MySQL can fubar a quick deployment.</p>
<p>In this article you will learn how to install and configure the phpMyAdmin MySQL tool.</p>
<p><span id="more-9194"></span>The first step is to download phpMyAdmin. You can get this tool from the <a title="phpMyAdmin download page" href="http://www.phpmyadmin.net/home_page/downloads.php" target="_blank">phpMyAdmin download page</a>. Once you have this downloaded you will need to move the file into the document root of your web server (you will need to have root or sudo access to do this and the setup) Most likely this will be either <em>/var/www/html </em>or <em>/var/www</em>. Once you have this file in the proper locaton it is time to take care of business.</p>
<p>The first thing to do is to unpack the file. The unpacking command will depend upon what file format you download. Let&#8217;s use the .gz file for an example. With the file <a href="http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-3.1.1-english.tar.gz?download#%21md5%217b92c4a670bba085484e7f3a7c25e825">phpMyAdmin-3.1.1-english.tar.gz</a> in place issue the command:</p>
<p>tar xvzf phpMyAdmin-3.11-english.tar.gz</p>
<p>The resulting directory will be <strong>phpMyAdmin</strong>. I highly recommend changing the name of that directory to something easier to navigate and remember. I generally just change the directory with the command <em>mv phpMyAdmin phpmyadmin</em>.</p>
<p>Now that the directory is correct move into the directory. There is one file in particular you must have which is the <strong>config.inc.php<em> </em></strong>file. You will notice there is a file called <strong>config.sample.inc.php</strong>. Some documentation instructs to change the name of <strong>config.sample.inc.php</strong> to <strong>config.inc.php</strong> and make your changes from within that file. It is my opinion that method can become confusing with all of the extra options included. Instead create the new config file with the following contents (depending upon your setup):</p>
<p><code>&lt;?php<br />
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */<br />
/*<br />
* Servers configuration<br />
*/<br />
$i = 0;<br />
/*<br />
* First server<br />
*/<br />
$i++;<br />
$cfg['Servers'][$i]['user'] = 'root';<br />
$cfg['Servers'][$i]['password'] = 'ROOT_PASSWORD';<br />
$cfg['Servers'][$i]['verbose'] = '';<br />
$cfg['Servers'][$i]['host'] = 'localhost';<br />
$cfg['Servers'][$i]['port'] = '';<br />
$cfg['Servers'][$i]['socket'] = '';<br />
$cfg['Servers'][$i]['connect_type'] = 'tcp';<br />
$cfg['Servers'][$i]['extension'] = 'mysqli';<br />
$cfg['Servers'][$i]['auth_type'] = 'config';<br />
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;<br />
$cfg['Servers'][$i]['nopassword'] = true;<br />
?&gt;<br />
</code></p>
<p>There are a few pieces to note. First make sure you use the actual root mysql password where you see ROOT_PASSWORD. Also, if you want to prompted each time for your login information change <em>&#8216;config&#8217; </em>to <em>&#8216;cookie&#8217;</em> in the <em>&#8216;auth_type&#8217; </em>line.</p>
<p>Once you have that configuration file in place you should be able to log into your phpmyadmin system. To do this you will enter http://ADDRESS_TO_SERVER/phpmyadmin/ in your browser (where ADDRESS_TO_SERVER is the IP Address or URL that points to the server.</p>
<p>If, for some reason, this configuration file does not work for you give the web-based setup script a try. To run this point your browser to http://ADDRESS_TO_SERVER/phpmyadmin/setup<em> </em>to start the graphical setup process.</p>
<p>After you are logged in it should be pretty obvious how to create a new database. You simple enter thename you want to give the database and click the Create button.</p>
<p>You&#8217;re done! You now have a phpmyadmin install ready to serve you.</p>

	Tags: <a href="http://www.ghacks.net/tag/database/" title="database" rel="tag">database</a>, <a href="http://www.ghacks.net/tag/lamp/" title="LAMP" rel="tag">LAMP</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/linux-database-server/" title="Linux database server" rel="tag">Linux database server</a>, <a href="http://www.ghacks.net/tag/mysql/" title="mysql" rel="tag">mysql</a>, <a href="http://www.ghacks.net/tag/phpmyadmin/" title="phpmyadmin" rel="tag">phpmyadmin</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/04/09/set-up-mysql-database-replication/" title="Set up MySQL database replication (April 9, 2009)">Set up MySQL database replication</a> (1)</li>
	<li><a href="http://www.ghacks.net/2009/02/10/install-drupal-on-a-lamp-server/" title="Install Drupal on a LAMP Server (February 10, 2009)">Install Drupal on a LAMP Server</a> (2)</li>
	<li><a href="http://www.ghacks.net/2009/01/12/backup-mysql-databases-in-linux-regularly/" title="Backup MySQL Databases In Linux Regularly (January 12, 2009)">Backup MySQL Databases In Linux Regularly</a> (11)</li>
	<li><a href="http://www.ghacks.net/2009/02/16/php-what-it-does-and-what-it-doesnt/" title="PHP &#8211; what it does and what it doesn&#8217;t (February 16, 2009)">PHP &#8211; what it does and what it doesn&#8217;t</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/07/23/how-to-install-a-lamp-server/" title="How to: Install a LAMP server (July 23, 2009)">How to: Install a LAMP server</a> (7)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2008/12/20/install-phpmyadmin-for-easy-mysql-administration/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
