Install Joomla 2.5 on Ubuntu 12.04 LTS


Assuming Joomla is uploaded to your remote server and unzipped in /home/username/joomla

Create your website directory

sudo mkdir /var/www/www.example.com

Copy Joomla to the website directory

sudo cp -Rf /home/username/joomla/* /var/www/www.example.com

I use scripts to set Joomla permission at this point. If you run into trouble, it will be because permissions are not set correctly, so I do this by default.

Login to MySQL and create database
mysql -u root -p

in MySQL >the following commands at MySQL prompt

MySQL Create user

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

MySQL Grant Privileged

GRANT ALL ON www_example_com.* TO 'username'@'localhost';

log out of MySQL

quit

Restart MySQL
sudo service mysql restart

if that does not work, something a bit stronger

sudo /etc/init.d/mysql restart

Create Virtual Host

sudo vi /etc/apache2/sites-available/www.example.com

copy this code into the file

<VirtualHost *:80>
     ServerAdmin webmaster@example.com
     ServerName www.example.com
     ServerAlias www.example.com
     DocumentRoot /var/www/www.example.com/
</VirtualHost>
sudo a2ensite www.example.com
sudo /etc/init.d/apache2 restart

Use your browser to access your website
Go through the normal installation steps
Note the database prefix – write it down.

Errors?

Double check permissions are set to:
sudo chmod 766 configuration.php

You will see the message
PLEASE REMEMBER TO COMPLETELY
REMOVE THE INSTALLATION FOLDER.
You will not be able to proceed beyond this point until the installation directory has been removed. This is a security feature of Joomla!.

sudo rm -Rf /var/www/www.example.com/installation

You’re done.
If joomla hangs, type into your browser
http://www.example.com/administrator/

Joomla will have created a configuration file in /var/www/www.example.com
-rw------- 1 www-data www-data 1955 Feb 00 10:27 configuration.php

You may want to back that file up somewhere

sudo cp configuration.php ~/joomla-config-example.bak

Don’t forget to set Joomla permissions back to a more restricted mode for normal operations.


In 2.5 I had some trouble with the configuration.php file. If it does not materialize as expected, below is the contents that only require customization of the database parameters – and that is why you will want to write down that pre-fix code.

//<?php
/**
 * IF YOU COPY AND PASTE, BE SURE TO UNCOMMENT THE FIRST LINE 
 * @package		Joomla
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 *
 * -------------------------------------------------------------------------
 * THIS SHOULD ONLY BE USED AS A LAST RESORT WHEN THE WEB INSTALLER FAILS
 *
 * If you are installing Joomla! manually i.e. not using the web browser installer
 * then rename this file to configuration.php e.g.
 *
 * UNIX -> mv configuration.php-dist configuration.php
 * Windows -> rename configuration.php-dist configuration.php
 *
 * Now edit this file and configure the parameters for your site and
 * database.
 */
class JConfig {
	/* Site Settings */
	public $offline = '0';
	public $offline_message = 'This site is down for maintenance.<br /> Please check back again soon.';
	public $display_offline_message = '1';
	public $offline_image = '';
	public $sitename = 'Joomla!';				// Name of Joomla site
	public $editor = 'tinymce';
	public $captcha = '0';
	public $list_limit = '20';
	public $root_user = '42';
	public $access = '1';

	/* Database Settings */
	public $dbtype = 'mysql';					// Normally mysql
	public $host = 'localhost';					// This is normally set to localhost
	public $user = '';							// DB username
	public $password = '';						// DB password
	public $db = '';							// DB database name
	public $dbprefix = 'jos_';					// Do not change unless you need to!

	/* Server Settings */
	public $secret = 'FBVtggIk5lAzEU9H'; 		// Change this to something more secure
	public $gzip = '0';
	public $error_reporting = 'default';
	public $helpurl = 'http://help.joomla.org/proxy/index.php?option=com_help&amp;keyref=Help{major}{minor}:{keyref}';
	public $ftp_host = '';
	public $ftp_port = '';
	public $ftp_user = '';
	public $ftp_pass = '';
	public $ftp_root = '';
	public $ftp_enable = '';
	public $tmp_path = '/tmp';
	public $log_path = '/var/logs';
	public $live_site = ''; 					// Optional, Full url to Joomla install.
	public $force_ssl = 0;						// Force areas of the site to be SSL ONLY.  0 = None, 1 = Administrator, 2 = Both Site and Administrator

	/* Locale Settings */
	public $offset = 'UTC';

	/* Session settings */
	public $lifetime = '15';					// Session time
	public $session_handler = 'database';

	/* Mail Settings */
	public $mailer = 'mail';
	public $mailfrom = '';
	public $fromname = '';
	public $sendmail = '/usr/sbin/sendmail';
	public $smtpauth = '0';
	public $smtpuser = '';
	public $smtppass = '';
	public $smtphost = 'localhost';

	/* Cache Settings */
	public $caching = '0';
	public $cachetime = '15';
	public $cache_handler = 'file';

	/* Debug Settings */
	public $debug = '0';
	public $debug_lang = '0';

	/* Meta Settings */
	public $MetaDesc = 'Joomla! - the dynamic portal engine and content management system';
	public $MetaKeys = 'joomla, Joomla';
	public $MetaTitle = '1';
	public $MetaAuthor = '1';
	public $MetaVersion = '0';
	public $robots = '';

	/* SEO Settings */
	public $sef = '1';
	public $sef_rewrite = '0';
	public $sef_suffix = '0';
	public $unicodeslugs = '0';

	/* Feed Settings */
	public $feed_limit = 10;
	public $feed_email = 'author';
}

If you are new to Joomla and/or you found this lifesaver, please Google+ or link back even better Thanks!