Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Wednesday, June 22, 2011

Host Your Site on Google AppEngine in 7 Easy Steps

Project/Example Site: http://gae-flat-web.appspot.com



Host Your Site on Google AppEngine in 7 Easy Steps:
  1.  Register any $App at Google ApEngine using your Gmail Account
    {as if $App is you Application Name giving you url like $App.appspot.com}

  2.  Download the Python Script 'flat.py' provided on this site or from repo
  3.  Execute #python flat.py $App
  4.  It will created required structure in a dir $App
  5.  Copy all your static site to $App/flat_web/*
  6.  Download "Google AppEngine Python SDK"
  7.  Update this $App using Google AppEngine SDK as
        #python appcfg.py update $Path_to_App

[[ Your own Static Content Website served by Google AppEngine ]]

 It's GitHub Repository: https://github.com/abhishekkr/gae-flat-web

Thursday, August 5, 2010

run PYTHON (no-script) to provide a CGI supported HTTP Server

want HTTP Server with CGI Support, just need PYTHON without any scripts

so to have CGI supported HTTP server, just by using PYTHON, you need to follow below steps

Step#1. 
opening shell/command-prompt

Step#2.
$>cd (change dir) to directory you want to be root of your server

Step#4.
create a directory name 'cgi-bin' or 'htbin', say "mkdir cgi-bin"

Step#5.
copy all your CGI-scripts to this newly created 'cgi-bin' directory


Step#6. 
now if anyhow you changed your directory, change it back to Parent Dir of created dir 'cgi-bin'

Step#7. 
now run this command without quotes 
"python -m CGIHTTPServer"

Finally, [ Say yyippppeeeee... ] Thanks...

now you have a CGI supported Simple HTTP Server running, that can be accessed at Port 8000 of your Server's IP/Name

so you can test it by browsing in any web browser at http://YOUR_SERVER_IP:8000/
and like if you copied any script 'time' to cgi-bin then its accessible at http://YOUR_SERVER_IP:8000/cgi-bin/time

is( PYTHON installed ){ Yes: you have a simple HTTP server }

is Python installed, you already have Simple HTTP Server

if you need any simple plain web-server on your machine to server files (html or else)
and
if you have PYTHON installed over your machine
then
you don't need anything else
because
you can run PYTHON itself in Simple HTTP Server mode to serve files from any directory you need
by
following below steps
Step#1.
[ opening shell/command-prompt ]
Step#2.
[ $>cd (change dir) to directory you want to be root of your server ]
Step#3.
[ run this command without quotes "python -m SimpleHTTPServer" ]
Finally, [ Say abra-ca-dabra... ] Thanks...
now
you have a Simple HTTP Server running, that can be accessed at Port 8000 of your Server's IP/Name
so
you can test it by browsing in any web browser at http://YOUR_SERVER_IP:8000/