[cig-commits] r16026 - in cs/portal/trunk: . doc doc/admin

leif at geodynamics.org leif at geodynamics.org
Mon Nov 23 18:17:12 PST 2009


Author: leif
Date: 2009-11-23 18:17:12 -0800 (Mon, 23 Nov 2009)
New Revision: 16026

Added:
   cs/portal/trunk/doc/
   cs/portal/trunk/doc/admin/
   cs/portal/trunk/doc/admin/Makefile
   cs/portal/trunk/doc/admin/_build/
   cs/portal/trunk/doc/admin/_static/
   cs/portal/trunk/doc/admin/_templates/
   cs/portal/trunk/doc/admin/conf.py
   cs/portal/trunk/doc/admin/deps.rst
   cs/portal/trunk/doc/admin/index.rst
   cs/portal/trunk/doc/admin/make.bat
   cs/portal/trunk/doc/admin/quick.rst
   cs/portal/trunk/doc/admin/web-server.rst
Log:
Began writing the _Portal Administrator's Guide_.


Added: cs/portal/trunk/doc/admin/Makefile
===================================================================
--- cs/portal/trunk/doc/admin/Makefile	                        (rev 0)
+++ cs/portal/trunk/doc/admin/Makefile	2009-11-24 02:17:12 UTC (rev 16026)
@@ -0,0 +1,89 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html      to make standalone HTML files"
+	@echo "  dirhtml   to make HTML files named index.html in directories"
+	@echo "  pickle    to make pickle files"
+	@echo "  json      to make JSON files"
+	@echo "  htmlhelp  to make HTML files and a HTML help project"
+	@echo "  qthelp    to make HTML files and a qthelp project"
+	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  changes   to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck to check all external links for integrity"
+	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PortalAdministratorsGuide.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PortalAdministratorsGuide.qhc"
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+	      "run these through (pdf)latex."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."

Added: cs/portal/trunk/doc/admin/conf.py
===================================================================
--- cs/portal/trunk/doc/admin/conf.py	                        (rev 0)
+++ cs/portal/trunk/doc/admin/conf.py	2009-11-24 02:17:12 UTC (rev 16026)
@@ -0,0 +1,194 @@
+# -*- coding: utf-8 -*-
+#
+# Portal Administrator's Guide documentation build configuration file, created by
+# sphinx-quickstart on Wed Nov  4 18:26:44 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'Portal Administrator\'s Guide'
+copyright = u'2009, Leif Strand'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '3.3'
+# The full version, including alpha/beta/rc tags.
+release = '3.3'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+html_title = u"Portal Administrator’s Guide"
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'PortalAdministratorsGuidedoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'PortalAdministratorsGuide.tex', u'Portal Administrator\'s Guide',
+   u'Leif Strand', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True

Added: cs/portal/trunk/doc/admin/deps.rst
===================================================================
--- cs/portal/trunk/doc/admin/deps.rst	                        (rev 0)
+++ cs/portal/trunk/doc/admin/deps.rst	2009-11-24 02:17:12 UTC (rev 16026)
@@ -0,0 +1,52 @@
+
+************
+Dependencies
+************
+
+.. _web-app-dependencies:
+
+Web Application Dependencies
+****************************
+
+* Python v2.4 or later (but not Python v3.0)
+* Django v0.96 (v1.0 and later will not work)
+* pysqlite
+    + SQLite
+* GMT
+    + netCDF
+
+Note that both Python v3.0 and Django v1.0 are dramatically different from prior versions (they are not backwards compatible).  Consequently, the portal does not work with Python v3.0 or Django v1.0.
+
+Although Django has various database backends, **the portal will not work properly with anything other than SQLite**.
+
+.. _installing-sqlite:
+
+Installing SQLite and pysqlite
+==============================
+
+XXX
+
+
+
+Backend Dependencies
+********************
+
+Daemon Script
+=============
+
+* CIG Pyre
+* Stackless Python
+
+
+
+Cluster Dependencies
+********************
+
+More Pyre scripts.
+
+
+Codes
+=====
+
+Specfem and Mineos are written in Fortran.  Specfem must be a special
+version.

Added: cs/portal/trunk/doc/admin/index.rst
===================================================================
--- cs/portal/trunk/doc/admin/index.rst	                        (rev 0)
+++ cs/portal/trunk/doc/admin/index.rst	2009-11-24 02:17:12 UTC (rev 16026)
@@ -0,0 +1,26 @@
+.. Portal Administrator's Guide master file, created by
+   sphinx-quickstart on Wed Nov  4 18:26:44 2009.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Portal Administrator's Guide
+============================
+
+Contents:
+
+.. toctree::
+   :maxdepth: 1
+   :numbered:
+
+   quick.rst
+   deps.rst
+   web-server.rst
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+

Added: cs/portal/trunk/doc/admin/make.bat
===================================================================
--- cs/portal/trunk/doc/admin/make.bat	                        (rev 0)
+++ cs/portal/trunk/doc/admin/make.bat	2009-11-24 02:17:12 UTC (rev 16026)
@@ -0,0 +1,113 @@
+ at ECHO OFF
+
+REM Command file for Sphinx documentation
+
+set SPHINXBUILD=sphinx-build
+set BUILDDIR=_build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+	:help
+	echo.Please use `make ^<target^>` where ^<target^> is one of
+	echo.  html      to make standalone HTML files
+	echo.  dirhtml   to make HTML files named index.html in directories
+	echo.  pickle    to make pickle files
+	echo.  json      to make JSON files
+	echo.  htmlhelp  to make HTML files and a HTML help project
+	echo.  qthelp    to make HTML files and a qthelp project
+	echo.  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+	echo.  changes   to make an overview over all changed/added/deprecated items
+	echo.  linkcheck to check all external links for integrity
+	echo.  doctest   to run all doctests embedded in the documentation if enabled
+	goto end
+)
+
+if "%1" == "clean" (
+	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+	del /q /s %BUILDDIR%\*
+	goto end
+)
+
+if "%1" == "html" (
+	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+	goto end
+)
+
+if "%1" == "dirhtml" (
+	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+	goto end
+)
+
+if "%1" == "pickle" (
+	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+	echo.
+	echo.Build finished; now you can process the pickle files.
+	goto end
+)
+
+if "%1" == "json" (
+	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+	echo.
+	echo.Build finished; now you can process the JSON files.
+	goto end
+)
+
+if "%1" == "htmlhelp" (
+	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+	echo.
+	echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+	goto end
+)
+
+if "%1" == "qthelp" (
+	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+	echo.
+	echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PortalAdministratorsGuide.qhcp
+	echo.To view the help file:
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PortalAdministratorsGuide.ghc
+	goto end
+)
+
+if "%1" == "latex" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	echo.
+	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+	goto end
+)
+
+if "%1" == "changes" (
+	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+	echo.
+	echo.The overview file is in %BUILDDIR%/changes.
+	goto end
+)
+
+if "%1" == "linkcheck" (
+	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+	echo.
+	echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+	goto end
+)
+
+if "%1" == "doctest" (
+	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+	echo.
+	echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+	goto end
+)
+
+:end

Added: cs/portal/trunk/doc/admin/quick.rst
===================================================================
--- cs/portal/trunk/doc/admin/quick.rst	                        (rev 0)
+++ cs/portal/trunk/doc/admin/quick.rst	2009-11-24 02:17:12 UTC (rev 16026)
@@ -0,0 +1,154 @@
+
+***********
+Quick Start
+***********
+
+This chapter explains how to install the portal's web application on your workstation or laptop.  This information is geared towards
+
+* **system administrators** who wish to familiarze themselves with the web app, before installing it on a production web server;
+* **developers** who need to debug the portal; and
+* **web designers** who need to make changes to the portal's HTML templates.
+
+
+Dependencies
+************
+
+The portal's web app has the following dependences:
+
+* `Python <http://python.org/>`_ v2.5 [#sqlite]_ or later (but not Python v3.0).
+* `Django <http://www.djangoproject.com/>`_ v0.96 (v1.0 and later will not work)
+* `GMT <http://gmt.soest.hawaii.edu/>`_; and the `netCDF <http://www.unidata.ucar.edu/software/netcdf/>`_ package upon which GMT depends (these two are optional for the impatient)
+
+See :ref:`web-app-dependencies` for more information.
+
+This chapter assumes you will installing everything from source (which is not as painful as it sounds).  However, if you use a package manager to install software, it is worth checking to see whether Python, Django, and GMT are available as packages.  (**Macintosh users**: Python is preinstalled.)
+
+
+
+Installing GMT
+==============
+
+The portal uses GMT to render maps and the "beachballs" which illustrate a quake's focal mechanism.
+
+    **For the impatient:**  You may skip this section if you don't care about the resulting broken images in the portal's HTML output.  The maps and beachballs are eye candy; the portal will operate just fine without GMT.  While running the development web server (see :ref:`runserver`, below), you will see some error messages (``error: [Errno 32] Broken pipe``); you may cheerfully ignore them.
+
+GMT, in turn, depends upon netCDF.  The GMT installation script will install netCDF for you.
+
+XXX describe GMT install
+
+
+Installing Django
+=================
+
+Download Django from `the Django web site <http://www.djangoproject.com/download/>`_.  Django is pure Python; simply install it as you would any other Python package::
+
+    $ tar xzf Django-0.96.5.tar.gz
+    $ cd Django-0.96.5
+    $ python setup.py install
+
+You may prefer to install it under your home directory::
+
+    $ python setup.py install --prefix=$HOME/portal
+
+
+Installing the Portal's Web Application
+***************************************
+
+Install the web app as you would any other Python package::
+
+    $ tar xzf SeismoWebPortal-3.3.3.tar.gz
+    $ cd SeismoWebPortal-3.3.3
+    $ python setup.py install # with e.g., "--prefix=$HOME/portal", if desired
+
+**Where do I get the source package?**  If you don't have the ``SeismoWebPortal`` source package, and don't know anyone who can give you one, obtain the source directly from CIG's Subversion source code respository.  This requires that you have a Subversion client installed.
+::
+
+    $ svn export http://geodynamics.org/svn/cig/cs/portal/trunk/northridge
+    $ cd northridge
+    $ python setup.py install
+
+
+Creating the Source Package
+===========================
+
+You will need to create your own source package if:
+
+* you are developer who needs to give it to someone who doesn't have Subversion; or
+* you are a system administrator who doesn't want to install Subversion on the production server.
+
+Here's how to do it::
+
+    $ svn export http://geodynamics.org/svn/cig/cs/portal/trunk/northridge
+    $ cd northridge
+    $ python setup.py sdist
+
+After performing the ``sdist`` command, the source package may be found under the ``dist`` subdirectory.
+
+
+Setup
+=====
+
+Before you run the web app, you must set some environment variables, and create the database.
+
+Environment
+-----------
+
+If you installed Django and the portal in a "non-standard" location, you may need to futz around with your ``PATH`` and ``PYTHONPATH`` environment variables.
+::
+
+    $ export PATH=$HOME/portal/bin:$PATH
+    $ export PYTHONPATH=$HOME/lib/python2.6/site-packages
+
+In any event, a handful of environment variables must be set in order to configure Django to run the portal, and to configure the portal app itself.  `The top-level source directory <http://geodynamics.org/svn/cig/cs/portal/trunk/northridge/>`_ contains ``debug-setup.sh``, `a Bash shell script <http://geodynamics.org/svn/cig/cs/portal/trunk/northridge/debug-setup.sh>`_ which sets all of the variables described below.  If you installed GMT and netCDF, first customize ``WEBPORTAL_GMT_ROOT`` and ``WEBPORTAL_NETCDF_ROOT``.  Then simply enter a scratch directory and source the script::
+
+        $ mkdir $HOME/scratch
+        $ cd $HOME/scratch
+        $ source $src/SeismoWebPortal-3.3.3/debug-setup.sh
+
+See :ref:`web-app-env` for a description of each environment variable.
+
+
+Creating a New Database
+-----------------------
+
+Create the database::
+
+    $ django-admin.py syncdb
+
+Django will ask you whether you want to create a superuser::
+
+    You just installed Django's auth system, which means you don't have any superusers defined.
+    Would you like to create one now? (yes/no):
+
+Enter ``yes`` to create one.  This will save you the trouble of using the portal's registration page to create a new account.
+
+**Developers:**  If you are debugging a problem with the production portal, it is sometimes helpful to copy the real database from the production site, rather than creating a new database.  With a copy of the production database, you can even log in as another user!  Simply reset their password using `the admin site <http://127.0.0.1:8000/admin/>`_ -- the one running on your workstation or laptop, not the real one!  Then login to their account (well, a copy of it), and see exactly what they see -- including broken links, etc.  This lets you test bug fixes *in vitro*, without affecting the production system.
+
+
+.. _runserver:
+
+Running the Django Development Server
+*************************************
+
+Congratulations!  You've successly installed the portal.  Now start the Django development server, a lightweight web server used for development::
+
+    $ django-admin.py runserver
+    Validating models...
+    0 errors found.
+
+    Django version 0.96.5, using settings 'SeismoWebPortal.site.settings'
+    Development server is running at http://127.0.0.1:8000/
+    Quit the server with CONTROL-C.
+
+Now open the following  URL in your web browser:
+
+    http://127.0.0.1:8000/portals/seismo/
+
+The CIG Seismology Web Portal will appear.  You may login using the superuser account you created when you ran ``django-admin.py syncdb``.
+
+Feel free to muck around as much as you like.  There is no daemon connected, so even if you create a new Run, nothing will happen.
+
+
+.. rubric:: Footnotes
+
+.. [#sqlite] For brevity, this chapter also assumes you have Python v2.5 or later.  The portal with work with Python v2.4; however, you must additionally install SQLite and pysqlite.  See :ref:`installing-sqlite`.

Added: cs/portal/trunk/doc/admin/web-server.rst
===================================================================
--- cs/portal/trunk/doc/admin/web-server.rst	                        (rev 0)
+++ cs/portal/trunk/doc/admin/web-server.rst	2009-11-24 02:17:12 UTC (rev 16026)
@@ -0,0 +1,114 @@
+
+*************************
+Deploying to a Web Server
+*************************
+
+General Information
+*******************
+
+.. _web-app-env:
+
+Web Application Environment Variables
+=====================================
+
+``DJANGO_SETTINGS_MODULE``
+    Set to ``SeismoWebPortal.site.settings``.  See the Django documentation for detailed information.
+``WEBPORTAL_MEDIA_ROOT``
+    Full pathname of the directory where the portal will store all those images generated with GMT.  Specfem 3D models are also stored under this directory.
+``WEBPORTAL_DATABASE_NAME``
+    Full pathname of the SQLite database file.
+``WEBPORTAL_SECRET_KEY``
+    Arbitrary string used to encrypt cookies.  **Keep this string a secret!**  XXX describe how to create one
+``WEBPORTAL_GMT_ROOT``
+    Full pathname where GMT is installed.  The portal appends ``bin`` to this pathname in order to run various GMT commands such as ``psmeca`` and ``psbasemap``; e.g., ``$WEBPORTAL_GMT_ROOT/bin/psmeca``.
+``WEBPORTAL_NETCDF_ROOT``
+    Full pathname where netCDF is installed.  Before running a GMT command, the portal sets the environment variable ``LD_LIBRARY_PATH`` to ``$WEBPORTAL_NETCDF_ROOT/lib``.  It does this simply so that GMT commands can execute; the portal does not interact with netCDF directly.  XXX footnote
+
+
+
+Apache
+******
+
+Set up SSL.
+
+Beyond the scope of this document, but might be easy::
+
+    cd /etc/apache2/mods-enabled
+    ln -s ../mods-available/ssl.conf .
+    ln -s ../mods-available/ssl.load .
+
+    cd /etc/apache2/sites-enabled
+    ln -s ../sites-available/default-ssl 000-default-ssl
+
+
+    SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
+    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
+
+
+Need mod-python::
+
+    cd /etc/apache2/mods-enabled
+    ln -s ../mods-available/python.load .
+
+(Ubuntu creates symlink for you.)
+
+
+Configure
+=========
+
+See http://www.djangoproject.com/documentation/0.96/modpython/.  Here
+is the virtual host config::
+
+        <Location "/portals/seismo/">
+                SetHandler python-program
+                PythonHandler django.core.handlers.modpython
+                SetEnv DJANGO_SETTINGS_MODULE SeismoWebPortal.site.settings
+                #PythonDebug On
+
+                SetEnv WEBPORTAL_MEDIA_ROOT /home/portal/www-data/media
+                SetEnv WEBPORTAL_DATABASE_NAME /home/portal/www-data/database
+                SetEnv WEBPORTAL_SECRET_KEY "$2k0qi00^76%1i9r5z at i#l at l($2&-r3&!37z00-vll&9#&(skg"
+                SetEnv WEBPORTAL_GMT_ROOT /home/portal/opt/gmt
+                SetEnv WEBPORTAL_NETCDF_ROOT /home/portal/opt/netCDF
+
+                PythonPath "['/home/portal/lib/python2.4/site-packages'] + sys.path"
+
+        </Location>
+
+Restart Apache.
+
+But actually::
+
+        <Location "/portals/seismo/">
+                PythonInterpreter seismo
+
+                SetHandler python-program
+                PythonHandler django.core.handlers.modpython
+                SetEnv DJANGO_SETTINGS_MODULE SeismoWebPortal.site.settings
+                #PythonDebug On
+
+                SetEnv WEBPORTAL_MEDIA_ROOT /home/portal/www-data/media
+                SetEnv WEBPORTAL_DATABASE_NAME /home/portal/www-data/database
+                SetEnv WEBPORTAL_SECRET_KEY "$2k0qi00^76%1i9r5z at i#l at l($2&-r3&!37z00-vll&9#&(skg"
+                SetEnv WEBPORTAL_GMT_ROOT /home/portal/opt/gmt
+                SetEnv WEBPORTAL_NETCDF_ROOT /home/portal/opt/netCDF
+
+                PythonPath "['/home/portal/lib/python2.4/site-packages'] + sys.path"
+
+        </Location>
+
+        <Location "/magwebportal/">
+                PythonInterpreter mag
+
+                SetHandler python-program
+                PythonHandler django.core.handlers.modpython
+                SetEnv DJANGO_SETTINGS_MODULE MagWebPortal.site.settings
+                #PythonDebug On
+
+                SetEnv WEBPORTAL_MEDIA_ROOT /home/portal/lib/python2.4/site-packages/MagWebPortal
+                SetEnv WEBPORTAL_DATABASE_NAME /home/portal/www-data/mag-database
+                SetEnv WEBPORTAL_SECRET_KEY "$2k0qi00^76%1i9r5z at i#l at l($2&-r3&!37z00-vll&9#&(skg"
+
+                PythonPath "['/home/portal/lib/python2.4/site-packages'] + sys.path"
+
+        </Location>



More information about the CIG-COMMITS mailing list