web2py_on_dreamhost
This is an old revision of the document!
Table of Contents
Installing Web2Py on DreamHost
- For starters, see the README file at https://github.com/web2py/web2py.
- Create a fully-hosted domain at DreamHost. I used web2py.bikmort.com. Suggested options include: Remove WWW from beginning of name, use PHP 5.6 FastCGI (default), use Passenger (required, perhaps the default).
- Be sure to enable a shell account to access the DreamHost server.
- Since DreamHost uses Passenger as its web app server, extra steps are required to get Web2Py working.
- Open a terminal window on your DreamHost server. Create a virtual python environment in ~/python:
cd ~ virtualenv python
- Clone sources from Web2Py github site into web-server directory (using web2py.bikmort.com as an example):
git clone --recursive https://github.com/web2py/web2py.git web2py.bikmort.com
- To update to latest Web2Py later (from within web-server directory):
git pull --recurse-submodules * Copy handlers/wsgihandler.py to ./passenger_wsgi.py and edit:
cp handlers/wsgihandler.py passenger_wsgi.py
- Insert these two lines at around line 40 (before call to os.path.isdir):
INTERP = os.path.join(os.environ['HOME'], 'python', 'bin', 'python') if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
- Note that the INTERP path points to the virtualenv-created executable.
- Create tmp/restart.txt. Touch this file to force relaunch of Web2Py via Passenger.
EVE Online Steps
- Additional modules needed by EVE Online Web2Py application (install using ~/python/pip install module):
~/python/pip install requests ~/python/pip install bravado # some effort to fully install; needed to --force-reinstall ~/python/pip install functools32 # should have been installed automatically with bravado
Notes
- There are two branches in the top-level repository: master (the standard Web2Py version) and dreamhost (the additions to run it on DreamHost).
- To see the differences, use “git diff master” (assuming “dreamhost” is current branch).
- Use “git merge master” to pull changes to the master into the dreamhost branch.
Example: WDW
- An empty WDW application at https://bitbucket.org/jtkorb/wdw.
- Clone into applications directory and it (should be) ready to go.
- Current model is to develop on laptop, test locally, commit changes, ssh to buxton.dreamhost.com, and pull changes to applications/wdw.
Sending Email from Web2Py
- These steps do not currently (1/8/2017) appear to work reliably (Google-imposed security concerns). Should find a better way to send email.
- Edit applications/appname/private/appconfig.ini
- Login: email-login:password
- Use SSL with port 465
- At Google-app admin site: allow insecure applications and disable captcha.
web2py_on_dreamhost.1484583400.txt.gz · Last modified: 2017/01/16 08:16 by jtkorb