Wednesday, April 22, 2009

Joomla on OSX

Decided to mount some of the joomla projects on the best machine which is the dual g5, now upgraded to 4 gig of ram. The dell 470 is similar in specs but not quite as nice a machine.

First step was to download MAMP and to drag it to applications and then drag the mamp control panel to /library/widgets and start up mamp. The address is on a different port so you have to go to:

http://localhost:8888/MAMP/?language=English

in your web browser and the phpmyadmin control panel is located at:

http://localhost:8888/MAMP/frame.php?src=%2FphpMyAdmin%2F

The next step was to download the current version of Joomla. After unpacking the archive we have a folder called joomla_1 which we need to copy to the htdocs folder of mamp which is located at:

Applications/MAMP/htdocs

First we rename the folder to joomla. With this done we are ready to setup joomla. 

Create the mySQL Database

  1. In phpmyadmin select the Create New Database box and type in joomla and click CREATE
  2. Now click on Privileges
  3. Click the Open New phpmyadmin Window icon on the right hand side
  4. Click Add a New User
  5. We create a user called joomla on localhost with a password of joomla
  6. For global privileges we select Check All
  7. Click GO

Once the new user is added we close off the phpmyadmin windows and go to:

http://localhost:8888/Joomla/installation/index.php

to run the joomla install. In the database configuration screen we enter mysql as the database type, localhost as the host, and joomla as the user, password and database names. We do not enable the ftp layer for now. We name the site gnickers and set up an password for the admin user and install the sample data.

The last step is to delete the installation folder in /htdocs/joomla and then run safari to:

http://localhost:8888/Joomla/ 

to see the sample data and the default theme. We verify we can log in as the admin user. Clicking the Administration menu item loads the back-end control panel. Now let's restore some joomla backups from the USB sticks and take a look.

oops first we better install joomlapack. Off to sourceforge to get version 2.2.1 and then to the control panel to install the extension.

Once installed we configure joomlapack to use joomlapack jpa format instead of .zip and set the backup directory above the htdocs folder. Now to get the restore files from the network. Ok, we copy them to the /backup folder.

Ok - how do we restore? We try administer backup files but there are none listed. We search and find:

JoomlaPack uses the installation procedure of Joomla! to do the restore of the database. The questions that the installation prompts you for and the installation of the "sample" data provide all the information that you need to do a restore, on the original server or a new server. The Joomla! sample data is replaced by your site's backed up data during the reinstallation process. To restore, FTP the files back to your site and go through the Joomla! installation again to restore the database.

Not impressed. First of all you have to extract the files from the archived backup which is not in .zip format because the install suggested changing to .jpa format which is not associated with any program.  Ok, some more searching finds a 'workaround':

download kickstart.php from our download page. Upload kickstart and your backup archive to where you want the root of the site to be and point your browser to "http://www.mysite.com/kickstart.php". Kickstart will extract your archive and then give you a link to start the installer. When the installer finishes, close that window and return to kickstart. The second link is to delete the kickstart.php file, the archive and the /installation folder. 

Let's try it out. We try to install it and the jputils through the extensions control panel but neither work. We look inside the ..zips and they are just php files so we extract them and copy them to the htdocs folder. There is also a native joomlapack tools but this is platform specific - looks like windows executables. So now we have:

kickstart.php
jpa.php
unjpa.php
unzip.php

It would be useful if these programs were incorporated into a RESTORE function bound to a menu item. Hopefully in a future release. We goto:

 http://localhost:8888/joomla/kickstart.php

but it complains there are no backup files in the current folder. duh - for security reasons listed in the install we moved the backup folder out of the htdocs tree. We could use ftp - and in fact we may have to. This is the bottom of the screen.

FTP Options

Host
Port
Username
Password
Initial Directory

Of course that means turning on FTP. For now let's cheat and copy a .jpa backup file to this directory and refresh the page. Ok, now the file is show so we click the START button. It runs through the archive, extracting the files at very impressive speed and the displays:

Please click here to open JoomlaPack Installer restore script in a new window.
DO NOT CLOSE THIS WINDOW!! 
When you have finished restoring your site please click here to activate your .htaccess (if you had one in the first place) and delete the backup archive and this script.


OK. We click the here link and it runs the joomla installer. Since all the options are already filled in we just click next, next, next etc. When finished this message is displayed:

Congratulations! End of file reached, assuming OK

Please press next to continue the restoration process


Ok. We set up the admin user password and it restores the site and when finished this is displayed:

PLEASE REMEMBER TO COMPLETELY
REMOVE THE INSTALLATION DIRECTORY


Which we do and the web site is restored. Ok, let's restore a different site to make sure.

Todo List:

The next step is to try and restore to a portable app environment and then to burn the whole portable app + XAMPP + Joomla to a CD disc. This would allow for multiple joomla web sites to be demonstrated and might be a good method for handing in student projects. You could also just hand in the usb stick...

The test will be the putting of a cd into a drive and then running portable apps, xampp and brining up the joomla web site.

1 comment:

dereckgray said...

Could not connect to the database. Connector returned number: Unable to connect to the database:Could not connect to MySQL

got as far as this error message.
used localhost
tried root and joomla
had joomla as password - did not exercise generate option in phpmyadmin
has mysql running ok and apache

any ideas please