I need to create a webpage that will generate demo similar to https://django-cms.org/en/demo/.
To generate demo, just click Get your demo!
I dont mind about the language, PHP or anything, as long as free and open source.
When the button clicked, it will run /var/testing/makesite.sh
Inside makesite.sh, it has code urlnya="$thegeneratedurl".
If we run echo http://$urlnya/, it will show the full URL like http://site1045.demosite.com/.
After demo website has been generated, I need it display link
There are some PHP example to achieve this by shell_exec, but I scared if its not really safe, and I dont know how to show progress and return the demo URL just like in the Django CMS site.
Well in python you have
subprocessandenvoyto executeGNU/Linuxcommands. You can also usefabricto do this.In order to acheive this you might need to learn how to use
virtualenvand uniqueport nohas to created for each application.This deserves a separate wrong write up. I cannot write whole source code though it is interesting.
For url part, recommend you to use random
subdomainor different idea. You might need to store list of all previously generated values in DB or check currently running demo sites to avoid clash.Referenceshttp://docs.python.org/library/subprocess.html
https://github.com/kennethreitz/envoy
http://pypi.python.org/pypi/virtualenv
http://docs.fabfile.org/en/1.4.2/index.html