Creating a demo-site on Joomla 1.5

Suppose you have a product that you want to show others so do not just show up and give it to feel. People will feel different: normal, curious, and potentially bad. Of course you can just put a demo-user in the group «Manager», thus prohibiting him access to the global configuration and installation / removal of extensions, but does not solve the problem of content contained in your product, which the trackers will feel with open arms: edit, delete, create your own. Of course all these actions will spoil the appearance of the product. Close access to content – to close access to the product! Output is: periodic updates of the database at regular intervals.

And so it begin:

  1. Let’s create a subdomain, for example demo.domain.ru;
  2. Install Joomla on a subdomain;
  3. Install and configure our demo-expansion, which wake up show around the world;
  4. Let’s create a new user and assign him to a group of «Manager»;
  5. For security in the global configuration disable ftp-mode.

Now we come to the aid of a great and mighty cron, Who will perform all the dirty rabotenka: every hour to remove all the database table to demo-site and create new ones from backup and clean directory with demo-site and then re-copy the original files, to bring all the chaos on the demo-site left after the Rangers in the initial state.

Suppose that our demo-site is physically located in the directory “/ home / {user} / public_html / demo”:

  1. Create a new directory “/ home / {user} / demo.restorefrom”. It is not necessary to create a directory «demo.restorefrom» Directory «public_html» thus providing public access to it!
  2. With the help of web hosting control panel or SSH copy the contents of the directory “/ home / {user} / public_html / demo” to “/ home / {user} / demo.restorefrom / demo”.
  3. Through phpmyadmin will do a full database dump demo-site, call the file «dump.sql» and set to the directory “/ home / {user} / demo.restorefrom”.
  4. Let’s create a shell script restore.sh with the following contents:
    #! / Bin / sh
    mysql -U{mysql username} -P{mysql password} {database name} <Dump.sql
    rm-rf / home /{user}/ Public_html / demo
    mkdir / Home /{user}/ Public_html / demo
    cp demo/ * / Home / {user} / public_html / demo

    and load it into the “/ home / {user} / demo.restorefrom”

  5. We now turn to the web hosting control panel and add a task to cron:
    / Bin / sh / home /{user}/ Demo.restorefrom / restore.sh

    as well as expose time every hour: (0 *)

That’s it! Do not forget to replace the path with your own, in the file restore.sh specify its name database username and password!

Comments are closed.