How to install or copy OpenFlyers v2 to Ubuntu?
This document refers to Ubuntu Server 8.04, available as at 6th July 2008. That said I see no reason why it would not work with other versions of Ubuntu (or debian!) providing the prerequisites for OpenFlyers are met. It assumes some familiarity with Linux commands and there is a reference to transferring OpenFlyers from a Windows installation to Linux, this section assumes some familiarity with the Windows command line.
Get the media
If you haven't already got it, download Ubuntu Server edition from www.ubuntu.com and make a bootable CD from the ISO file. Finalburner is a good choice but almost any other CD burning app should do.
Install Ubuntu on the machine
Once completed set the host machine to boot from a CD, insert Ubuntu CD into the PC & boot. Follow the instructions to install & setup according to your environment. The default partitioning works reasonably well but you will need to use the manual option if you want to set software raid etc. Don't forget to install the LAMP options amongst other things and of course set your machine IP address & hostname etc.
Log into Ubuntu (by default it requires a separate login from root for security reasons so for many commands you'll need to issue the sudo predecessor). You may prefer to login directly as root in which case you will need to set a suitable root password to allow this, $sudo passwd root will give you a prompt for a new root password. From here on in commands you type on the command line will be italicised and assume you use them directly from the root login or you type sudo first.
First of all some housekeeping, there are some useful commands to issue and packages to install that will make life easier. OpenFlyers will still operate happily without these so you may skip this section if you desire.
Issue $updatedb - this will update the file index database, it's useful to do this regularly because it will allow you to easily find files using the locate command.
Webmin is a very useful remote administration tool so if you want to log in remotely to do anything it's a must. Download the .deb package from the webmin site to the /tmp directory & install it thus:
$dpkg -i /tmp/webmin_1.420_all.deb
You will first need some support packages for webmin to work properly, these may be installed directly from the Internet via the 'apt-get' command:
$apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl
There are many other useful packages but these will suffice for now.
PEAR and XSL for Apache installation
First though you need to install the PEAR base itself:
$apt-get install php-pear
If you're going to experiment or wish to install on another machine you could simply download all the required PEAR packages to a pear directory under the /tmp directory or alternatively just use the install command without specifying the source for PEAR to install directly from the internet. In this example we assume you have the required files downloaded to /tmp/pear:
$pear upgrade /tmp/pear/* $pear install pear/MDB2#mysqli
You will also need XSL support for Apache:
$apt-get install php5-xsl
Don't forget to reload Apache after the package install:
Install or transfer OpenFlyers
Now at this stage the machine should be ready for an installation of OpenFlyers. You will need to create a directory underneath /var/www for OpenFlyers to reside, this may be anything you prefer but we will assume the use of 'OF' in this example. Presently it is necessary to install v1.3 of OpenFyers first to initialise the databsse before v2 may be installed. Download & unzip OpenFlyers to the /var/www/OF directory, follow any instructions in the readme file then browse to //hostname/OF/install/install.php and configure as required (you will need to specify the path to your PEAR installation for instance). After the installation you can connect to //hostname/OF/index.php with admin/admin as login and password. It would be useful but not essential to set another user at this stage.
To install V2 you will need to use SVN at this time. The use of SVN goes beyond the scope of this document but essentially you would save /var/www/OF/conf/*.php (connect & config files) then remove all the files from the OF directory. Then use SVN to download the latest version of 2.0 to the OF directory, copy the relevant data from the old connect & config.php files to the new V2 /conf/connect & config.php files then run //hostname/OF/install/install.php again. This should update the V1.3 database with new tables as needed by V2 & you may then login from //hostname/OF/index.php to continue setting up OpenFlyers to your requirements.
Transfer from one machine to another
It is quite possible to work on OpenFlyers on another machine (say a Windows Laptop for instance) and copy the working data over to the Ubuntu server once you have it operating as you want it. To do this you simply copy the working OF directory from the Laptop over to the /var/www/html directory on the server. WinSCP is very useful for transferring files and Putty may be used to issue remote commands on the server. Don't forget to edit the /conf files to reflect any different paths (from Windows to Linux for instance) & different pear directory (in this case /usr/share/php).
Set the file permissions for the next stage:
$chmod -R 775 /var/www/OF - you may find it necessary to be even more open than this (777) during the initial install but you should certainly be aware of the security issues involved in doing this.
Then you will need to copy the operational MySQL file, this must be done properly so back it up on the Laptop with the following command that will allow easy re-creation on the Ubuntu server, don't forget you need to have the daemon running:
C:\xampp\mysql\bin>mysqldump -u root -p --databases of > c:\xxx\of.mysql Enter password:
Copy the of.mysql file over to the /tmp directory on the server then:
$mysql -u root -p < /tmp/of.mysql Enter password:
That should (re)create the database file, now on the Ubuntu server.
You should at this stage be able to navigate to //hostname/OF/index.php and see your working version of OpenFlyers on the server.
Transfer is an effective backup
It's important to note that this operation is useful also in the event of a hard disk or machine failure - should this happen as long as you have a recent copy of your OF directory complete, and a backup of the MySQL file, then it is a trivial matter to get a working version of OpenFlyers up and running in a short time.