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:
- Let’s create a subdomain, for example demo.domain.ru;
- Install Joomla on a subdomain;
- Install and configure our demo-expansion, which wake up show around the world;
- Let’s create a new user and assign him to a group of «Manager»;
- 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”:
- 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!
- 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”.
- Through phpmyadmin will do a full database dump demo-site, call the file «dump.sql» and set to the directory “/ home / {user} / demo.restorefrom”.
- 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 / demoand load it into the “/ home / {user} / demo.restorefrom”
- We now turn to the web hosting control panel and add a task to cron:
/ Bin / sh / home /{user}/ Demo.restorefrom / restore.shas 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!
