Preparing a joomla test environment on Ubuntu for existing Joomla site

You will need to install following to prepare a test environment on Ubuntu for Joomla:

Install Apache Web Server:
sudo apt-get install apache2

Install PHP5:
sudo apt-get install php5

Install PHP Apache libraries:
sudo apt-get install libapache2-mod-php5

Restart Webserver:
sudo /etc/init.d/apache2 restart

Instal MySQL Server:
sudo apt-get install mysql-server

Install PHP Module for MySQL5:
sudo apt-get install php5-mysql

Installing phpMyAdmin:

Download latest package from

  • http://www.phpmyadmin.net/
  • Create a directory phpmyadmin in your web server root ( usually it is /var/www )

    Create the config directory in /var/www/phpmyadmin/

    Change permissions on config:
    sudo chmod 777 /var/www/phpmyadmin/config

    Open the following page in a browser http://localhost/phpmyadmin/setup/install.php

    Add your server configration and save the config file

    Install Mcrypt:
    sudo apt-get install php5-mcrypt

    Restart apache server:
    sudo /etc/init.d/apache2 restart

    Open the following page in a browser http://localhost/phpmyadmin/index.php

    Remove config directory from /var/www/phpmyadmin/

    Install MySQL Admin:
    sudo apt-get install mysql-admin

    Create and Download latest cpanel backup from your host.

    Create a directory in /var/www/ which will contain your website.
    copy the joomla files from the backup file to the directory what you have created remember you should copy your site’s document root
    Open configuration.php and modify the following values:

    $mosConfig_absolute_path = ‘/var/www/[directory what you have created]’;
    $mosConfig_cachepath = ‘/var/www/[directory what you have created]/cache’;
    $mosConfig_live_site = ‘http://localhost/[directory what you have created]’;

    Note the value of these 3 variables:

    $mosConfig_db <- This will be the MySQL database associated with your website. $mosConfig_user <- This will the MySQL user. $mosConfig_password <- This will be the password for your MySQL user. Now it is time to create the MySQL database from the backup. Look for the database SQL file in the backup. The filename should be the same as the database name so it would be something like [database name].sql.

    Now start the MySQL admin graphical interface: ./mysql-admin
    After logging in click on Restore Backup the click on Change Path to select the path to your MySQL backup file

    Select the mysql backup file, select the relevant encoding and create a New Schema for your database. This should be the same as your database name.
    Click on Restore Backup

    Once the backup is restored create the database user id and password, and grant all rights to the database for this user.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.