User Tools

Site Tools


web2py_on_dreamhost

This is an old revision of the document!


Installing Web2Py on DreamHost


Under construction!

  • For starters, see the README file at https://github.com/web2py/web2py.
  • Create a fully-hosted domain at DreamHost. I used web2py.bikmort.com.
  • Site configuration options include: Remove WWW from beginning of name; use PHP 5.6 FastCGI (default) and Passenger.
  • Since DreamHost uses Passenger as its web app server, extra steps are required to get Web2Py working.
  • Use a shell account to open a terminal window on your DreamHost server.
  • Create a virtual python environment in ~/python (could go elsewhere, but remember the path):
$ 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):
$ cd ~/web2py.bikmort.com
$ 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 in passenger_wsgi.py (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 created earlier.
  • Create tmp/restart.txt. Touch this file to force relaunch of Web2Py via Passenger.

The Web2Py environment should now be operational. Visit the domain created earlier to see it.

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 DreamHost server, and pull changes to applications/wdw directory.

Sending Email from Web2Py Using Google G Suite

  • 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.

Remote Admin Access

  • Enable https from the DreamHost domain management panel.
  • The free certificate from “Let's Encrypt SSL” works.
  • Wait for a few minutes for the certificate to get created and installed.
  • Restart the web server by touching tmp/restart.txt.
web2py_on_dreamhost.1485363718.txt.gz · Last modified: 2017/01/25 09:01 by jtkorb