Jun 27 2014
Build steps for configuration Module-stage-8
These final sections are adapted from deployment notes here
At this late point in the module assembly, there should already be a new Python 2.7.6 environment available
1) Start from completed system Module-stage-7
2) Verify access to updated Python Since the Centos 6.5 system default python 2.6.6 remains intact, activate the updated by invoking the virtual environment created earlier
source /opt/installs/venv/bin/activate python --version Python 2.7.6
3) Enable httpd server-info for EAS debugging By default this will (rightly) be disabled. These directions are adapted from http://httpd.apache.org/docs/current/mod/mod_info.html
Edit /usr/local/httpd/conf/httpd.conf to uncomment these lines
LoadModule authz_core_module modules/mod_authz_core.so LoadModule authz_host_module modules/mod_authz_host.so # disable ASAP after EAS debugging LoadModule info_module modules/mod_info.so
and also add a section like this at the bottom of /usr/local/httpd/conf/httpd.conf
<Location /server-info> SetHandler server-info Allow from 10.x.xx.108 </Location>
then navigate a browser to the new location https://sg11/server-info
4) Build mod_wsgi from source This is the mighty Web Server Gateway Interface module for Apache httpd that lets Python in; steps below adapted from the project documentation at https://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
When a migration was forced from code.google.com, Graham Dumpleton appears to have created the new distribution point on GitHub.
cd /opt/installs wget -O mod_wsgi-4.2.3.tar.gz \ https://github.com/GrahamDumpleton/mod_wsgi/archive/4.2.3.tar.gz tar xvf mod_wsgi-4.2.3.tar.gz cd mod_wsgi-4.2.3 ./configure --with-apxs=/usr/local/httpd/bin/apxs --with-python=/usr/local/bin/python2.7 make
5) Install mod_wsgi as httpd module Done as root.
cd /usr/local/httpd/modules cp /opt/installs/mod_wsgi-4.2.3/src/server/.libs/mod_wsgi.so .
Edit /usr/local/httpd/conf/httpd.conf to include the following line in the general vicinity of line 153 below similar statements, and load wsgi_mod
LoadModule wsgi_module modules/mod_wsgi.so
Restart the newly modded web server
verify the richness of the new wsgi_mod by browsing to the location like
6) Build Psycopg from source and install Done as system user postgres after making the upgrade to Python 2.7.6 a default choice
cp /usr/bin/python /usr/bin/python2.6 rm /usr/bin/python ln -s /usr/local/bin/python2.7 /usr/bin/python su - postgres cd /opt/installs wget https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.5.3.tar.gz cd psycopg2-2.5.3
In the psycopg directory, edit setup.cfg to point to PG configuration script pg_config
by uncommenting and setting this line to point at the postgresql built from source NOT using the –with-gssapi configure option.
then build the module, and install
python2 setup.py build sudo python setup.py install
7) Confirm PROJ.4 and GEOS installs Already done as Module-Stage-3, Step 4 and Step 5 for PROJ.4 and GEOS, respectively.
8) Drop in Django Done as root to load as a resource in system Python. Uses pip installer that was installed during Module-Stage-1, Step 9, which makes the process exceedingly easy.
pip install Django==1.6.5
cd /opt/installs wget -O zain-jogging-0.2.2.tar.gz https://github.com/zain/jogging/tarball/v0.2.2 tar xvf zain-jogging-0.2.2.tar.gz cd zain-jogging-976ff35 python2 setup.py install
10) Install EAS source Clone the EAS source from Atlassian Bitbucket repository. The following example describes the URL for bitbucket user “RacerX”, then saves a copy of the clone directory with a date stamp. The cloning time might be over 10 minutes, so
cd /opt/installs hg clone https://RacerX@bitbucket.org/sfgovdt/eas cp -r eas eaas_clone_yyyymmdd_hhmm cd /opt/installs/eas
Initial deployment involves copying the eas folder to root of httpd web content. Here the copy is named with trailing ‘0’ for testing purposes.
cd /opt/installs cp -r eas /htdocs/eas0
cd /opt/installs wget http://openlayers.org/download/OpenLayers-2.13.1.tar.gz tar xvf OpenLayers-2.13.1.tar.gz
cd /opt/installs wget http://cdn.sencha.com/ext/gpl/ext-4.2.1-gpl.zip unzip ext-4.2.1-gpl.zip
13) Deploy EAS web application code The deployment of EAS web app involves copying code to a chosen directory in Tomcat / webapps. Part of the process has been automated, but it is not detailed here in the system build procedure.