Writing a Ruby App
diff --git a/recentFiles.json b/recentFiles.json
index 66fc59c..29f5ebf 100644
--- a/recentFiles.json
+++ b/recentFiles.json
@@ -1 +1 @@
-[{"filename":"faq_general","mtime":1422453385000,"pageTitle":"FAQ: General"},{"filename":"setting_up_postgresql","mtime":1422453385000,"pageTitle":"PostgreSQL"},{"filename":"picking_a_plan","mtime":1422453317000,"pageTitle":"Picking a Plan"},{"filename":"frameworks_wordpress","mtime":1421859765000,"pageTitle":"Getting Started with Wordpress"},{"filename":"deploying_code","mtime":1421769253000,"pageTitle":"Deploying Your Code"}]
\ No newline at end of file
+[{"filename":"running_python_cgi","mtime":1424257208000,"pageTitle":"Running a Python CGI server"},{"filename":"ide_preferences","mtime":1422860320000,"pageTitle":"IDE Preferences"},{"filename":"faq_python","mtime":1422860320000,"pageTitle":"FAQ: Python"},{"filename":"faq_ssh","mtime":1422860320000,"pageTitle":"FAQ: SSH workspaces"},{"filename":"faq_php","mtime":1422860320000,"pageTitle":"FAQ: PHP"}]
\ No newline at end of file
diff --git a/resources/images/apacheRunConfiguration.png b/resources/images/apacheRunConfiguration.png
new file mode 100644
index 0000000..cd2ac28
Binary files /dev/null and b/resources/images/apacheRunConfiguration.png differ
diff --git a/resources/images/newRunConfiguration-new.png b/resources/images/newRunConfiguration-new.png
new file mode 100644
index 0000000..897ac7a
Binary files /dev/null and b/resources/images/newRunConfiguration-new.png differ
diff --git a/resources/images/saveRunConfiguration.png b/resources/images/saveRunConfiguration.png
new file mode 100644
index 0000000..e3f7195
Binary files /dev/null and b/resources/images/saveRunConfiguration.png differ
diff --git a/src/running_and_debugging/running_python_cgi.md b/src/running_and_debugging/running_python_cgi.md
new file mode 100644
index 0000000..bbe8b3e
--- /dev/null
+++ b/src/running_and_debugging/running_python_cgi.md
@@ -0,0 +1,116 @@
+# Running a Python CGI server
+
+In order to run a Python CGI server, you can start by creating a new workspace. It doesn't have to be a Python/Django workspace, even a Custom workspace would do. You would need to tell the Apache2 server already installed on the workspace to allow CGI scripts and to make sure it knows where to look for them.
+
+Lets start by creating a very simple python CGI script:
+
+1. Create a folder within your workspace, name it `cgi-bin` (the name doesn't matter, although it is customary to use `cgi-bin`).
+2. Within the `cgi-bin` folder, create a new file. Lets name it `test.py` for now.
+3. Paste in the following:
+
+```python
+#!/usr/bin/env python
+
+print "Content-type: text/html"
+print ""
+
+print """
+
+
+Sample CGI Script
+
+
+
Sample CGI Script
+
+
+"""
+```
+
+Now, once we have a file we want to serve, lets start up the Apache web server. We can do that by creating a new runner. You can create a new runner by clicking on the + icon on the right of the tabs like shown below:
+
+[]{: #NewRunConfiguration}
+
+then select Apache httpd (PHP, HTML)
+
+[]{: #ApacheRunConfiguration}
+
+You can save this configuration by entering a name to the right of the `Command:` label like shown below.
+
+[]{: #SaveRunConfiguration}
+
+
+Click on the Run button and the apache server is ready to go. Click on the link that reads something like: `https://-.c9.io/` and you should see a browser come up with your folder listing. Clicking on the `cgi-bin` link and then the `test.py` link just shows up the text of the python file we wrote. Now that we have the server running, lets enable CGI on it.
+
+The first thing we want to do is to enable CGI mode. We can do that by typing the following within the Terminal:
+
+```bash
+sudo a2enmod cgi
+```
+
+Next, we need to tell Apache where our CGI files are present. We can do that by editing the `serve-cgi-bin.conf` file. Do the following:
+
+```bash
+sudo vi /etc/apache2/conf-available/serve-cgi-bin.conf
+```
+
+The file should read something like this:
+
+```
+
+
+ Define ENABLE_USR_LIB_CGI_BIN
+
+
+
+ Define ENABLE_USR_LIB_CGI_BIN
+
+
+
+ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+
+ AllowOverride None
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ Require all granted
+
+
+
+```
+
+We just need to modify the following section from:
+
+```
+
+ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+
+ AllowOverride None
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ Require all granted
+
+
+```
+
+to
+
+```
+
+ ScriptAlias /cgi-bin/ /home/ubuntu/workspace/cgi-bin/
+
+ AllowOverride None
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ AddHandler cgi-script .cgi .py
+ Require all granted
+
+
+```
+
+Save this file and restart Apache.
+
+Once Apache restarts, navigate to `https://-.c9.io/cgi-bin/test.py` (replacing `` and `` with your workspace name and your username of course) and see what happens? In case you're seeing something like **Internal Server Error** we need to make the files under cgi-bin to be executable.
+
+You can do that by typing
+
+```bash
+chmod +x -R /home/ubuntu/workspace/cgi-bin
+```
+
+Restart Apache one last time and you should be able to see **Sample CGI Script**.
\ No newline at end of file
diff --git a/templates/default/toc.jade b/templates/default/toc.jade
index 3a5b702..23fe325 100644
--- a/templates/default/toc.jade
+++ b/templates/default/toc.jade
@@ -135,6 +135,8 @@
ul
li.nav-submenu-item
a(href="installing_python_packages.html") Installing Python Packages
+ li.nav-submenu-item
+ a(href="running_python_cgi.html") Running a Python CGI Server
li.nav-submenu-item
a(href='writing_a_ruby_app.html') Writing a Ruby App
ul