Mark Scrimshire
B: http://ekive.blogspot.com
....Sent from my iPhone
Saturday, May 19, 2012
The view from 10th floor of Microsoft NERD campus as #healthfoo Saturday gets going
Friday, May 18, 2012
#healthfoo kicks office
It is great to be in Boston at the Microsoft NERD campus for healthfoo. We are harnessing collective intelligence with overlapping interests but diverse backgrounds. We are in the networking age. Per Reid Hoffman we need to place ourselves in networks were interesting and valuable people come to you.
B: http://ekive.blogspot.com
....Sent from my iPhone
Paul Tahini, Sara Winge and Tim O'Reilly introduce #Healthfoo. Health and technology are on a collision course.
Crowd sourcing and health care on a collision course. Looking at things that move slowly and gradually an then suddenly exploding. Health care feels like it is getting closer to that tipping point. After introductions the wall gets created.I have propose a session for Noon on Saturday on
"breaking the glass wall in healthcare - embracing patient generated data"
B: http://ekive.blogspot.com
....Sent from my iPhone
Arrived in Boston for #Healthfoo
I arrived early in Boston for O'Reilly's HealthFoo. First stop is food - the friendly toast. I am with David Hale who went with a breakfast of champions which included M&M pancakes, toast and eggs. I went for the peasant - eggs and Cuban rice, spinach egg whites and black beans, topped with enormous hunks of a cornmeal and molasses bread. Delicious! Perfect to recharge the batteries after having just a few hours sleep a night for much of the last week.
B: http://ekive.blogspot.com
....Sent from my iPhone
Now I am ready for HealthFoo and ten back to prepare for Healthca.mp/RDU next week.
Mark ScrimshireB: http://ekive.blogspot.com
....Sent from my iPhone
Wednesday, May 09, 2012
Just finished a great meeting w/Audax the firestarter's for @healthcamprdu
Why not join Audax at healthca.mp/RDU on Wednesday May 23rd in Raleigh, NC
B: http://ekive.blogspot.com
....Sent from my iPhone
The view from the Georgetown waterfront park near Audax Health's office.
Mark ScrimshireB: http://ekive.blogspot.com
....Sent from my iPhone
Thursday, May 03, 2012
This evening I am reviewing Capstone Projects at #JHU Carey Business School
Tonight I am reviewing some of the capstone project presentations at the Carey Business School. I arrived early and am enjoying this incredible view while I sort out some details for the Washington DC Health Data and Innovation week on June 2-7th which include Healthca.mp/DC on June 4th. Otis going to be an incredible week. Come on and join us.... Meanwhile, back to that fabulous view...
Mark Scrimshire
B: http://ekive.blogspot.com
....Sent from my iPhone
Wednesday, May 02, 2012
Adventures in Apache/Python Configuration: Getting Python running in an Apache Shared Hosting environment
Recently I have been doing some development with Python/Django. I have been working with Alan Viars of Videntity and working with his Restcat open source activity tracker.
One thing I wanted to do was to get my own copy of Restcat running on my bluehost account. I have used Bluehost for many years. It has proven to be a reliable shared hosting environment for me offering good value for money.
One of the challenges with getting Python running with Apache is that in a shared hosting environment you can't necessarily get at the Apache Configuration file or the virtual server configuration file. This leaves you with a more limited subset of options that can be applied using the .htaccess file.
After a lot of experimentation I finally succeeded in getting Python running and I thought I would document the setup here. I am doing this for two reasons:
1. Other may find this useful in tackling a similar challenge.
2. I do not profess to be an expert in Apache configuration so I am sure that other experts can point out improvements to the configuration I ended up with.
First, let's start with an outline of the configuration.
The web documents used by apache are stored in {User Account}/public_html
I didn't want my Python files in the web document folders, so I created a Python Apps folder. I placed this in {User Account}/pyapps
I followed the instructions from Bluehost to install Python in my user account. I also used VirtualEnv to be able to isolate the setup for individual python apps. This resulted in python being installed in {User Account}/python. Python 2.7.2 is the version that is installed.
My virtualenv configuration placed python code in {User Account}/my_python_env1/
RESTCat was installed in to {User Account}/pyapps/RESTCat
Bluehost offers SSH Access so you can connect securely to your account and check that your python application works.
The next step is to get the python application to be run when you access via the Apache web server. This was the fun part!
To get this working I brought a number of elements together.
I used cPanel to setup a subdomain. in this case http://restcat.ekive.com.
In the Apache web documents directory {User Account}/public_html I created an apps directory. ie. {User Account}/public_html/apps
My plan is to create an application folder in side this apps directory for each Python Application I want to install. So for Restcat we have:
{User Account}/public_html/apps/restcat
I configured the subdomain redirection to point to a Document Root of {Home}/public_html/apps/restcat
The next step was to mess with .htaccess and use the FCGI Daemon that is configured in Apache.
I setup .htaccess in {User Account}/public_html/apps/restcat
ie. {User Account}/public_html/apps/restcat/.htaccess
In the restcat directory I also placed a symlink to the location where the static files for the application are stored.
ln -s {User Account}/public_html/static/restcat/mainstatic/ static
This file is used to control how Apache handles content.
AddHandler fcgid-script .fcgiOptions +SymLinksIfOwnerMatchRewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]ErrorDocument 500 '<h2>(Restcat) Application Error!</h2>Application Failed to load correctly'
I think the .htaccess file still needs optimizing in order to point to the location of the Static files and admin media files before getting to the python/fcgi stage but this gets the app going.
What is in .htaccess?
AddHandler tells Apache to use the FCGI daemon when it encounters a file with a .fcgi extension.
I will leave experts in Apache configuration to explain most of this file but the last two lines are important.
The ErrorDocument 500 line will write something to the browser if the .htaccess file is executed but the application doesn't run (in this case the mysite.fcgi file)
The RewriteRule basically passes anything that hasn't been executed up to this point and passes it to the mysite.fcgi file. It is the mysite.fcgi file that will execute the python application. So let's look at that next.
Getting this file working was troublesome because you can get different errors between Apache executing the file and running the file directly from the SSH command line. In the end this mostly seems to come down to getting all the necessary components added to the PATH before Apache tries to execute them. Once again I am sure there are Python and Shell experts out there that can tell me far more efficient ways to accomplish this, but at least this worked!
#!/usr/bin/pythonimport sys, ossys.path.insert(0, "{USER ACCOUNT}/python")sys.path.insert(0, "{USER ACCOUNT}/my_python_env1/lib/python2.7/site-packages")sys.path.insert(0, "{USER ACCOUNT}/my_python_env1/lib/python2.7/site-packages/flup-1.0.2-py2.7.egg")sys.path.insert(0, "{USER ACCOUNT}/my_python_env1")sys.path.insert(0, "{USER ACCOUNT}/pyapps/python-omhe")base = os.path.dirname(os.path.abspath(__file__))sys.path.append(base)sys.path.append(base + '/..')sys.path.append('{USER ACCOUNT}/pyapps')sys.path.insert(0,"{USER ACCOUNT}/pyapps/RESTCat")os.environ['DJANGO_SETTINGS_MODULE'] = 'RESTCat.settings'# switching to FCGIfrom django.core.servers.fastcgi import runfastcgirunfastcgi(method="threaded", daemonize="false")
So #!/usr/bin/python is there to execute in python
We then import the os and sys components.
Next we add a series of directories to the PATH so that this routine can find all the components it needs. For me this involved pointing to the python installation, site-packages - so django and other components could be found, the flup egg file (Bluehost recommends flup as a fcgi to wsgi interface and who am I to argue). I also needed to point to the python-omhe installation which is needed by RESTCat.
I also added the location of my Python apps and RESTCat specifically to the PATH.
I then pointed to the RESTCat settings file.
The final step was to load the fastCGI interface from the django libraries and execute.
When you put all these pieces together you can point at a sub-domain that is hosted on an Apache Shared Host have it execute a python application.
If I want to add another Python Application I can create an additional folder in the {USER ACCOUNT}/public_html/apps directory and tweak the mysite.fcgi file in that folder to point to a different python application.
I welcome any suggestions to optimize this setup, in particular to see if it is possible to write an Apache rule in .htaccess to point to static files in a directory located elsewhere in the Apache document root, rather than being a sub-directory of the apps/{python app} folder in the web document area.
In other words:
Have http://restcat.ekive.com run from
ekive.com/apps/restcat and use static files in
The same also goes for the Django static files used in the admin library.
This configuration successfully runs python from Apache wthout placing the python code in the Apache web document folder structure.
Reporting from #DCTech In Washington DC @dctechmeetup
This evening I was at the #DCTech Meetup in Washington DC. As reported by Peter Corbett of iStrategy Labs and one of the organizing team - This is the largest Tech Meetup on the Meetup platform.
Here is the link: http://www.meetup.com/DC-Tech-Meetup/events/30727511/
Here is the Agenda - A lot of great quick fire presentations:
[7:00] Intro by Peter Corbett, CEO, iStrategyLabs (@corbett3000)
[7:05] Community News
[7:10] Talk 1: DC DECIBEL by David, Julia and Alex
[7:15] Talk 2: FakeIt Until You Make it by Rebecca Thorman
[7:20] Talk 3: The Crazy Story of Doodle or Die by Dylan Green and Aaron Silverman
[7:25] Talk 4: RelayFoods by Arnie Katz
[7:30] Talk 5: Hacking Diversity in Tech by Christine Johnson,
[7:35]
Q&A With First Group of speakers
[7:40] Talk 6: Hacking Startup PR by Navroop Mitter
[7:45] Talk 7: Fancy Lads Academy by Chris Bishop and Scott Cummings
[7:50] Talk 8: ExFed by Emily Coates
[7:55] Talk 9: SocialSamba by Cheryl Foil
[8:00]
Q&A With Second Group of Speakers
[8:05] Talk 10: GE Social Fridge by
Zach Saale & Audrey Matthias[8:10] Talk 11: Zaarly by Eric Koester
[8:15] Talk 12: SuperPowered by Jason Kende & Ben Fisher
[8:20] Q&A With Third Group of Speakers
[8:30] Open Mic
[9:00] Exit
I was tweeting from the event: Here is my TweetStream for#DCTech
@HealthCampRDU is looking great. Finalizing the arrangements for Weds 5/23 in Raleigh,NC #hcrdu Are you in?http://healthca.mp/rdu/tickets
Heading out of DC after another great #dctech event. Thanks to@corbett3000 and crew http://pic.twitter.com/W9PmYdG6
Subscribe to:
Posts (Atom)