|Version 20 (modified by 8 years ago) ( diff ),|
Table of Contents
OpenShift is an Open Hybrid Cloud Application Platform / PaaS by Red Hat.It has a free plan as well as enterprise pricing options.
The first step is to create an account on OpenShift - it's free and easy.
The next step is to intstall RHC.RHC is the OpenShift client tool. The simplest way to install it is to do
sudo gem install rhc
Deploy the template Web2py app
You can follow the instructions given in the readme except change the Python version to 2.7 instead of 2.6
The basic steps are-
Create a python-2.7 application
rhc app create -a YOUR_APP_NAME -t python-2.7
Add this upstream repo
cd YOUR_APP_NAME git remote add upstream -m master git://github.com/prelegalwonder/openshift_web2py.git git pull -s recursive -X theirs upstream master Note: If you want a specific release and not the latest snapshot, replace "master" with the branch name in the above lines (ie. 2.3.2).
Then push the repo upstream
That's it, you can now checkout your application at:
https://YOUR_APP_NAME-$yournamespace.rhcloud.com # you'll be prompted for your namespace while creating your account, you needn't worry about it.
Once your app is up you'll need administrative access to continue.For the admin app to work you need to put your password hash in parameters_8080.py in wsgi/web2py/.
If you are using Ubuntu, you can find in your laptop, in "/home/YOUR_APP_NAME/wsgi/web2py/" a file called Parameters_*.py. there is a possibility that you can find more than one, with different numbers at the end. remove all of this file. then:
$web2py.py -p 8080 -a YOUR_PASSWORD
$web2py -p 8080 -a YOUR_PASSWORD
it will create a file called 'Parameters_8080.py' in directory /home/YOUR_APP_NAME/wsgi/web2py/ then do these:
$ln -s parameters_8080.py parameters_443.py $ln -s parameters_8080.py parameters_80.py $ln -s parameters_8080.py parameters_8000.py $git add . $git commit $git push
Your parameters_*.py files will be sent to openshift. And then you can open https://YOUR_APP_NAME-$yournamespace.rhcloud.com via your web browser, and use your password you just created. if it is not working, try to enable your browser to accept cookies.
Package and deploy Eden
Now locally create package your local Eden setup via the administrative interface.
Then create a new application on your OpenShift by uploading the package.
Once Eden is installed you will need OpenShift to install a lot of the required packages and libraries for it to work.For that edit the setup.py file in the following way-
Edit the install_requires line to
Note that these are only some of the libraries - please add them as needed.
Commit these changes and push them to OpenShift.
To deploy updates simply package Eden locally and re-deploy it on OpenShift via the admin interface ( check the overwrite installed app option)
- Have the admin interface directly fetch Eden from a Git repo.