How to run Joomla 1.5 on CD/DVD

In this tutorial you will learn how to create a fully working version of Joomla running from a CD or DVD.

1. The first step is to download and install the DWebPro server:

http://www.dwebpro.com/download

DWebPro is a web server (like Apache and IIS) developed for distributing dynamic web site on CD/DVD and as install packages. It’s FREE for non commercial use, so you can use it for your personal projects without any cost.

2. Then you have to download and install the following additional packages (from http://www.dwebpro.com/addons):

  • PHP 5.2
  • MySQL Server 5.0
  • phpMyAdmin 2.6

When you install PHP, chose the ISAPI (recommended) mode. It’s faster than CGI, especially when the web site is executed from a CD/DVD.

The installation of both DWebPro and the preconfigured packages is pretty straight forward, just run the installer and follow the steps (Next, Next, Next, … Finish!).

3. Download the Joomla 1.5 source code:

http://joomlacode.org/gf/project/joomla/frs/

4. Open the Windows Explorer and browse to the deploy\www folder of DWebPro (usually C:\DWebPro\deploy\www).

This folder is the DWebPro document root, where we will place the Joomla files.

5. Remove any file and folder from the deploy\www directory except the following two folders:

  • deploy\www\bin
  • deploy\www\phpMyAdmin

6. Extract the content of the Joomla package into the deploy\www folder.

7. Start DWebPro.

You can start DWebPro using the “Start DWebPro” icon on the desktop or the on in Start -> Programs -> DWebPro

8. A this point you should see the familiar phpMyAdmin interface.

In the header of the page you should see a text like the following:

MySQL 5.0.15 running on localhost:3307 as root@localhost

Write down the port number specified after “localhost:”. You will need this value in the following steps.

9. Create a new database named “joomla”.

10. Navigate to the root

If, for instance, the address bar in your browser displays http://127.0.0.1:8080/phpMyAdmin/index.php you have to remove the phpMyAdmin/index.php and navigate to http://127.0.0.1:8080/

If, for instance, the address bar in your browser displays http://127.0.0.1:8081/phpMyAdmin/index.php you have to remove the phpMyAdmin/index.php and navigate to http://127.0.0.1:8081/

11. Execute the Joomla installation as usual:

  1. Select the language.
  2. Verify the Pre-installation Checks.
  3. Accept the GPL license.
  4. Specify the database connection setting:

In the Host Name you have to specify the same value you have noted down in the 8th step.

Host Name: localhost:3307
User Name: root
User Name:
Database Name: joomla

  1. Skip the FTP Configuration.
  2. Fill the Main Configuration as usual. If you want you can click on the “Install sample data” button.
  3. Finish: Congratulations! Joomla! is installed.

12. Close the browser and DWebPro.

13. Open the Windows Explorer and browse to the deploy\www folder.

14. Delete the deploy\www\installation folder.

15. Open the deploy\www\configuration.php file.

In order to make Joomla perfectly working on CD/DVD we need to make some small adjustments to the Joomla configuration. Add the following function to the JConfig class.

	function __construct() {
		$this->host = '127.0.0.1:' . dwebpro_getvar('DWEBPRO_MYSQL_PORT');
		$this->mailer = 'smtphost';
		$this->smtphost = '127.0.0.1:' . dwebpro_getvar('DWEBPRO_MYSQL_PORT');
		$this->log_path = dwebpro_getvar('DWEBPRO_TEMP');
		$this->tmp_path = dwebpro_getvar('DWEBPRO_TEMP');
	}

In this way, Joomla will be able to use the right settings in any PC where it will be executed.

We need to create the JConfig constructor because in PHP you can’t specify the default value of a property using a function (i.e, the host property).

16. Open the deploy\http.ini file.

In order to make Joomla working on CD/DVD we need to make some small adjustments to the DWebPro configuration:

[Browser]
OpenUrl=1
Url=http://##DWEBPRO_HOSTNAME##:##DWEBPRO_WEBSERVER_PORT##/

[MySQL]
CopyDataToHardDisk=1
DestinationDir=##DWEBPRO_TEMP##\joomla_15

The above settings tell DWebPro to open the default browser on startup (OpenUrl) with the Joomla web site (Url) and to copy the Joomla database files (CopyDataToHardDisk) on the user file system (DestinationDir). In this way Joomla will be able to read/write the database contents.

17. Let’s burn Joomla on CD/DVD.

Open your favorite burning utility (es. Nero) and burn the whole deploy folder into a CD/DVD.

18. Run Joomla from CD/DVD

Start the dwebpro.exe from the CD/DVD created in the previous steps and here it is: your Joomla running from CD/DVD.