<?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>mFabrik - mobile sites, apps, HTML5 and CMS software development &#187; linux</title>
	<atom:link href="http://blog.mfabrik.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Wed, 03 Aug 2011 09:47:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>One-liner to copy remote MySQL database to local computer</title>
		<link>http://blog.mfabrik.com/2011/07/23/one-liner-to-copy-remote-mysql-database-to-local-computer/</link>
		<comments>http://blog.mfabrik.com/2011/07/23/one-liner-to-copy-remote-mysql-database-to-local-computer/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 16:20:58 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[grant]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=1325</guid>
		<description><![CDATA[The following commands dump a MySQL database from a remote server and create a corresponding database on the local computer. The instructions have been tested on OSX and Linux (Ubuntu/Debian). On-line SSH compression is applied, so transferring SQL files, which are text content and compress well, should be around 6x faster than normal. (Well… actually [...]]]></description>
			<content:encoded><![CDATA[<div class="body">
<p>The following commands dump a MySQL database from a remote server and create a corresponding database on the local computer.</p>
<p>The instructions have been tested on OSX and Linux (Ubuntu/Debian). On-line SSH compression is applied, so transferring SQL files, which are text content and compress well, should be around 6x faster than normal.</p>
<p>(Well… actually the script is six lines, but because this is my blog I&#8217;ll decide it doesn&#8217;t count)</p>
<p>The script</p>
<ul class="simple">
<li>Remotely runs mysqldump and puts the result to a local file</li>
<li>Creates a MySQL database and corresponding user with full access to this database</li>
<li>Reads the content of mysqldump to the newly created database</li>
</ul>
<pre class="literal-block"> ssh user@dserver.com -C -o CompressionLevel=9 mysqldump -u YOURDATABASEUSER --password=YOURDATABASEPASSWORD --skip-lock-tables --add-drop-table YOURDATABASENAME &gt; YOURDATABASENAME.sql
mysql -uroot -p
create database YOURDATABASENAME;
connect YOURDATABASENAME;
source YOURDATABASENAME.sql
GRANT ALL ON YOURDATABASENAME.* TO 'YOURDATABASEUSER'@'localhost' identified by 'YOURDATABASEPASSWORD';</pre>
<p>Leave out <tt class="docutils literal">create database</tt> and <tt class="docutils literal">GRANT</tt> for the subsequent runs &#8211; all data on the local computer will be replaced.</p>
</div>
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2011/07/23/one-liner-to-copy-remote-mysql-database-to-local-computer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypted folders on Ubuntu Linux using eCryptfs on an external hard drive</title>
		<link>http://blog.mfabrik.com/2011/04/15/encrypted-folders-on-ubuntu-linux-using-ecryptfs-on-an-external-hard-drive/</link>
		<comments>http://blog.mfabrik.com/2011/04/15/encrypted-folders-on-ubuntu-linux-using-ecryptfs-on-an-external-hard-drive/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 12:35:12 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[crypted]]></category>
		<category><![CDATA[ecryptfs]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[folder]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[partition]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=1199</guid>
		<description><![CDATA[This blog post continues my Ubuntu encryption tools testing. Previously there was an example for losetup. However, with the latest Ubuntus eCryptfs is recommended instead. eCrypfs makes one directory in a file-system crypted. Since it does not work on a partition level, you do not need to worry about extending or shrinking the encrypted partition [...]]]></description>
			<content:encoded><![CDATA[<p>This blog post continues my Ubuntu encryption tools testing. Previously there was an example for <a href="http://blog.mfabrik.com/2011/04/02/encrypted-partition-on-an-external-hard-disk-in-ubuntu-linux/">losetup</a>. However, with the latest Ubuntus <a href="https://help.ubuntu.com/community/EncryptedPrivateDirectory">eCryptfs</a> is recommended instead.</p>
<p>eCrypfs makes one directory in a file-system crypted. Since it does not work on a partition level, you do not need to worry about extending or shrinking the encrypted partition inside the uncrypted partition. Instead, file system works normally and only the content of the files are encrypted. This should also add some more fault tolerance in the case of disk failure &#8211; it is less unlikely to loose the whole encrypted partition.</p>
<p>Here we create an encrypted directory on an external hard drive</p>
<ul>
<li>First format the drive with ext4 file-system (mkfs.ext4)</li>
</ul>
<p>Prepare a passphrase in a .TXT file (you won&#8217;t be asked to type mistyped passphrase again).</p>
<p>Then go to the mounted disk</p>
<pre>cd /media/fbf0a2c3-0631-4a00-ad1b-a34e449c8b2a/
mkdir crypted
chmod 700 crypted/
sudo mount -t ecryptfs crypted/ crypted/</pre>
<p>Copy-paste in the passphrase and otherwise use the default settings given by ecryptfs.</p>
<p>Voilá. Now your encrypted folder is ready. It is not accessible if you do not mount it with eCryptfs and enter the passphrase.</p>
<p>We can test it with umount and mounting it again. It will ask passphrase and  format options again:</p>
<pre>echo "foobar" &gt; test.txt
umount /media/fbf0a2c3-0631-4a00-ad1b-a34e449c8b2a/crypted
cd crypted
cat test.txt</pre>
<p>You will see garbled output instead of the file contents. But after you remount it it works again:</p>
<pre>mount -t ecryptfs crypted/ crypted/</pre>
<p>Just give the passphrase and hit enter to all options (again).</p>
<h2>More info</h2>
<ul>
<li><a href="http://www.ubuntugeek.com/how-to-create-a-private-encrypted-folder-on-ubuntu-810-intrepid.html">How to create encrypted directories using eCryptsfs</a></li>
</ul>
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2011/04/15/encrypted-folders-on-ubuntu-linux-using-ecryptfs-on-an-external-hard-drive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sticky session load balancing with Apache and mod_balancer on Ubuntu Linux</title>
		<link>http://blog.mfabrik.com/2011/04/15/sticky-session-load-balancing-with-apache-and-mod_balancer-on-ubuntu-linux/</link>
		<comments>http://blog.mfabrik.com/2011/04/15/sticky-session-load-balancing-with-apache-and-mod_balancer-on-ubuntu-linux/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 08:19:25 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[balancer]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[mod_balancer]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[sticky]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=1223</guid>
		<description><![CDATA[Apache 2.2 can do load balancing with sticky sessions. However, there is a catch. You need to use mod_headers module to set a cookie based on the chosen balancer member for the first request and then route the subsequent requests to this client. Use cases You are running a backend servers behind Apache You need [...]]]></description>
			<content:encoded><![CDATA[<p>Apache 2.2 can do load balancing with sticky sessions. However, there is a catch. You need to use mod_headers module to set a cookie based on the chosen balancer member for the first request and then route the subsequent requests to this client.</p>
<p>Use cases</p>
<ul>
<li>You are running a backend servers behind Apache</li>
<li>You need to make sure that the users are served from the same backend every time: the backend itself caches or stores user specific data and this data is not shared across the backends. <a href="http://stackoverflow.com/questions/5650716/are-sticky-sessions-needed-when-load-balancing-plone-3-3-5/5656295#5656295">For example, Plone 3 may have issues with content item creation if sticky sessions are not used</a>.</li>
</ul>
<p>The method described here works in every situation and does not rely on client IP address, etc. The only downside is that if one balancer member goes down all subsequent requests for it will die. So this method can be only used for load balancing, not for high availability (I am not sure if BALANCER_ROUTE_CHANGED environment variable is set when a balancer member is lost and would redirect the clients to a new balancer member).</p>
<p>This requests were tested on Ubuntu Linux, but may as well work in other environments.</p>
<h2>Setting route configution in virtual host</h2>
<p>Create a balancer</p>
<pre>&lt;Proxy balancer://yourlb&gt;
 BalancerMember http://127.0.0.1:13001/ route=1
 BalancerMember http://127.0.0.1:13002/ route=2
 BalancerMember http://127.0.0.1:13003/ route=3
 BalancerMember http://127.0.0.1:13004/ route=4
&lt;/Proxy&gt;</pre>
<p>Set the cookie using mod_headers. Note that the cookie must be in format [session name].[route id] (the dot is required). It seems to be possible to leave session name empty.</p>
<pre>Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED</pre>
<p>Make ProxyPass  follow the cookie (Zope virtual host monster style with HTTPS)</p>
<pre>ProxyPass / balancer://lbsits/http://localhost/VirtualHostBase/https/yoursite.org:443/yourplonesiteid/VirtualHostRoot/ stickysession=ROUTEID</pre>
<p><em>Note: Hard restart is required. apache2ctl graceful is not enough to make new balancer rules effective.<br />
</em></p>
<h2>Testing</h2>
<p>Use wget</p>
<pre>wget -S https://yoursite.org/</pre>
<p>See that Set-Cookie: ROUTE_ID is present and it contains a valid value (is not empty)</p>
<pre>HTTP/1.1 200 OK
 Date: Wed, 13 Apr 2011 15:21:52 GMT
 Server: Zope/(Zope 2.10.9-final, python 2.4.5, linux2) ZServer/1.1 Plone/3.3.3
 Content-Length: 23197
 Expires: Sat, 01 Jan 2000 00:00:00 GMT
 Content-Type: text/html;charset=utf-8
 Content-Language: en
 Set-Cookie: I18N_LANGUAGE="en"; Path=/
 Set-Cookie: ROUTEID=.1; path=/</pre>
<h2>More info</h2>
<ul>
<li><a href="http://blog.mfabrik.com/2011/03/21/session-affinity-sticky-with-nginx-load-balancing/">Sticky sessions with Nginx</a></li>
<li><a href="http://httpd.apache.org/docs/trunk/mod/mod_proxy_balancer.html#example">mod_proxy_balancer example</a></li>
<li><a href="http://collective-docs.plone.org/hosting/apache.html">Misc. Apache docs for Plone</a></li>
</ul>
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2011/04/15/sticky-session-load-balancing-with-apache-and-mod_balancer-on-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypted partition on an external hard disk in Ubuntu Linux</title>
		<link>http://blog.mfabrik.com/2011/04/02/encrypted-partition-on-an-external-hard-disk-in-ubuntu-linux/</link>
		<comments>http://blog.mfabrik.com/2011/04/02/encrypted-partition-on-an-external-hard-disk-in-ubuntu-linux/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 11:21:57 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[crypt]]></category>
		<category><![CDATA[cryptoloop]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[ext4]]></category>
		<category><![CDATA[losetup]]></category>
		<category><![CDATA[modprobe]]></category>
		<category><![CDATA[mount]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=1188</guid>
		<description><![CDATA[Here are short instructions how to create and use encrypted hard disk on Ubuntu Linux. These instructions are tested on Ubuntu 10.10 Maverick Meekat. We are going to use the following strategy Use cryptoloop kernel module. This is 100% open source software and the part of mainstream Linux (as opposite to TrueCrypt) No additional software [...]]]></description>
			<content:encoded><![CDATA[<p>Here are short instructions how to create and use encrypted hard disk on Ubuntu Linux. These instructions are tested on Ubuntu 10.10 Maverick Meekat.</p>
<p>We are going to use the following strategy</p>
<ul>
<li>Use cryptoloop kernel module. This is 100% open source software and the part of mainstream Linux (as opposite to TrueCrypt)</li>
<li>No additional software installations needed &#8211; stock Ubuntu is fine</li>
<li>These instructions work also on a server &#8211; no GUI needed</li>
<li>We will create an encrypted file on the target hard-drive partition. The target partition can be even NTFS, so the hard disk acts normally in Windows, though you still need Linux to read encrypted files</li>
<li>The encrypted file system will be Ext4 and mounted through a loop device</li>
</ul>
<h2>Prerequisites</h2>
<ul>
<li>Ubuntu Linux</li>
<li>Basic terminal / command-line know how</li>
</ul>
<h2>Creating an encrypted partition on an external driver</h2>
<p>Plug-in the hard disk to Ubuntu Desktop &#8211; it will automount it over USB.</p>
<p>Install cryptoloop driver</p>
<pre>    sudo modprobe cryptoloop</pre>
<p>Check what mount point the new disk has &#8211; in your case it is <em>/media/Elements</em>:</p>
<pre>ls /media
cdrom  cdrom0  Elements</pre>
<p>Check how much space the disk contains</p>
<pre>df -h
/dev/sdc1             932G   94M  932G   1% /media/Elements</pre>
<p>Create a loopback file &#8211; don&#8217;t use the whole disk. In our case, allocate just 500 GB for the encrypted file system. Note that this may take time:</p>
<pre>dd if=/dev/zero bs=1G count=500 of=/media/Elements/encrypted-fs</pre>
<p>Now mount this file as a crypted loopback device. Note that need you to give separate password for sudo and the encryption. We use SHA-1 encryption. Don&#8217;t use password, use passphrase. SHA-1 has 160 bit key and <a href="http://en.wikipedia.org/wiki/Password_strength#Password_strength_depends_on_symbol_set_and_length">to produce enough entropy, you need a latin sentence of at least 27 case-sensitive alphanumeric characters</a>. We do this using <a href="http://linuxcommand.org/man_pages/losetup8.html">losetup</a> command.</p>
<pre>sudo losetup -e sha1 /dev/loop0 /media/Elements/encrypted-fs</pre>
<p>Then format this encrypted partition as ext4 file system.</p>
<pre>mkfs.ext4 /dev/loop0</pre>
<p>And now start using it</p>
<pre>mkdir /media/encrypted
mount /dev/loop0 /media/encrypted</pre>
<h2>Usage</h2>
<p>Later when you remount the encrypted partition you can simply do</p>
<pre>sudo losetup -e sha1 /dev/loop0 /media/Elements/encrypted-fs
mount /dev/loop0 /media/encrypted</pre>
<p>After usage always cleanly unmount the encrypted partition before unplugging the external hard-drive</p>
<pre>umount /media/encrypted</pre>
<h2>More info</h2>
<ul>
<li><a href="https://help.ubuntu.com/community/EncryptedFilesystemHowto">https://help.ubuntu.com/community/EncryptedFilesystemHowto</a></li>
<li><a href="http://www.ppcnerds.org/index.php?name=News&amp;file=article&amp;sid=186&amp;newlang=ita">http://www.ppcnerds.org/index.php?name=News&amp;file=article&amp;sid=186&amp;newlang=ita</a> (see the new way section)</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2011/04/02/encrypted-partition-on-an-external-hard-disk-in-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Copy/move phpBB3 forum from a server to another computer (Ubuntu/Linux)</title>
		<link>http://blog.mfabrik.com/2011/03/30/copymove-phpbb3-forum-from-a-server-to-another-computer-ubuntulinux/</link>
		<comments>http://blog.mfabrik.com/2011/03/30/copymove-phpbb3-forum-from-a-server-to-another-computer-ubuntulinux/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 13:40:11 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2ctl]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[phpbb3]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=1179</guid>
		<description><![CDATA[Here are short instructions what you need to do in order to move / copy phpBB3 forum. Prerequisites What you need in order to benefit from these instructions Basic UNIX command-line knowledge SSH access to the server MySQL access to the database LAMP stack ready on the new server These instructions have been tested on [...]]]></description>
			<content:encoded><![CDATA[<p>Here are short instructions what you need to do in order to move / copy phpBB3 forum.</p>
<h2>Prerequisites</h2>
<p>What you need in order to benefit from these instructions</p>
<ul>
<li>Basic UNIX command-line knowledge</li>
<li>SSH access to the server</li>
<li>MySQL access to the database</li>
<li>LAMP stack ready on the new server</li>
</ul>
<p>These instructions have been tested on Ubuntu/Debian/Linux but they should work in other environments too.</p>
<h2>Write down database access information</h2>
<p>Get password from config.php file on the old server:</p>
<pre>cd /var/www/phpBB3
cat config.php</pre>
<p>Write down database name, username and password.</p>
<h2>Copy files</h2>
<p>Use rsync to remotely copy forum files to a new computer. On new computer, in /var/www folder</p>
<pre>rsync -av --compress-level=9 user@oldserver.com:/var/www/phpBB3 .</pre>
<h2>Dump and copy database</h2>
<p>Execute the following command on the new server. It takes SSH connection to the old server and dumps phpBB3 database to the new server over the SSH connection.</p>
<pre>ssh user@oldserver.com -C -o CompressionLevel=9 mysqldump -u databaseuser --password=databasepassword --skip-lock-tables --add-drop-table databasename &gt; phpbb3.sql</pre>
<h2>Create a new database</h2>
<p>Use the old access information from config.php to create a database with identical access information on the new server. You need a MySQL root access to create new databases.</p>
<pre>mysql -uroot -p</pre>
<p>Create database and grant access to phpBB3 user for it.</p>
<pre>mysql&gt; create database databasename;</pre>
<pre>mysql&gt; GRANT ALL ON databasename.* TO 'databaseuser'@'localhost' identified by 'databasepassword';</pre>
<p>Load the database on the new server from the dump file:</p>
<pre>mysql&gt; connect databasename;</pre>
<pre>mysql&gt; source phpbb3.sql</pre>
<h2>Configure Apache virtualhost for the new server</h2>
<p>The last step is to set-up Apache virtual host on the new server, so you can access the phpBB3 using a domain name. Note that this doesn&#8217;t need to be a real domain name, but you can spoof the domain name using /etc/hosts file on your local workstation.</p>
<p>Add file <em>/etc/apache2/sites-enabled/phpbb3.conf</em> (or pick a filename based on forum name if you host multiple forums)</p>
<pre>&lt;VirtualHost *&gt;
 ServerName yourdomainname.com

 DocumentRoot /var/www/phpBB3
 &lt;Directory /&gt;
   Options FollowSymLinks
   AllowOverride None
 &lt;/Directory&gt;

&lt;/VirtualHost&gt;</pre>
<p>Note that &lt;virtualhost *&gt; may change depending on how Apache has been set up to listen IP addresses and ports. Also if you are using a shared hosting package or VPS you might need to use the server control panel (cPanel) to do this step.</p>
<p>Then check if your new config file is ok and restart Apache:</p>
<pre>apache2ctl configtest
apache2ctl graceful</pre>
<h2>Hosts spoofing trick</h2>
<p>If you are not having a DNS server of your own which you can use for the copy you can always use <a href="http://webandmobile.mfabrik.com/docs/web-and-mobile/user-manual/installation#modifying-your-local-hosts-file">/etc/hosts file trick </a>to spoof domain names. This way you can make Apache to serve the forum from the server even if the forum is not connected to any real domain name yet.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2011/03/30/copymove-phpbb3-forum-from-a-server-to-another-computer-ubuntulinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>scp file copy with on-line compression</title>
		<link>http://blog.mfabrik.com/2011/03/02/scp-file-copy-with-on-line-compression/</link>
		<comments>http://blog.mfabrik.com/2011/03/02/scp-file-copy-with-on-line-compression/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 20:12:22 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[data.fs]]></category>
		<category><![CDATA[level]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[zodb]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=1048</guid>
		<description><![CDATA[This might come handy if you need to copy a database file (Data.fs) from the remote server to your local computer: scp -C -o CompressionLevel=9 user@yoursite.com:~/plonefolder/zinstance/var/filestorage/Data.fs . This command line enables real-time compression with the highest compression level. This speeds up copying somewhat, as ZODB database compresses pretty well. Get developers  Subscribe mFabrik blog in [...]]]></description>
			<content:encoded><![CDATA[<p>This might come handy if you need to copy a database file (Data.fs) from the remote server to your local computer:</p>
<pre>scp -C -o CompressionLevel=9 user@yoursite.com:~/plonefolder/zinstance/var/filestorage/Data.fs .</pre>
<p>This command line enables real-time compression with the highest compression level. This speeds up copying somewhat, as ZODB database compresses pretty well.
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2011/03/02/scp-file-copy-with-on-line-compression/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Local XAMPP development and UNIX file permissions</title>
		<link>http://blog.mfabrik.com/2010/12/22/local-xampp-development-and-unix-file-permissions/</link>
		<comments>http://blog.mfabrik.com/2010/12/22/local-xampp-development-and-unix-file-permissions/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 17:13:30 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[chgrp]]></category>
		<category><![CDATA[chown]]></category>
		<category><![CDATA[documentroot]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[unix file permissions]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=888</guid>
		<description><![CDATA[If you are using XAMPP Apache+MySQL+PHP stack to develop web applications on your OSX or Linux computer you might want to fiddle with Apache settings to make your life easier. By default XAMPP users nobody user for running Apache. If you try to load any file created by your normal system user Apache will give [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> Apache+MySQL+PHP stack to develop web applications on your OSX or Linux computer you might want to fiddle with Apache settings to make your life easier.</p>
<p>By default XAMPP users nobody user for running Apache. If you try to load any file created by your normal system user Apache will give access denied error. This means that either you must make all PHP files readable for everyone, or change the file owner. This is painful if you need to repeat the process for every file.</p>
<p>Instead, it is easier to make XAMPP run under the permissions of your local user.</p>
<p>Edit<em> /Applications/XAMPP/etc/httpd.conf</em>:</p>
<pre>
<div id="_mcePaste">&lt;IfModule !mpm_winnt_module&gt;</div>
<div id="_mcePaste">&lt;IfModule !mpm_netware_module&gt;</div>
<div id="_mcePaste">User yourusername</div>
<div id="_mcePaste">Group staff</div>
<div id="_mcePaste">&lt;/IfModule&gt;</div>
<div id="_mcePaste">&lt;/IfModule&gt;</div>

&lt;IfModule !mpm_winnt_module&gt;&lt;IfModule !mpm_netware_module&gt;</pre>
<pre>DocumentRoot "/Users/yourusername/yoursiteroot"</pre>
<p>You also need to change the location of setting default folder execution rights htdocs location to your development location</p>
<pre>#
# This has been changed from /Applications/XAMPP/htdocs
#
&lt;Directory "/Users/moo/code/joomla/mobilejoomla_dev"&gt;
    Options Indexes FollowSymLinks ExecCGI Includes
   AllowOverride All</pre>
<pre>&lt;/Directory&gt;</pre>
<p>And now Apache will happily eat all files you create or edit.
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/12/22/local-xampp-development-and-unix-file-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My ZSH prompt and configuration for OSX and Ubuntu Linux</title>
		<link>http://blog.mfabrik.com/2010/12/21/my-zsh-prompt-and-configuration-for-osx-and-ubuntu-linux/</link>
		<comments>http://blog.mfabrik.com/2010/12/21/my-zsh-prompt-and-configuration-for-osx-and-ubuntu-linux/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 15:31:33 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[colours]]></category>
		<category><![CDATA[ls]]></category>
		<category><![CDATA[macports]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[zsh]]></category>
		<category><![CDATA[zshrc]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=882</guid>
		<description><![CDATA[ZSH is a shell replacement for advanced command line users, featuring command autocompletion and such. ZSH works across OSX, BSD and Linux operating systems. Below is my .zshrc configuration file I use on OSX. It is based on Phil!&#8217;s ZSH prompt. It sets up nice colored prompt, colours for ls and some aliases. For OSX, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zsh.org/">ZSH</a> is a shell replacement for advanced command line users, featuring command autocompletion and such. ZSH works across OSX, BSD and Linux operating systems.</p>
<p>Below is my .zshrc configuration file I use on OSX. <a href="http://aperiodic.net/phil/prompt/">It is based on Phil!&#8217;s ZSH prompt</a>. It sets up nice colored prompt, colours for ls and some aliases. For OSX, get ZSH from <a href="www.macports.org">Macports</a>. Any suggestions welcome &#8211; please comment.</p>
<p><a href="http://blog.mfabrik.com/wp-content/uploads/2010/12/Screen-shot-2010-12-21-at-5.26.42-PM.png"><img class="alignnone size-full wp-image-883" title="Screen shot 2010-12-21 at 5.26.42 PM" src="http://blog.mfabrik.com/wp-content/uploads/2010/12/Screen-shot-2010-12-21-at-5.26.42-PM.png" alt="" width="749" height="486" /></a></p>
<pre># This is a modified version of Phil's prompt
# I removed the battery monitor, color and simplified
# the title bar to just the host
#
# Changes by calvinhp
#
# Changes by moo
#
# http://aperiodic.net/phil/prompt/

function precmd {
    local TERMWIDTH
    (( TERMWIDTH = ${COLUMNS} - 1 ))

    # Truncate the path if it's too long.
    PR_FILLBAR=""
    PR_PWDLEN=""

    local promptsize=${#${(%):---%D{%a\,%b %d}-----}}
    local pwdsize=${#${(%):-%d}}

    if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
            ((PR_PWDLEN=$TERMWIDTH - $promptsize))
    else
        PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $pwdsize)))..${PR_HBAR}.)}"
    fi

    # Only show user in the prompt if it isn't yourself
    # Make sure and set the $ME var in .zshrc
    PR_IMPOSTER=""
    [ "$ME" != "" ] &amp;&amp; [ $(whoami) != "$ME" ] &amp;&amp; PR_IMPOSTER="(%n%)"

    PR_PROJECT=""
    local THIRD_DIR=$(pwd | cut -f 4,5 -d /)
    if [ "$THIRD_DIR" = "sixfeetup/projects" ]; then
        PR_PROJECT="$(pwd | cut -f 6 -d /)"
        [ ! "$PR_PROJECT" = "" ] &amp;&amp; PR_PROJECT="($PR_PROJECT)"
    fi
}

setopt extended_glob
preexec () {
    if [[ "$TERM" == "screen" ]]; then
        local CMD=${1[(wr)^(*=*|sudo|-*)]}
        echo -n "\ek$CMD\e\\"
    fi
}

setprompt () {
    # Need this so the prompt will work.
    setopt prompt_subst

 	autoload colors zsh/terminfo
    if [[ "$terminfo[colors]" -ge 8 ]]; then
		colors
    fi
    for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
        eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
        eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
        (( count = $count + 1 ))
    done
    PR_NO_COLOUR="%{$terminfo[sgr0]%}"

    # See if we can use extended characters to look nicer.
    typeset -A altchar
    set -A altchar ${(s..)terminfo[acsc]}
    PR_SET_CHARSET="%{$terminfo[enacs]%}"
    PR_SHIFT_IN="%{$terminfo[smacs]%}"
    PR_SHIFT_OUT="%{$terminfo[rmacs]%}"
    PR_HBAR=${altchar[q]:--}
    PR_ULCORNER=${altchar[l]:--}
    PR_LLCORNER=${altchar[m]:--}
    PR_LRCORNER=${altchar[j]:--}
    PR_URCORNER=${altchar[k]:--}

    # Decide if we need to set titlebar text.
    case $TERM in
       xterm*)
           PR_TITLEBAR=$'%{\e]0;%m $PR_IMPOSTER $PR_PROJECT\a%}'
           ;;
       screen)
           PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %m $PR_IMPOSTER\e\\%}'
           ;;
       *)
           PR_TITLEBAR=''
           ;;
    esac

    # Decide whether to set a screen title
    if [[ "$TERM" == "screen" ]]; then
        PR_STITLE=$'%{\ekzsh\e\\%}'
    else
        PR_STITLE=''
    fi

    # Finally, the prompt (removed the color - claytron)
    PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
$PR_MAGENTA%$PR_PWDLEN&lt;...&lt;%~%&lt;&lt;$PR_BLUE)($PR_MAGENTA%(!.%SROOT%s.%n)$PR_GREEN\
$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_HBAR${(e)PR_FILLBAR}$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
$PR_MAGENTA@%m:%l\
$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_URCORNER$PR_SHIFT_OUT\

$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
%(?..$PR_LIGHT_RED%?$PR_BLUE:)\
${(e)PR_APM}$PR_YELLOW%D{%H:%M}\
$PR_LIGHT_BLUE:%(!.$PR_RED.$PR_WHITE)%#$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_NO_COLOUR '
}

setprompt

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

# For OSX users, alias nano to real editor
alias nano="open -a Smultron"

export CLICOLOR=1

# enable ls colors by default - use yellow for directories
LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:"</pre>
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/12/21/my-zsh-prompt-and-configuration-for-osx-and-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating and backing up Joomla! site on Ubuntu Linux</title>
		<link>http://blog.mfabrik.com/2010/10/05/updating-and-backing-up-joomla-site-on-ubuntu-linux/</link>
		<comments>http://blog.mfabrik.com/2010/10/05/updating-and-backing-up-joomla-site-on-ubuntu-linux/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 09:29:46 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[joomla]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=823</guid>
		<description><![CDATA[Here are short instructions for advanced Linux users to update Joomla! sites on Ubuntu Linux servers. Little Joomla! experience is required, the instructions are written from the Linux sys-admin reader perspective. The instructions assume full control over the server, though the instructions might also work on the shared hosting. These instructions also consider minor security [...]]]></description>
			<content:encoded><![CDATA[<p>Here are short instructions for advanced Linux users to update Joomla! sites on Ubuntu Linux servers. Little Joomla! experience is required, the instructions are written from the Linux sys-admin reader perspective. The instructions assume full control over the server, though the instructions might also work on the shared hosting. These instructions also consider minor security updates only, not major updates like Joomla! 1.5 -&gt; 1.6.  For further instructions, <a href="http://docs.joomla.org/Upgrading_1.5_from_an_existing_1.5x_version">please refer to Joomla! update manual</a>. See also <a href="http://forum.joomla.org/viewforum.php?f=430">Joomla! update and migration forum</a>.  It is useful to subscribe to <a href="http://developer.joomla.org/security.html">Joomla! security announcements RSS </a>as Joomla!, being unsafe PHP software by its nature, requires security updates very often. Script kiddies can take down your site very fast unless you can keep up with the updates.</p>
<h2>Work as the site user</h2>
<p>The site can be installed locally (under /home) or globally (under /var/www). If the site is installed globally you might need to set your effective user.  You should perform the command as the same user who owns the site PHP files. You should not be using root use as the owner of the site files. If you run Joomla! site through Apache, the effective user is www-data. Use sudo command to switch to this user. Use ls -l command to figure out which user you are.</p>
<pre>sudo -i -u www-data</pre>
<h2>Back up code files</h2>
<p>Use tar command to pack the existing folder structure in the case the update will destroy critical files.</p>
<pre>cd /var/www/yoursite
tar -cjf yoursite.tar.bz2 *</pre>
<h2>Back up database</h2>
<div>Note that you can see the database password in <em>configuration.php</em> file if you do not remember it.</div>
<div>
<pre>mysqldump -umysql_user_name-p mysql_database_name &gt; mysql_database_name.sql</pre>
</div>
<h2>Check Joomla! version</h2>
<div>Login as administrator. The login URL is the site URL + /administrator</div>
<div>Choose Help -&gt; System info from the menu.</div>
<div>You’ll see Joomla! version line.</div>
<h2>Download version specific Joomla! update pack</h2>
<div>
<p>Each minor version requires its own update. You can have update packages between each version like 1.5.18 -&gt; 1.5.19, or update packs which leap versions like 1.5.18 -&gt; 1.5.20.  <a href="http://joomlacode.org/gf/project/joomla/frs/?action=FrsReleaseBrowse&amp;frs_package_id=5325">Go to Joomla! package listing</a>.  Pick-up the package which will update your current Joomla! version to the latest version.  Download the patch file to the server.</p>
<pre>wget http://joomlacode.org/gf/download/frsrelease/12611/53380/Joomla_1.5.18_to_1.5.20-Stable-Patch_Package.tar.gz</pre>
</div>
<div>
<p>Extract it</p>
<pre>tar -xvzf Joomla_1.5.18_to_1.5.20-Stable-Patch_Package.tar.gz</pre>
<p>This will replace the changed Joomla! files with newer versions.</p>
<h2>Check the update has been correctly applied</h2>
<div>Visit Help -&gt; System info again. See that the version number has been updated.</div>
<div>Check that all pages on your site are working.</div>
<div></div>
<div></div>
<div></div>
</div>
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/10/05/updating-and-backing-up-joomla-site-on-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running 32-bit chroot on 64-bit Ubuntu server to reduce Python memory usage</title>
		<link>http://blog.mfabrik.com/2010/08/03/running-32-bit-chroot-on-64-bit-ubuntu-server-to-reduce-python-memory-usage/</link>
		<comments>http://blog.mfabrik.com/2010/08/03/running-32-bit-chroot-on-64-bit-ubuntu-server-to-reduce-python-memory-usage/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 16:15:02 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[zope]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[debootstrap]]></category>
		<category><![CDATA[memory usage]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[restart]]></category>
		<category><![CDATA[zodb]]></category>

		<guid isPermaLink="false">http://blog.mfabrik.com/?p=606</guid>
		<description><![CDATA[Here are documented brief instructions how to run 32-bit chroot&#8217;ed environment on 64-bit Ubuntu server. chroot means that you run re-rooted and jailed system inside another system. What we do here is enabling 32-bit chroot&#8217;ed userland on 64-bit server. 32-bit userland and 32-bit Python environment reduces the memory usage of heavy website applications we are [...]]]></description>
			<content:encoded><![CDATA[<p>Here are documented brief instructions how to run 32-bit chroot&#8217;ed environment on 64-bit Ubuntu server. chroot means that you run re-rooted and jailed system inside another system.</p>
<p>What we do here is enabling 32-bit chroot&#8217;ed userland on 64-bit server. 32-bit userland and 32-bit Python environment reduces the memory usage of heavy website applications we are running (read: Plone/Zope), since 32-bit has only half of the pointer size and object-oriented programming is all about pointers. Zope is especially memory hungry, because it uses ZODB object database. The developer does not need to worry about when doing queries, updates or caches that much  as the persistent site state is transparent to Python (objects are automatically loaded from database or cache when they are referred). Easy persistency means that almost everything is in the database and you need to have big object cache. Plone has huge client-side, in-process, cache for persistent objects. The default setting is for the cache size 5000 objects. (sidenote: since ZODB cache is in-process and Python does not do threading too well, running big Plone sites means that you need run several processes to handle parallel requests &#8211; having multiple processes with big in-process caches means loads of memory consumption)</p>
<p>32-bit userland is especially useful if you need to run Plone on 64-bit VPS (virtual private server) with low amount of available memory (512 MB or 1 GB).</p>
<p>There are some brief measurements about 32-bit vs. 6-bit Python memory usage at the end of this article.</p>
<p>Unless otherwise specified, all command here should be run as the root user of the host system. Commands here are for example only and you <strong>need to know what you are doing</strong>. If you lack advanced UNIX administration skills we <a href="http://mfabrik.com/@@zoho-contact-form">gladly arrange you some commercial training or hosting support</a>.</p>
<h2>Installing</h2>
<p>Basic schroot installation instructions for Ubuntu can be found here <a title="https://help.ubuntu.com/community/DebootstrapChroot" href="https://help.ubuntu.com/community/DebootstrapChroot">https://help.ubuntu.com/community/DebootstrapChroot</a> . We also install ZopeSkel in the chroo&#8217;ed environment for starting creating Plone sites. Note that we are using Ubuntu 8.04 which still ships with Python 2.4 &#8211; <a href="http://blog.mfabrik.com/2010/07/16/easily-install-all-python-versions-under-linux-and-osx-using-collective-buildout-python/">for later Ubuntus you need to compile Python 2.4 from the scratch</a>.</p>
<pre>apt-get install debootstrap
apt-get install schroot

# Old schroot uses global schroot.conf, new versions have
# chroot.d directory

# This is a heredoc, but use what ever editor you like
# to create the configuration
cat &lt;&lt;EOF &gt; /etc/schroot/chroot.d/hardy_i386.conf
[hardy_i386]
description=Ubuntu 8.04 Hardy for i386
location=/srv/chroot/hardy_i386
personality=linux32
root-users=bob
run-setup-scripts=true
run-exec-scripts=true
type=directory
users=bob,john,alice,ploneuser
EOF

mkdir -p /srv/chroot/hardy_i386
debootstrap --variant=buildd --arch i386 hardy /srv/chroot/hardy_i386 \

http://archive.ubuntu.com/ubuntu/

# Check that the chroot is created and working
schroot -l

# Enter the chroot (logged in as bob)
schroot -c hardy_i386 -u root

# Once inside, install python2.4-dev and other needed tools
# Installing PIL with easy_install didn't work for some
# reason, so we use python-imaging package.
apt-get install python2.4-dev python-setuptools python-imaging
easy_install-2.4 ZopeSkel</pre>
<p>And that&#8217;s about it.</p>
<p>Chroot&#8217;ed environment will have</p>
<ul>
<li>It&#8217;s own application binaries (and userland bitness)</li>
</ul>
<p>Chroot&#8217;ed environment will share with the host system</p>
<ul>
<li>Ports</li>
<li>Processes</li>
<li>User accounts</li>
</ul>
<p>Chroot&#8217;ed users</p>
<ul>
<li>Can&#8217;t list filesystem outside chroot</li>
</ul>
<p>&#8230;giving additional safety for shared hosting in the case of chroot&#8217;ed environment is compromised.</p>
<h2>Entering chroot&#8217;ed environment as a specific user</h2>
<p>Try</p>
<pre>schroot -c hardy_i386 -u root</pre>
<p>&#8230;or&#8230;</p>
<pre>schroot -c hardy_i386 -u plone_user # After you have set-uped normal user for chroot'ed environment</pre>
<p><strong>All background processes you leave running in chroot&#8217;ed environment are terminated when you exit this environment</strong>, unless you create sessions as described below.</p>
<h2>Creating chroot sessions</h2>
<p>Sessions enable running commands in chroot without the need to have it constantly open.</p>
<pre># Create a new schroot session
schroot --chroot=hardy_i386 --user=ploneuser \
--session-name=plonesession \
--begin-session

# Run commands in the created session
schroot --chroot=plonesession --user=ploneuser --run-session \
/srv/plone/yourplonesite/bin/instance start

# Ending session
schroot --chroot=plonesession --user=ploneuser --end-session</pre>
<p>Note that -<em>-chroot</em> parameter takes in both actual chroot installations and session ids.</p>
<h2>Doing resets for chrooted environment</h2>
<p>The session processes exist as long as the session exist. Unless you explicitly start a new session with &#8211;begin-session the processes are terminated as soon as you log out from the chroot&#8217;ed environent.<br />
<strong>chroot&#8217;ed environment is temporary unless you explicitly specify it not be</strong><br />
Thus if you want to run daemonized services in chrooted environment you need to take care of session handling manually.<br />
Here is an example how do you construct a session (as a real root user) and then launch a shell script which will take care of launching applications inside the chroot.</p>
<pre># Terminate previous session if any
schroot --chroot=hardy_i386 --user=plone_user --session-name=plone_session --end-session</pre>
<pre>#Start the session (again)
schroot --chroot=hardy_i386 --user=plone_user --session-name=plone_session --begin-session</pre>
<pre># Run a start script inside the chroot'ed environment which will start Plone
# NGINX and other necessary 32-bit services
schroot --chroot=plone_session --user=plone_user --run-session /srv/plone/myplonesite/restart-all.sh</pre>
<h2>Running sessions at startup</h2>
<p>You can add schroot bootstrap in real /etc/rc.local:</p>
<pre>schroot --chroot=hardy_i386 --user=ploneuser \
--session-name=plonesession --begin-session \
&amp;&amp; schroot --chroot=plonesession --run-session \
/srv/plone/inst/bin/instance start</pre>
<p>Remember that the users have to be created outside the chrooted environment. If you set the home directory to something that exists only in the chrooted environment, use something like this</p>
<pre>adduser --no-create-home --home HOMEDIR_IN_CHROOT ploneuser</pre>
<p>Then to create the directory inside the chroot and set its ownership to the newly created user and group.</p>
<h2><strong>32-bit vs 64-bit memory consumption</strong></h2>
<p><strong></strong>Reason why we even tried this is that some python applications, like Zope, use references heavily and moving from 32bit to 64bit references increases memory usage. (<a title="J Stahl 2010" href="http://jstahl.org/archives/2010/01/24/plone-4-uses-29-less-memory-than-plone-3-thanks-python-2-6/">J Stahl 2010</a>)</p>
<p>Memory figures from a development Zope/Plone 3.3.5 server</p>
<table border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
<tbody>
<tr>
<td width="33.333333333333336%"></td>
<td width="33.333333333333336%" align="left">32-bit</td>
<td width="33.333333333333336%">64-bit</td>
</tr>
<tr>
<td width="33.333333333333336%">After startup</td>
<td width="33.333333333333336%">112 MiB RES<br />
116 MiB VIRT</td>
<td width="33.333333333333336%">175 MiB RES<br />
342 MiB VIRT</td>
</tr>
<tr>
<td width="33.333333333333336%">After normal usage</td>
<td width="33.333333333333336%">159 MiB RES<br />
194 MiB VIRT</td>
<td width="33.333333333333336%">236 MiB RES<br />
487 MiB VIRT</td>
</tr>
</tbody>
</table>
<p>This is far from a complete study, but it would seem that the chroot does pay off even though it has to load 32bit versions of basic libraries along. If running more than one instance on same server memory savings should increase.</p>
<h2>More information</h2>
<ul>
<li><a href="http://manpages.ubuntu.com/manpages/hardy/man1/schroot.1.html">http://manpages.ubuntu.com/manpages/hardy/man1/schroot.1.html</a></li>
<li><a href="http://en.wikipedia.org/wiki/Chroot">http://en.wikipedia.org/wiki/Chroot</a></li>
</ul>
<p class="signature">
<a href="http://mfabrik.com/@@zoho-contact-form"><img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/mfabrik-24.png"></a> <a href="http://mfabrik.com/@@zoho-contact-form">Get developers</a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml"><img valign="middle" src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/mFabrikWebAndMobileDevelopment" rel="alternate" type="application/rss+xml">Subscribe mFabrik blog in a reader</a> <a href="http://twitter.com/mfabrik"> <img valign="middle"  src="http://blog.mfabrik.com/wp-content/uploads/twitter-24.png"></a> <a href="http://twitter.com/moo9000">Follow me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2010/08/03/running-32-bit-chroot-on-64-bit-ubuntu-server-to-reduce-python-memory-usage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

