Installing Joomla on Stunnix Web Server.

# Using Joomla available on Demo CD

A demo of Stunnix Web Server already includes installation of Joomla. You can login to adminstrator's interface using this link using login 'admin' and password 'root' and edit configuration yourself. In case such option suits you, there is no need to read the rest of this document.

# Installing your own copy of Joomla

## Stage 1

1. Suppose you wish to have Joomla be accessible using url http://127.0.0.1/cms/joomla/; in this case, create 'cms/joomla' directory inside 'content' folder and unpack Joomla there. This way you will have file LICENSE.php from toplevel joomla directory located in c:\mycds\cd1\in\content\cms\joomla\LICENSE.php (windows) or /home/YOURLOGIN/mycds/cd1/in/content/cms/joomla/LICENSE.php
2. Copy 'configuration-stunnix.php' from 'site/www/root/joomla/' on the demo CD to the directory where you've unpacked your Joomla too - in your case it should go to c:\mycds\cd1\in\content\cms\joomla\configuration-stunnix.php (windows) or /home/YOURLOGIN/mycds/cd1/in/content/cms/joomla/configuration-stunnix.php. Edit it there, and set value of variable $_mosConfig_dirpath to 'cms/joomla' (i.e. `$_mosConfig_dirpath= 'cms/joomla'`; ), otherwise CD you'll produce won't work on other OSes or boxes.
3. In order your Joomla site to appear in browser on startup of the Stunnix Web Server, go to General,Path and Initial URL and enter '/cms/joomla' for 'Default initial URL to open' field.
4. Click Databases, Mysql. Change 'MySQL support' to 'Run from CD'.
5. Click PHP, Main and select 'PHP5' in topmost 'PHP support' dropdown list (otherwise CD won't work on OSX).
6. Go to the directory with your CD's prototype - i.e. c:\mycds\cd1\out (windows) or ( /home/YOURLOGIN/mycds/cd1/out for OSX or Linux) and start CD from there (by clicking on runcd on Windows, running 'autorun' on Linux or clicking 'Run CD on MacOS X' on OSX). Your CD will start.
7. Once browser opens, a Joomla installer should start automatically. Click next till you reach 'MySQL configuration'.

   Enter '127.0.0.1' as host name, enter 'blah' as user name and password (mysql included with Stunnix Web Server is configured to ignore access control, so it doesn't matter).

   Enter `test` as 'database name'.

   Check 'drop existing tables' checkbox (to drop tables created by Joomla used in demo), configure rest of checkboxes as you like.

8. Click Next. Joomla will ask site description - enter something and click Next.
9. Do not alter paths on the next screen, just type admin email and password.
10. Click Next, Click View Site. Then rename directory named 'installation' inside c:\mycds\cd1\out\site\www\root\cms\joomla\ (windows) or /home/YOURLOGIN/mycds/cd1/out/site/www/root/cms/joomla/ (OSX, Linux) to e.g. 'installation-was'.
11. Add line `include('configuration-stunnix.php');` to the bottom of file 'configuration.php' located in c:\mycds\cd1\out\site\www\root\cms\joomla\ (windows) or /home/YOURLOGIN/mycds/cd1/out/site/www/root/cms/joomla/ (OSX, Linux) (otherwise CD won't work on other computers).
12. Use Joomla. Install your Joomla packages, templates and bots.
13. Consider adding link for stopping CD to all pages on your site - it should have a destination of "/stop-the-server/helper-stop-httpd.exe" (in case you are running Stunnix ADVANCED Web Server) or "/spws-terminate-and-release-cd.html" (if running Stunnix PERL Web Server); you will also have to create a file "/spws-terminate-and-release-cd.html" in your project's output directory and put something like "goodbyes, thank you for using our disk or product" message there (or put a redirect to other page ther) - that is, you should have non-empty file c:\mycds\cd1\out\site\www\root\spws-terminate-and-release-cd.html (windows) or /home/YOURLOGIN/mycds/cd1/out/site/www/root/spws-terminate-and-release-cd.html (OSX, Linux) as Demo CD does.

Now your CD prototype is ready to work from HDD (but not from CD); it's not ready to work from CD because it's configured to start MySQL from CD, that will prevent Joomla from working since it updates a lot of tables on each pageview.

Also the problem is that if you will decide to alter any setting in CDBuilder and rebuild your CD (e.g. change browser properties, alter location of logo file or edit the set of supported operating systems), all your changes you've made to database (installing sample data, installation of bots, packages and templates) and changes to files (configuration-stunnix.php, configuration.php) will be lost. So you will have to "backport" all your changes to your "project input directory". Of course it's better to backport everything once you've finished installing all Joomla packages, templates and so on.

To do this, you will have to stop Stunnix web server and MySQL server first that run your Joomla-based site.

## Stage 2 - backporting changes back to input directory

1. Stop the mysql server and web server by opening URL "/stop-the-server/helper-stop-httpd.exe" (in case you are running Stunnix ADVANCED Web Server) or "/spws-terminate-and-release-cd.html" (if running Stunnix PERL Web Server) - just see copy the URL of any Joomla page (e.g. http://127.0.0.1:9001/cms/joomla/ ) and enter URL http://127.0.0.1:9001/stop-the-server/helper-stop-httpd.exe (in case of Stunnix ADVANCED Web Server) or http://127.0.0.1:9001/spws-terminate-and-release-cd.html (in case of Stunnix PERL Web Server). Wait for 30 seconds after visiting that URL.
2. It's wise to backup your project output directory - i.e. c:\mycds\cd1\out\ (windows) or /home/YOURLOGIN/mycds/cd1/out/ (OSX, Linux).
3. Clear web content directory in project INPUT directory, that is c:\mycds\cd1\in\content\ (windows) or /home/YOURLOGIN/mycds/cd1/in/content (OSX, Linux). Copy web content from c:\mycds\cd1\out\site\www\root\ (windows) or /home/YOURLOGIN/mycds/cd1/out/site/www/root/ (OSX, Linux) to project's input web content directory: c:\mycds\cd1\in\content\ (windows) or /home/YOURLOGIN/mycds/cd1/in/content/ (OSX, Linux).
4. Clear database files in project INPUT directory c:\mycds\cd1\in\databases (windows) or /home/YOURLOGIN/mycds/cd1/in/databases (OSX or Linux) and copy all database files from CD prototype - from c:\mycds\cd1\out\extensions\data (windows) or /home/YOURLOGIN/mycds/cd1/out/extensions/data (OSX or Linux) to directory you've just cleared.
5. Go to Project, Site Settings in the CDBuilder (we assume you didn't close CDBuilder window; if you've closed it - start CDBuilder again, do Project, Open and select your project).
6. Go to Project, Site Settings.
7. Click Databases, Mysql. Change 'Run from CD' to ANYTHING else (since Joomla updates database tables on each pageview), e.g. 'Copy to temp directory on HDD each time' (so that all changes made by user are lost each time user runs CD).
8. Change other CD settings in that dialog as you wish, click OK.
9. Click 'Make prototype', 'Clear dir with prototype then copy all files'.

Now you play with your site settings, click 'Make prototype', 'Clear dir with prototype then copy all files' and your project's output directory will reflect all your changes.